1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/tsearch.h"
8         ],
9         "include_dirs": [
10             "yt/utilities/lib/"
11         ],
12         "libraries": [
13             "m"
14         ],
15         "name": "yt.geometry.oct_container",
16         "sources": [
17             "yt/geometry/oct_container.pyx",
18             "yt/utilities/lib/tsearch.c"
19         ]
20     },
21     "module_name": "yt.geometry.oct_container"
22 }
23 END: Cython Metadata */
24 
25 #define PY_SSIZE_T_CLEAN
26 #include "Python.h"
27 #ifndef Py_PYTHON_H
28     #error Python headers needed to compile C extensions, please install development version of Python.
29 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
30     #error Cython requires Python 2.6+ or Python 3.3+.
31 #else
32 #define CYTHON_ABI "0_29_12"
33 #define CYTHON_HEX_VERSION 0x001D0CF0
34 #define CYTHON_FUTURE_DIVISION 0
35 #include <stddef.h>
36 #ifndef offsetof
37   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
38 #endif
39 #if !defined(WIN32) && !defined(MS_WINDOWS)
40   #ifndef __stdcall
41     #define __stdcall
42   #endif
43   #ifndef __cdecl
44     #define __cdecl
45   #endif
46   #ifndef __fastcall
47     #define __fastcall
48   #endif
49 #endif
50 #ifndef DL_IMPORT
51   #define DL_IMPORT(t) t
52 #endif
53 #ifndef DL_EXPORT
54   #define DL_EXPORT(t) t
55 #endif
56 #define __PYX_COMMA ,
57 #ifndef HAVE_LONG_LONG
58   #if PY_VERSION_HEX >= 0x02070000
59     #define HAVE_LONG_LONG
60   #endif
61 #endif
62 #ifndef PY_LONG_LONG
63   #define PY_LONG_LONG LONG_LONG
64 #endif
65 #ifndef Py_HUGE_VAL
66   #define Py_HUGE_VAL HUGE_VAL
67 #endif
68 #ifdef PYPY_VERSION
69   #define CYTHON_COMPILING_IN_PYPY 1
70   #define CYTHON_COMPILING_IN_PYSTON 0
71   #define CYTHON_COMPILING_IN_CPYTHON 0
72   #undef CYTHON_USE_TYPE_SLOTS
73   #define CYTHON_USE_TYPE_SLOTS 0
74   #undef CYTHON_USE_PYTYPE_LOOKUP
75   #define CYTHON_USE_PYTYPE_LOOKUP 0
76   #if PY_VERSION_HEX < 0x03050000
77     #undef CYTHON_USE_ASYNC_SLOTS
78     #define CYTHON_USE_ASYNC_SLOTS 0
79   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
80     #define CYTHON_USE_ASYNC_SLOTS 1
81   #endif
82   #undef CYTHON_USE_PYLIST_INTERNALS
83   #define CYTHON_USE_PYLIST_INTERNALS 0
84   #undef CYTHON_USE_UNICODE_INTERNALS
85   #define CYTHON_USE_UNICODE_INTERNALS 0
86   #undef CYTHON_USE_UNICODE_WRITER
87   #define CYTHON_USE_UNICODE_WRITER 0
88   #undef CYTHON_USE_PYLONG_INTERNALS
89   #define CYTHON_USE_PYLONG_INTERNALS 0
90   #undef CYTHON_AVOID_BORROWED_REFS
91   #define CYTHON_AVOID_BORROWED_REFS 1
92   #undef CYTHON_ASSUME_SAFE_MACROS
93   #define CYTHON_ASSUME_SAFE_MACROS 0
94   #undef CYTHON_UNPACK_METHODS
95   #define CYTHON_UNPACK_METHODS 0
96   #undef CYTHON_FAST_THREAD_STATE
97   #define CYTHON_FAST_THREAD_STATE 0
98   #undef CYTHON_FAST_PYCALL
99   #define CYTHON_FAST_PYCALL 0
100   #undef CYTHON_PEP489_MULTI_PHASE_INIT
101   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
102   #undef CYTHON_USE_TP_FINALIZE
103   #define CYTHON_USE_TP_FINALIZE 0
104   #undef CYTHON_USE_DICT_VERSIONS
105   #define CYTHON_USE_DICT_VERSIONS 0
106   #undef CYTHON_USE_EXC_INFO_STACK
107   #define CYTHON_USE_EXC_INFO_STACK 0
108 #elif defined(PYSTON_VERSION)
109   #define CYTHON_COMPILING_IN_PYPY 0
110   #define CYTHON_COMPILING_IN_PYSTON 1
111   #define CYTHON_COMPILING_IN_CPYTHON 0
112   #ifndef CYTHON_USE_TYPE_SLOTS
113     #define CYTHON_USE_TYPE_SLOTS 1
114   #endif
115   #undef CYTHON_USE_PYTYPE_LOOKUP
116   #define CYTHON_USE_PYTYPE_LOOKUP 0
117   #undef CYTHON_USE_ASYNC_SLOTS
118   #define CYTHON_USE_ASYNC_SLOTS 0
119   #undef CYTHON_USE_PYLIST_INTERNALS
120   #define CYTHON_USE_PYLIST_INTERNALS 0
121   #ifndef CYTHON_USE_UNICODE_INTERNALS
122     #define CYTHON_USE_UNICODE_INTERNALS 1
123   #endif
124   #undef CYTHON_USE_UNICODE_WRITER
125   #define CYTHON_USE_UNICODE_WRITER 0
126   #undef CYTHON_USE_PYLONG_INTERNALS
127   #define CYTHON_USE_PYLONG_INTERNALS 0
128   #ifndef CYTHON_AVOID_BORROWED_REFS
129     #define CYTHON_AVOID_BORROWED_REFS 0
130   #endif
131   #ifndef CYTHON_ASSUME_SAFE_MACROS
132     #define CYTHON_ASSUME_SAFE_MACROS 1
133   #endif
134   #ifndef CYTHON_UNPACK_METHODS
135     #define CYTHON_UNPACK_METHODS 1
136   #endif
137   #undef CYTHON_FAST_THREAD_STATE
138   #define CYTHON_FAST_THREAD_STATE 0
139   #undef CYTHON_FAST_PYCALL
140   #define CYTHON_FAST_PYCALL 0
141   #undef CYTHON_PEP489_MULTI_PHASE_INIT
142   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
143   #undef CYTHON_USE_TP_FINALIZE
144   #define CYTHON_USE_TP_FINALIZE 0
145   #undef CYTHON_USE_DICT_VERSIONS
146   #define CYTHON_USE_DICT_VERSIONS 0
147   #undef CYTHON_USE_EXC_INFO_STACK
148   #define CYTHON_USE_EXC_INFO_STACK 0
149 #else
150   #define CYTHON_COMPILING_IN_PYPY 0
151   #define CYTHON_COMPILING_IN_PYSTON 0
152   #define CYTHON_COMPILING_IN_CPYTHON 1
153   #ifndef CYTHON_USE_TYPE_SLOTS
154     #define CYTHON_USE_TYPE_SLOTS 1
155   #endif
156   #if PY_VERSION_HEX < 0x02070000
157     #undef CYTHON_USE_PYTYPE_LOOKUP
158     #define CYTHON_USE_PYTYPE_LOOKUP 0
159   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
160     #define CYTHON_USE_PYTYPE_LOOKUP 1
161   #endif
162   #if PY_MAJOR_VERSION < 3
163     #undef CYTHON_USE_ASYNC_SLOTS
164     #define CYTHON_USE_ASYNC_SLOTS 0
165   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
166     #define CYTHON_USE_ASYNC_SLOTS 1
167   #endif
168   #if PY_VERSION_HEX < 0x02070000
169     #undef CYTHON_USE_PYLONG_INTERNALS
170     #define CYTHON_USE_PYLONG_INTERNALS 0
171   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
172     #define CYTHON_USE_PYLONG_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_PYLIST_INTERNALS
175     #define CYTHON_USE_PYLIST_INTERNALS 1
176   #endif
177   #ifndef CYTHON_USE_UNICODE_INTERNALS
178     #define CYTHON_USE_UNICODE_INTERNALS 1
179   #endif
180   #if PY_VERSION_HEX < 0x030300F0
181     #undef CYTHON_USE_UNICODE_WRITER
182     #define CYTHON_USE_UNICODE_WRITER 0
183   #elif !defined(CYTHON_USE_UNICODE_WRITER)
184     #define CYTHON_USE_UNICODE_WRITER 1
185   #endif
186   #ifndef CYTHON_AVOID_BORROWED_REFS
187     #define CYTHON_AVOID_BORROWED_REFS 0
188   #endif
189   #ifndef CYTHON_ASSUME_SAFE_MACROS
190     #define CYTHON_ASSUME_SAFE_MACROS 1
191   #endif
192   #ifndef CYTHON_UNPACK_METHODS
193     #define CYTHON_UNPACK_METHODS 1
194   #endif
195   #ifndef CYTHON_FAST_THREAD_STATE
196     #define CYTHON_FAST_THREAD_STATE 1
197   #endif
198   #ifndef CYTHON_FAST_PYCALL
199     #define CYTHON_FAST_PYCALL 1
200   #endif
201   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
203   #endif
204   #ifndef CYTHON_USE_TP_FINALIZE
205     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
206   #endif
207   #ifndef CYTHON_USE_DICT_VERSIONS
208     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
209   #endif
210   #ifndef CYTHON_USE_EXC_INFO_STACK
211     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
212   #endif
213 #endif
214 #if !defined(CYTHON_FAST_PYCCALL)
215 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
216 #endif
217 #if CYTHON_USE_PYLONG_INTERNALS
218   #include "longintrepr.h"
219   #undef SHIFT
220   #undef BASE
221   #undef MASK
222   #ifdef SIZEOF_VOID_P
223     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
224   #endif
225 #endif
226 #ifndef __has_attribute
227   #define __has_attribute(x) 0
228 #endif
229 #ifndef __has_cpp_attribute
230   #define __has_cpp_attribute(x) 0
231 #endif
232 #ifndef CYTHON_RESTRICT
233   #if defined(__GNUC__)
234     #define CYTHON_RESTRICT __restrict__
235   #elif defined(_MSC_VER) && _MSC_VER >= 1400
236     #define CYTHON_RESTRICT __restrict
237   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
238     #define CYTHON_RESTRICT restrict
239   #else
240     #define CYTHON_RESTRICT
241   #endif
242 #endif
243 #ifndef CYTHON_UNUSED
244 # if defined(__GNUC__)
245 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
246 #     define CYTHON_UNUSED __attribute__ ((__unused__))
247 #   else
248 #     define CYTHON_UNUSED
249 #   endif
250 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
251 #   define CYTHON_UNUSED __attribute__ ((__unused__))
252 # else
253 #   define CYTHON_UNUSED
254 # endif
255 #endif
256 #ifndef CYTHON_MAYBE_UNUSED_VAR
257 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)258      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
259 #  else
260 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
261 #  endif
262 #endif
263 #ifndef CYTHON_NCP_UNUSED
264 # if CYTHON_COMPILING_IN_CPYTHON
265 #  define CYTHON_NCP_UNUSED
266 # else
267 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
268 # endif
269 #endif
270 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
271 #ifdef _MSC_VER
272     #ifndef _MSC_STDINT_H_
273         #if _MSC_VER < 1300
274            typedef unsigned char     uint8_t;
275            typedef unsigned int      uint32_t;
276         #else
277            typedef unsigned __int8   uint8_t;
278            typedef unsigned __int32  uint32_t;
279         #endif
280     #endif
281 #else
282    #include <stdint.h>
283 #endif
284 #ifndef CYTHON_FALLTHROUGH
285   #if defined(__cplusplus) && __cplusplus >= 201103L
286     #if __has_cpp_attribute(fallthrough)
287       #define CYTHON_FALLTHROUGH [[fallthrough]]
288     #elif __has_cpp_attribute(clang::fallthrough)
289       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
290     #elif __has_cpp_attribute(gnu::fallthrough)
291       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
292     #endif
293   #endif
294   #ifndef CYTHON_FALLTHROUGH
295     #if __has_attribute(fallthrough)
296       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
297     #else
298       #define CYTHON_FALLTHROUGH
299     #endif
300   #endif
301   #if defined(__clang__ ) && defined(__apple_build_version__)
302     #if __apple_build_version__ < 7000000
303       #undef  CYTHON_FALLTHROUGH
304       #define CYTHON_FALLTHROUGH
305     #endif
306   #endif
307 #endif
308 
309 #ifndef CYTHON_INLINE
310   #if defined(__clang__)
311     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312   #elif defined(__GNUC__)
313     #define CYTHON_INLINE __inline__
314   #elif defined(_MSC_VER)
315     #define CYTHON_INLINE __inline
316   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
317     #define CYTHON_INLINE inline
318   #else
319     #define CYTHON_INLINE
320   #endif
321 #endif
322 
323 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
324   #define Py_OptimizeFlag 0
325 #endif
326 #define __PYX_BUILD_PY_SSIZE_T "n"
327 #define CYTHON_FORMAT_SSIZE_T "z"
328 #if PY_MAJOR_VERSION < 3
329   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
330   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332   #define __Pyx_DefaultClassType PyClass_Type
333 #else
334   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
335 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #else
339   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
340           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
341 #endif
342   #define __Pyx_DefaultClassType PyType_Type
343 #endif
344 #ifndef Py_TPFLAGS_CHECKTYPES
345   #define Py_TPFLAGS_CHECKTYPES 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_INDEX
348   #define Py_TPFLAGS_HAVE_INDEX 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
351   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
352 #endif
353 #ifndef Py_TPFLAGS_HAVE_FINALIZE
354   #define Py_TPFLAGS_HAVE_FINALIZE 0
355 #endif
356 #ifndef METH_STACKLESS
357   #define METH_STACKLESS 0
358 #endif
359 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
360   #ifndef METH_FASTCALL
361      #define METH_FASTCALL 0x80
362   #endif
363   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
364   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
365                                                           Py_ssize_t nargs, PyObject *kwnames);
366 #else
367   #define __Pyx_PyCFunctionFast _PyCFunctionFast
368   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
369 #endif
370 #if CYTHON_FAST_PYCCALL
371 #define __Pyx_PyFastCFunction_Check(func)\
372     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
373 #else
374 #define __Pyx_PyFastCFunction_Check(func) 0
375 #endif
376 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
377   #define PyObject_Malloc(s)   PyMem_Malloc(s)
378   #define PyObject_Free(p)     PyMem_Free(p)
379   #define PyObject_Realloc(p)  PyMem_Realloc(p)
380 #endif
381 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
382   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
383   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
384   #define PyMem_RawFree(p)             PyMem_Free(p)
385 #endif
386 #if CYTHON_COMPILING_IN_PYSTON
387   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
389 #else
390   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
391   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
392 #endif
393 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
394   #define __Pyx_PyThreadState_Current PyThreadState_GET()
395 #elif PY_VERSION_HEX >= 0x03060000
396   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
397 #elif PY_VERSION_HEX >= 0x03000000
398   #define __Pyx_PyThreadState_Current PyThreadState_GET()
399 #else
400   #define __Pyx_PyThreadState_Current _PyThreadState_Current
401 #endif
402 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
403 #include "pythread.h"
404 #define Py_tss_NEEDS_INIT 0
405 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)406 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
407   *key = PyThread_create_key();
408   return 0;
409 }
PyThread_tss_alloc(void)410 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
411   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
412   *key = Py_tss_NEEDS_INIT;
413   return key;
414 }
PyThread_tss_free(Py_tss_t * key)415 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
416   PyObject_Free(key);
417 }
PyThread_tss_is_created(Py_tss_t * key)418 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
419   return *key != Py_tss_NEEDS_INIT;
420 }
PyThread_tss_delete(Py_tss_t * key)421 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
422   PyThread_delete_key(*key);
423   *key = Py_tss_NEEDS_INIT;
424 }
PyThread_tss_set(Py_tss_t * key,void * value)425 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
426   return PyThread_set_key_value(*key, value);
427 }
PyThread_tss_get(Py_tss_t * key)428 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
429   return PyThread_get_key_value(*key);
430 }
431 #endif
432 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
433 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
434 #else
435 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
436 #endif
437 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
440 #else
441   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
442   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
443 #endif
444 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
445 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
446 #else
447 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
448 #endif
449 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
450   #define CYTHON_PEP393_ENABLED 1
451   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
452                                               0 : _PyUnicode_Ready((PyObject *)(op)))
453   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
454   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
455   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
456   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
457   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
458   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
459   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
460   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
461 #else
462   #define CYTHON_PEP393_ENABLED 0
463   #define PyUnicode_1BYTE_KIND  1
464   #define PyUnicode_2BYTE_KIND  2
465   #define PyUnicode_4BYTE_KIND  4
466   #define __Pyx_PyUnicode_READY(op)       (0)
467   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
468   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
469   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
470   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
471   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
472   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
473   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY
477   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
479 #else
480   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
481   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
482       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
485   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
488   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
491   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
492 #endif
493 #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))
494 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
497 #else
498   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
499 #endif
500 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
501   #define PyObject_ASCII(o)            PyObject_Repr(o)
502 #endif
503 #if PY_MAJOR_VERSION >= 3
504   #define PyBaseString_Type            PyUnicode_Type
505   #define PyStringObject               PyUnicodeObject
506   #define PyString_Type                PyUnicode_Type
507   #define PyString_Check               PyUnicode_Check
508   #define PyString_CheckExact          PyUnicode_CheckExact
509   #define PyObject_Unicode             PyObject_Str
510 #endif
511 #if PY_MAJOR_VERSION >= 3
512   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
513   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
514 #else
515   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
516   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
517 #endif
518 #ifndef PySet_CheckExact
519   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
520 #endif
521 #if CYTHON_ASSUME_SAFE_MACROS
522   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
523 #else
524   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
525 #endif
526 #if PY_MAJOR_VERSION >= 3
527   #define PyIntObject                  PyLongObject
528   #define PyInt_Type                   PyLong_Type
529   #define PyInt_Check(op)              PyLong_Check(op)
530   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
531   #define PyInt_FromString             PyLong_FromString
532   #define PyInt_FromUnicode            PyLong_FromUnicode
533   #define PyInt_FromLong               PyLong_FromLong
534   #define PyInt_FromSize_t             PyLong_FromSize_t
535   #define PyInt_FromSsize_t            PyLong_FromSsize_t
536   #define PyInt_AsLong                 PyLong_AsLong
537   #define PyInt_AS_LONG                PyLong_AS_LONG
538   #define PyInt_AsSsize_t              PyLong_AsSsize_t
539   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
540   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
541   #define PyNumber_Int                 PyNumber_Long
542 #endif
543 #if PY_MAJOR_VERSION >= 3
544   #define PyBoolObject                 PyLongObject
545 #endif
546 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
547   #ifndef PyUnicode_InternFromString
548     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
549   #endif
550 #endif
551 #if PY_VERSION_HEX < 0x030200A4
552   typedef long Py_hash_t;
553   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
555 #else
556   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
557   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
558 #endif
559 #if PY_MAJOR_VERSION >= 3
560   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
561 #else
562   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
563 #endif
564 #if CYTHON_USE_ASYNC_SLOTS
565   #if PY_VERSION_HEX >= 0x030500B1
566     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
567     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
568   #else
569     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
570   #endif
571 #else
572   #define __Pyx_PyType_AsAsync(obj) NULL
573 #endif
574 #ifndef __Pyx_PyAsyncMethodsStruct
575     typedef struct {
576         unaryfunc am_await;
577         unaryfunc am_aiter;
578         unaryfunc am_anext;
579     } __Pyx_PyAsyncMethodsStruct;
580 #endif
581 
582 #if defined(WIN32) || defined(MS_WINDOWS)
583   #define _USE_MATH_DEFINES
584 #endif
585 #include <math.h>
586 #ifdef NAN
587 #define __PYX_NAN() ((float) NAN)
588 #else
__PYX_NAN()589 static CYTHON_INLINE float __PYX_NAN() {
590   float value;
591   memset(&value, 0xFF, sizeof(value));
592   return value;
593 }
594 #endif
595 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
596 #define __Pyx_truncl trunc
597 #else
598 #define __Pyx_truncl truncl
599 #endif
600 
601 
602 #define __PYX_ERR(f_index, lineno, Ln_error) \
603 { \
604   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
605 }
606 
607 #ifndef __PYX_EXTERN_C
608   #ifdef __cplusplus
609     #define __PYX_EXTERN_C extern "C"
610   #else
611     #define __PYX_EXTERN_C extern
612   #endif
613 #endif
614 
615 #define __PYX_HAVE__yt__geometry__oct_container
616 #define __PYX_HAVE_API__yt__geometry__oct_container
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ufuncobject.h"
622 #include <float.h>
623 #include <math.h>
624 #include <stdlib.h>
625 #include "tsearch.h"
626 #include "stdlib.h"
627 #include "pythread.h"
628 #include "pystate.h"
629 #ifdef _OPENMP
630 #include <omp.h>
631 #endif /* _OPENMP */
632 
633 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
634 #define CYTHON_WITHOUT_ASSERTIONS
635 #endif
636 
637 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
638                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
639 
640 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
641 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
642 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
643 #define __PYX_DEFAULT_STRING_ENCODING ""
644 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
645 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
646 #define __Pyx_uchar_cast(c) ((unsigned char)c)
647 #define __Pyx_long_cast(x) ((long)x)
648 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
649     (sizeof(type) < sizeof(Py_ssize_t))  ||\
650     (sizeof(type) > sizeof(Py_ssize_t) &&\
651           likely(v < (type)PY_SSIZE_T_MAX ||\
652                  v == (type)PY_SSIZE_T_MAX)  &&\
653           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
654                                 v == (type)PY_SSIZE_T_MIN)))  ||\
655     (sizeof(type) == sizeof(Py_ssize_t) &&\
656           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
657                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)658 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
659     return (size_t) i < (size_t) limit;
660 }
661 #if defined (__cplusplus) && __cplusplus >= 201103L
662     #include <cstdlib>
663     #define __Pyx_sst_abs(value) std::abs(value)
664 #elif SIZEOF_INT >= SIZEOF_SIZE_T
665     #define __Pyx_sst_abs(value) abs(value)
666 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
667     #define __Pyx_sst_abs(value) labs(value)
668 #elif defined (_MSC_VER)
669     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
670 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
671     #define __Pyx_sst_abs(value) llabs(value)
672 #elif defined (__GNUC__)
673     #define __Pyx_sst_abs(value) __builtin_llabs(value)
674 #else
675     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
676 #endif
677 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
678 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
679 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
680 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
681 #define __Pyx_PyBytes_FromString        PyBytes_FromString
682 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
683 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
684 #if PY_MAJOR_VERSION < 3
685     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
686     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
687 #else
688     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
689     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
690 #endif
691 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
692 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
698 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
703 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
704 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
705 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
706 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)707 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
708     const Py_UNICODE *u_end = u;
709     while (*u_end++) ;
710     return (size_t)(u_end - u - 1);
711 }
712 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
713 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
714 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
715 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
716 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
717 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
718 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
719 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
720 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
721 #define __Pyx_PySequence_Tuple(obj)\
722     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
723 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
724 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
725 #if CYTHON_ASSUME_SAFE_MACROS
726 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
727 #else
728 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
729 #endif
730 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
731 #if PY_MAJOR_VERSION >= 3
732 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
733 #else
734 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
735 #endif
736 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
737 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
738 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)739 static int __Pyx_init_sys_getdefaultencoding_params(void) {
740     PyObject* sys;
741     PyObject* default_encoding = NULL;
742     PyObject* ascii_chars_u = NULL;
743     PyObject* ascii_chars_b = NULL;
744     const char* default_encoding_c;
745     sys = PyImport_ImportModule("sys");
746     if (!sys) goto bad;
747     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
748     Py_DECREF(sys);
749     if (!default_encoding) goto bad;
750     default_encoding_c = PyBytes_AsString(default_encoding);
751     if (!default_encoding_c) goto bad;
752     if (strcmp(default_encoding_c, "ascii") == 0) {
753         __Pyx_sys_getdefaultencoding_not_ascii = 0;
754     } else {
755         char ascii_chars[128];
756         int c;
757         for (c = 0; c < 128; c++) {
758             ascii_chars[c] = c;
759         }
760         __Pyx_sys_getdefaultencoding_not_ascii = 1;
761         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
762         if (!ascii_chars_u) goto bad;
763         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
764         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
765             PyErr_Format(
766                 PyExc_ValueError,
767                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
768                 default_encoding_c);
769             goto bad;
770         }
771         Py_DECREF(ascii_chars_u);
772         Py_DECREF(ascii_chars_b);
773     }
774     Py_DECREF(default_encoding);
775     return 0;
776 bad:
777     Py_XDECREF(default_encoding);
778     Py_XDECREF(ascii_chars_u);
779     Py_XDECREF(ascii_chars_b);
780     return -1;
781 }
782 #endif
783 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
784 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
785 #else
786 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
787 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
788 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)789 static int __Pyx_init_sys_getdefaultencoding_params(void) {
790     PyObject* sys;
791     PyObject* default_encoding = NULL;
792     char* default_encoding_c;
793     sys = PyImport_ImportModule("sys");
794     if (!sys) goto bad;
795     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
796     Py_DECREF(sys);
797     if (!default_encoding) goto bad;
798     default_encoding_c = PyBytes_AsString(default_encoding);
799     if (!default_encoding_c) goto bad;
800     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
801     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
802     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
803     Py_DECREF(default_encoding);
804     return 0;
805 bad:
806     Py_XDECREF(default_encoding);
807     return -1;
808 }
809 #endif
810 #endif
811 
812 
813 /* Test for GCC > 2.95 */
814 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
815   #define likely(x)   __builtin_expect(!!(x), 1)
816   #define unlikely(x) __builtin_expect(!!(x), 0)
817 #else /* !__GNUC__ or GCC < 2.95 */
818   #define likely(x)   (x)
819   #define unlikely(x) (x)
820 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)821 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
822 
823 static PyObject *__pyx_m = NULL;
824 static PyObject *__pyx_d;
825 static PyObject *__pyx_b;
826 static PyObject *__pyx_cython_runtime = NULL;
827 static PyObject *__pyx_empty_tuple;
828 static PyObject *__pyx_empty_bytes;
829 static PyObject *__pyx_empty_unicode;
830 static int __pyx_lineno;
831 static int __pyx_clineno = 0;
832 static const char * __pyx_cfilenm= __FILE__;
833 static const char *__pyx_filename;
834 
835 /* Header.proto */
836 #if !defined(CYTHON_CCOMPLEX)
837   #if defined(__cplusplus)
838     #define CYTHON_CCOMPLEX 1
839   #elif defined(_Complex_I)
840     #define CYTHON_CCOMPLEX 1
841   #else
842     #define CYTHON_CCOMPLEX 0
843   #endif
844 #endif
845 #if CYTHON_CCOMPLEX
846   #ifdef __cplusplus
847     #include <complex>
848   #else
849     #include <complex.h>
850   #endif
851 #endif
852 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
853   #undef _Complex_I
854   #define _Complex_I 1.0fj
855 #endif
856 
857 
858 static const char *__pyx_f[] = {
859   "yt/geometry/oct_container.pyx",
860   "stringsource",
861   "yt/geometry/oct_container.pxd",
862   "__init__.pxd",
863   "yt/utilities/lib/fp_utils.pxd",
864   "yt/utilities/lib/geometry_utils.pxd",
865   "type.pxd",
866   "yt/geometry/oct_visitors.pxd",
867   "yt/geometry/selection_routines.pxd",
868 };
869 /* BufferFormatStructs.proto */
870 #define IS_UNSIGNED(type) (((type) -1) > 0)
871 struct __Pyx_StructField_;
872 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
873 typedef struct {
874   const char* name;
875   struct __Pyx_StructField_* fields;
876   size_t size;
877   size_t arraysize[8];
878   int ndim;
879   char typegroup;
880   char is_unsigned;
881   int flags;
882 } __Pyx_TypeInfo;
883 typedef struct __Pyx_StructField_ {
884   __Pyx_TypeInfo* type;
885   const char* name;
886   size_t offset;
887 } __Pyx_StructField;
888 typedef struct {
889   __Pyx_StructField* field;
890   size_t parent_offset;
891 } __Pyx_BufFmt_StackElem;
892 typedef struct {
893   __Pyx_StructField root;
894   __Pyx_BufFmt_StackElem* head;
895   size_t fmt_offset;
896   size_t new_count, enc_count;
897   size_t struct_alignment;
898   int is_complex;
899   char enc_type;
900   char new_packmode;
901   char enc_packmode;
902   char is_valid_array;
903 } __Pyx_BufFmt_Context;
904 
905 /* MemviewSliceStruct.proto */
906 struct __pyx_memoryview_obj;
907 typedef struct {
908   struct __pyx_memoryview_obj *memview;
909   char *data;
910   Py_ssize_t shape[8];
911   Py_ssize_t strides[8];
912   Py_ssize_t suboffsets[8];
913 } __Pyx_memviewslice;
914 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
915 
916 /* Atomics.proto */
917 #include <pythread.h>
918 #ifndef CYTHON_ATOMICS
919     #define CYTHON_ATOMICS 1
920 #endif
921 #define __pyx_atomic_int_type int
922 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
923                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
924                     !defined(__i386__)
925     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
926     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
927     #ifdef __PYX_DEBUG_ATOMICS
928         #warning "Using GNU atomics"
929     #endif
930 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
931     #include <Windows.h>
932     #undef __pyx_atomic_int_type
933     #define __pyx_atomic_int_type LONG
934     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
935     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
936     #ifdef __PYX_DEBUG_ATOMICS
937         #pragma message ("Using MSVC atomics")
938     #endif
939 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
940     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
941     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
942     #ifdef __PYX_DEBUG_ATOMICS
943         #warning "Using Intel atomics"
944     #endif
945 #else
946     #undef CYTHON_ATOMICS
947     #define CYTHON_ATOMICS 0
948     #ifdef __PYX_DEBUG_ATOMICS
949         #warning "Not using atomics"
950     #endif
951 #endif
952 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
953 #if CYTHON_ATOMICS
954     #define __pyx_add_acquisition_count(memview)\
955              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
956     #define __pyx_sub_acquisition_count(memview)\
957             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
958 #else
959     #define __pyx_add_acquisition_count(memview)\
960             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
961     #define __pyx_sub_acquisition_count(memview)\
962             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
963 #endif
964 
965 /* ForceInitThreads.proto */
966 #ifndef __PYX_FORCE_INIT_THREADS
967   #define __PYX_FORCE_INIT_THREADS 0
968 #endif
969 
970 /* NoFastGil.proto */
971 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
972 #define __Pyx_PyGILState_Release PyGILState_Release
973 #define __Pyx_FastGIL_Remember()
974 #define __Pyx_FastGIL_Forget()
975 #define __Pyx_FastGilFuncInit()
976 
977 
978 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
979  * # in Cython to enable them only on the right systems.
980  *
981  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
982  * ctypedef npy_int16      int16_t
983  * ctypedef npy_int32      int32_t
984  */
985 typedef npy_int8 __pyx_t_5numpy_int8_t;
986 
987 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
988  *
989  * ctypedef npy_int8       int8_t
990  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
991  * ctypedef npy_int32      int32_t
992  * ctypedef npy_int64      int64_t
993  */
994 typedef npy_int16 __pyx_t_5numpy_int16_t;
995 
996 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
997  * ctypedef npy_int8       int8_t
998  * ctypedef npy_int16      int16_t
999  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1000  * ctypedef npy_int64      int64_t
1001  * #ctypedef npy_int96      int96_t
1002  */
1003 typedef npy_int32 __pyx_t_5numpy_int32_t;
1004 
1005 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1006  * ctypedef npy_int16      int16_t
1007  * ctypedef npy_int32      int32_t
1008  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1009  * #ctypedef npy_int96      int96_t
1010  * #ctypedef npy_int128     int128_t
1011  */
1012 typedef npy_int64 __pyx_t_5numpy_int64_t;
1013 
1014 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1015  * #ctypedef npy_int128     int128_t
1016  *
1017  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1018  * ctypedef npy_uint16     uint16_t
1019  * ctypedef npy_uint32     uint32_t
1020  */
1021 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1022 
1023 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1024  *
1025  * ctypedef npy_uint8      uint8_t
1026  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1027  * ctypedef npy_uint32     uint32_t
1028  * ctypedef npy_uint64     uint64_t
1029  */
1030 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1031 
1032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1033  * ctypedef npy_uint8      uint8_t
1034  * ctypedef npy_uint16     uint16_t
1035  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1036  * ctypedef npy_uint64     uint64_t
1037  * #ctypedef npy_uint96     uint96_t
1038  */
1039 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1040 
1041 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1042  * ctypedef npy_uint16     uint16_t
1043  * ctypedef npy_uint32     uint32_t
1044  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1045  * #ctypedef npy_uint96     uint96_t
1046  * #ctypedef npy_uint128    uint128_t
1047  */
1048 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1049 
1050 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1051  * #ctypedef npy_uint128    uint128_t
1052  *
1053  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1054  * ctypedef npy_float64    float64_t
1055  * #ctypedef npy_float80    float80_t
1056  */
1057 typedef npy_float32 __pyx_t_5numpy_float32_t;
1058 
1059 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1060  *
1061  * ctypedef npy_float32    float32_t
1062  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1063  * #ctypedef npy_float80    float80_t
1064  * #ctypedef npy_float128   float128_t
1065  */
1066 typedef npy_float64 __pyx_t_5numpy_float64_t;
1067 
1068 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1069  * # The int types are mapped a bit surprising --
1070  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1071  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1072  * ctypedef npy_longlong   long_t
1073  * ctypedef npy_longlong   longlong_t
1074  */
1075 typedef npy_long __pyx_t_5numpy_int_t;
1076 
1077 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1078  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1079  * ctypedef npy_long       int_t
1080  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1081  * ctypedef npy_longlong   longlong_t
1082  *
1083  */
1084 typedef npy_longlong __pyx_t_5numpy_long_t;
1085 
1086 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1087  * ctypedef npy_long       int_t
1088  * ctypedef npy_longlong   long_t
1089  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1090  *
1091  * ctypedef npy_ulong      uint_t
1092  */
1093 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1094 
1095 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1096  * ctypedef npy_longlong   longlong_t
1097  *
1098  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1099  * ctypedef npy_ulonglong  ulong_t
1100  * ctypedef npy_ulonglong  ulonglong_t
1101  */
1102 typedef npy_ulong __pyx_t_5numpy_uint_t;
1103 
1104 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1105  *
1106  * ctypedef npy_ulong      uint_t
1107  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1108  * ctypedef npy_ulonglong  ulonglong_t
1109  *
1110  */
1111 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1112 
1113 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1114  * ctypedef npy_ulong      uint_t
1115  * ctypedef npy_ulonglong  ulong_t
1116  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1117  *
1118  * ctypedef npy_intp       intp_t
1119  */
1120 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1121 
1122 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1123  * ctypedef npy_ulonglong  ulonglong_t
1124  *
1125  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1126  * ctypedef npy_uintp      uintp_t
1127  *
1128  */
1129 typedef npy_intp __pyx_t_5numpy_intp_t;
1130 
1131 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1132  *
1133  * ctypedef npy_intp       intp_t
1134  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1135  *
1136  * ctypedef npy_double     float_t
1137  */
1138 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1139 
1140 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1141  * ctypedef npy_uintp      uintp_t
1142  *
1143  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1144  * ctypedef npy_double     double_t
1145  * ctypedef npy_longdouble longdouble_t
1146  */
1147 typedef npy_double __pyx_t_5numpy_float_t;
1148 
1149 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1150  *
1151  * ctypedef npy_double     float_t
1152  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1153  * ctypedef npy_longdouble longdouble_t
1154  *
1155  */
1156 typedef npy_double __pyx_t_5numpy_double_t;
1157 
1158 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1159  * ctypedef npy_double     float_t
1160  * ctypedef npy_double     double_t
1161  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1162  *
1163  * ctypedef npy_cfloat      cfloat_t
1164  */
1165 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1166 /* Declarations.proto */
1167 #if CYTHON_CCOMPLEX
1168   #ifdef __cplusplus
1169     typedef ::std::complex< float > __pyx_t_float_complex;
1170   #else
1171     typedef float _Complex __pyx_t_float_complex;
1172   #endif
1173 #else
1174     typedef struct { float real, imag; } __pyx_t_float_complex;
1175 #endif
1176 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1177 
1178 /* Declarations.proto */
1179 #if CYTHON_CCOMPLEX
1180   #ifdef __cplusplus
1181     typedef ::std::complex< double > __pyx_t_double_complex;
1182   #else
1183     typedef double _Complex __pyx_t_double_complex;
1184   #endif
1185 #else
1186     typedef struct { double real, imag; } __pyx_t_double_complex;
1187 #endif
1188 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1189 
1190 
1191 /*--- Type declarations ---*/
1192 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor;
1193 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts;
1194 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells;
1195 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts;
1196 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts;
1197 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts;
1198 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
1199 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
1200 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts;
1201 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts;
1202 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts;
1203 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts;
1204 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64;
1205 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64;
1206 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
1207 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts;
1208 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd;
1209 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO;
1210 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR;
1211 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain;
1212 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree;
1213 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree;
1214 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts;
1215 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex;
1216 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
1217 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
1218 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
1219 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject;
1220 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector;
1221 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
1222 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector;
1223 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool;
1224 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool;
1225 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer;
1226 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer;
1227 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
1228 struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer;
1229 struct __pyx_array_obj;
1230 struct __pyx_MemviewEnum_obj;
1231 struct __pyx_memoryview_obj;
1232 struct __pyx_memoryviewslice_obj;
1233 
1234 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1235  * ctypedef npy_longdouble longdouble_t
1236  *
1237  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1238  * ctypedef npy_cdouble     cdouble_t
1239  * ctypedef npy_clongdouble clongdouble_t
1240  */
1241 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1242 
1243 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1244  *
1245  * ctypedef npy_cfloat      cfloat_t
1246  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1247  * ctypedef npy_clongdouble clongdouble_t
1248  *
1249  */
1250 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1251 
1252 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1253  * ctypedef npy_cfloat      cfloat_t
1254  * ctypedef npy_cdouble     cdouble_t
1255  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1256  *
1257  * ctypedef npy_cdouble     complex_t
1258  */
1259 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1260 
1261 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1262  * ctypedef npy_clongdouble clongdouble_t
1263  *
1264  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1265  *
1266  * cdef inline object PyArray_MultiIterNew1(a):
1267  */
1268 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1269 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct;
1270 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo;
1271 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded;
1272 
1273 /* "oct_visitors.pxd":13
1274  *
1275  *
1276  * cdef struct Oct             # <<<<<<<<<<<<<<
1277  * cdef struct Oct:
1278  *     np.int64_t file_ind     # index with respect to the order in which it was
1279  */
1280 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct {
1281   __pyx_t_5numpy_int64_t file_ind;
1282   __pyx_t_5numpy_int64_t domain_ind;
1283   __pyx_t_5numpy_int64_t domain;
1284   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **children;
1285 };
1286 
1287 /* "oct_visitors.pxd":21
1288  *     Oct **children          # Up to 8 long
1289  *
1290  * cdef struct OctInfo:             # <<<<<<<<<<<<<<
1291  *     np.float64_t left_edge[3]
1292  *     np.float64_t dds[3]
1293  */
1294 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo {
1295   __pyx_t_5numpy_float64_t left_edge[3];
1296   __pyx_t_5numpy_float64_t dds[3];
1297   __pyx_t_5numpy_int64_t ipos[3];
1298   __pyx_t_5numpy_int32_t level;
1299 };
1300 
1301 /* "oct_visitors.pxd":27
1302  *     np.int32_t level
1303  *
1304  * cdef struct OctPadded:             # <<<<<<<<<<<<<<
1305  *     np.int64_t file_ind
1306  *     np.int64_t domain_ind
1307  */
1308 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded {
1309   __pyx_t_5numpy_int64_t file_ind;
1310   __pyx_t_5numpy_int64_t domain_ind;
1311   __pyx_t_5numpy_int64_t domain;
1312   __pyx_t_5numpy_int64_t padding;
1313 };
1314 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
1315 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
1316 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;
1317 
1318 /* "grid_visitors.pxd":13
1319  *
1320  *
1321  * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
1322  *     np.int32_t num_children
1323  *     np.int32_t level
1324  */
1325 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
1326   __pyx_t_5numpy_int32_t num_children;
1327   __pyx_t_5numpy_int32_t level;
1328   __pyx_t_5numpy_int64_t index;
1329   __pyx_t_5numpy_float64_t left_edge[3];
1330   __pyx_t_5numpy_float64_t right_edge[3];
1331   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
1332   __pyx_t_5numpy_int64_t start_index[3];
1333   __pyx_t_5numpy_int32_t dims[3];
1334   __pyx_t_5numpy_float64_t dds[3];
1335 };
1336 
1337 /* "grid_visitors.pxd":24
1338  *     np.float64_t dds[3]
1339  *
1340  * cdef struct GridTreeNodePadded:             # <<<<<<<<<<<<<<
1341  *     np.int32_t num_children
1342  *     np.int32_t level
1343  */
1344 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded {
1345   __pyx_t_5numpy_int32_t num_children;
1346   __pyx_t_5numpy_int32_t level;
1347   __pyx_t_5numpy_int64_t index;
1348   __pyx_t_5numpy_float64_t left_edge_x;
1349   __pyx_t_5numpy_float64_t left_edge_y;
1350   __pyx_t_5numpy_float64_t left_edge_z;
1351   __pyx_t_5numpy_float64_t right_edge_x;
1352   __pyx_t_5numpy_float64_t right_edge_y;
1353   __pyx_t_5numpy_float64_t right_edge_z;
1354   __pyx_t_5numpy_int_t children_pointers;
1355   __pyx_t_5numpy_int64_t start_index_x;
1356   __pyx_t_5numpy_int64_t start_index_y;
1357   __pyx_t_5numpy_int64_t start_index_z;
1358   __pyx_t_5numpy_int32_t dims_x;
1359   __pyx_t_5numpy_int32_t dims_y;
1360   __pyx_t_5numpy_int32_t dims_z;
1361   __pyx_t_5numpy_float64_t dds_x;
1362   __pyx_t_5numpy_float64_t dds_y;
1363   __pyx_t_5numpy_float64_t dds_z;
1364 };
1365 
1366 /* "grid_visitors.pxd":45
1367  *     np.float64_t dds_z
1368  *
1369  * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
1370  *     GridTreeNode *grid
1371  *     np.uint64_t index
1372  */
1373 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
1374   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
1375   __pyx_t_5numpy_uint64_t index;
1376   __pyx_t_5numpy_uint64_t global_index;
1377   __pyx_t_5numpy_int64_t pos[3];
1378   int n_tuples;
1379   int **child_tuples;
1380   void *array;
1381   int ref_factor;
1382 };
1383 
1384 /* "grid_visitors.pxd":61
1385  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
1386  *
1387  * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
1388  *                                          np.uint8_t selected) nogil
1389  * # This is similar in spirit to the way oct visitor functions work.  However,
1390  */
1391 typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
1392 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs;
1393 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid;
1394 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge;
1395 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells;
1396 
1397 /* "selection_routines.pxd":34
1398  *     cdef np.int64_t _hash
1399  *
1400  *     cdef void recursively_visit_octs(self, Oct *root,             # <<<<<<<<<<<<<<
1401  *                         np.float64_t pos[3], np.float64_t dds[3],
1402  *                         int level,
1403  */
1404 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs {
1405   int __pyx_n;
1406   int visit_covered;
1407 };
1408 
1409 /* "selection_routines.pxd":42
1410  *                               np.float64_t spos[3], np.float64_t sdds[3],
1411  *                               OctVisitor visitor, int i, int j, int k)
1412  *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1413  *                                np.float64_t right_edge[3],
1414  *                                np.int32_t level, Oct *o = ?) nogil
1415  */
1416 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid {
1417   int __pyx_n;
1418   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1419 };
1420 
1421 /* "selection_routines.pxd":45
1422  *                                np.float64_t right_edge[3],
1423  *                                np.int32_t level, Oct *o = ?) nogil
1424  *     cdef int select_grid_edge(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1425  *                                     np.float64_t right_edge[3],
1426  *                                     np.int32_t level, Oct *o = ?) nogil
1427  */
1428 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge {
1429   int __pyx_n;
1430   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1431 };
1432 
1433 /* "selection_routines.pxd":62
1434  *                                 np.ndarray[np.uint8_t, ndim=3] mask,
1435  *                                 int level)
1436  *     cdef void visit_grid_cells(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
1437  *                     grid_visitor_function *func, np.uint8_t *cached_mask = ?)
1438  *
1439  */
1440 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells {
1441   int __pyx_n;
1442   __pyx_t_5numpy_uint8_t *cached_mask;
1443 };
1444 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer;
1445 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs;
1446 
1447 /* "yt/utilities/lib/allocation_container.pxd":13
1448  *
1449  *
1450  * cdef struct AllocationContainer:             # <<<<<<<<<<<<<<
1451  *     np.uint64_t n
1452  *     np.uint64_t n_assigned
1453  */
1454 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer {
1455   __pyx_t_5numpy_uint64_t n;
1456   __pyx_t_5numpy_uint64_t n_assigned;
1457   __pyx_t_5numpy_uint64_t offset;
1458   __pyx_t_5numpy_int64_t con_id;
1459   void *my_objs;
1460 };
1461 
1462 /* "yt/utilities/lib/allocation_container.pxd":24
1463  *     cdef np.uint64_t n_con
1464  *     cdef AllocationContainer* containers
1465  *     cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except *             # <<<<<<<<<<<<<<
1466  *     cdef void setup_objs(self, void *obj, np.uint64_t count,
1467  *                          np.uint64_t offset, np.int64_t con_id)
1468  */
1469 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs {
1470   int __pyx_n;
1471   __pyx_t_5numpy_int64_t con_id;
1472 };
1473 struct __pyx_t_2yt_8geometry_13oct_container_OctKey;
1474 struct __pyx_t_2yt_8geometry_13oct_container_OctList;
1475 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer;
1476 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get;
1477 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
1478 struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs;
1479 
1480 /* "yt/geometry/oct_container.pxd":25
1481  * cdef int ORDER_MAX
1482  *
1483  * cdef struct OctKey:             # <<<<<<<<<<<<<<
1484  *     np.int64_t key
1485  *     Oct *node
1486  */
1487 struct __pyx_t_2yt_8geometry_13oct_container_OctKey {
1488   __pyx_t_5numpy_int64_t key;
1489   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node;
1490   __pyx_t_5numpy_int64_t *indices;
1491   __pyx_t_5numpy_int64_t pcount;
1492 };
1493 
1494 /* "yt/geometry/oct_container.pxd":32
1495  *     np.int64_t pcount
1496  *
1497  * cdef struct OctList             # <<<<<<<<<<<<<<
1498  *
1499  * cdef struct OctList:
1500  */
1501 struct __pyx_t_2yt_8geometry_13oct_container_OctList {
1502   struct __pyx_t_2yt_8geometry_13oct_container_OctList *next;
1503   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1504 };
1505 
1506 /* "yt/geometry/oct_container.pxd":40
1507  * # NOTE: This object *has* to be the same size as the AllocationContainer
1508  * # object.  There's an assert in the __cinit__ function.
1509  * cdef struct OctAllocationContainer:             # <<<<<<<<<<<<<<
1510  *     np.uint64_t n
1511  *     np.uint64_t n_assigned
1512  */
1513 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer {
1514   __pyx_t_5numpy_uint64_t n;
1515   __pyx_t_5numpy_uint64_t n_assigned;
1516   __pyx_t_5numpy_uint64_t offset;
1517   __pyx_t_5numpy_int64_t con_id;
1518   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs;
1519 };
1520 
1521 /* "yt/geometry/oct_container.pxd":66
1522  *     cdef public np.int64_t nocts
1523  *     cdef public int num_domains
1524  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,             # <<<<<<<<<<<<<<
1525  *                   int max_level = ?) nogil
1526  *     cdef int get_root(self, int ind[3], Oct **o) nogil
1527  */
1528 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get {
1529   int __pyx_n;
1530   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *oinfo;
1531   int max_level;
1532 };
1533 
1534 /* "yt/geometry/oct_container.pxd":74
1535  *     # AllocationContainer.offset if such a thing exists.
1536  *     cdef np.int64_t get_domain_offset(self, int domain_id)
1537  *     cdef void visit_all_octs(self,             # <<<<<<<<<<<<<<
1538  *                         selection_routines.SelectorObject selector,
1539  *                         OctVisitor visitor,
1540  */
1541 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs {
1542   int __pyx_n;
1543   int vc;
1544   __pyx_t_5numpy_int64_t *indices;
1545 };
1546 
1547 /* "yt/geometry/oct_container.pyx":1015
1548  *
1549  *     @cython.cdivision(True)
1550  *     cdef void visit_all_octs(self, SelectorObject selector,             # <<<<<<<<<<<<<<
1551  *                         OctVisitor visitor,
1552  *                         int vc = -1,
1553  */
1554 struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs {
1555   int __pyx_n;
1556   int vc;
1557   __pyx_t_5numpy_int64_t *indices;
1558 };
1559 
1560 /* "oct_visitors.pxd":33
1561  *     np.int64_t padding
1562  *
1563  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
1564  *     cdef np.uint64_t index
1565  *     cdef np.uint64_t last
1566  */
1567 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor {
1568   PyObject_HEAD
1569   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtab;
1570   __pyx_t_5numpy_uint64_t index;
1571   __pyx_t_5numpy_uint64_t last;
1572   __pyx_t_5numpy_int64_t global_index;
1573   __pyx_t_5numpy_int64_t pos[3];
1574   __pyx_t_5numpy_uint8_t ind[3];
1575   int dims;
1576   __pyx_t_5numpy_int32_t domain;
1577   __pyx_t_5numpy_int8_t level;
1578   __pyx_t_5numpy_int8_t oref;
1579   __pyx_t_5numpy_int32_t nz;
1580 };
1581 
1582 
1583 /* "oct_visitors.pxd":59
1584  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
1585  *
1586  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
1587  *     pass
1588  *
1589  */
1590 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts {
1591   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1592 };
1593 
1594 
1595 /* "oct_visitors.pxd":62
1596  *     pass
1597  *
1598  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
1599  *     pass
1600  *
1601  */
1602 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells {
1603   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1604 };
1605 
1606 
1607 /* "oct_visitors.pxd":65
1608  *     pass
1609  *
1610  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
1611  *     # Unused
1612  *     cdef np.uint8_t[:,:,:,:] mark
1613  */
1614 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts {
1615   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1616   __Pyx_memviewslice mark;
1617 };
1618 
1619 
1620 /* "oct_visitors.pxd":69
1621  *     cdef np.uint8_t[:,:,:,:] mark
1622  *
1623  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
1624  *     cdef np.uint8_t[:,:,:,:] mask
1625  *
1626  */
1627 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts {
1628   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1629   __Pyx_memviewslice mask;
1630 };
1631 
1632 
1633 /* "oct_visitors.pxd":72
1634  *     cdef np.uint8_t[:,:,:,:] mask
1635  *
1636  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1637  *     cdef np.int64_t[:] oct_index
1638  *
1639  */
1640 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts {
1641   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1642   __Pyx_memviewslice oct_index;
1643 };
1644 
1645 
1646 /* "oct_visitors.pxd":75
1647  *     cdef np.int64_t[:] oct_index
1648  *
1649  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1650  *     cdef np.int64_t[:] oct_index
1651  *     cdef np.uint8_t[:] oct_mask
1652  */
1653 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
1654   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1655   __Pyx_memviewslice oct_index;
1656   __Pyx_memviewslice oct_mask;
1657 };
1658 
1659 
1660 /* "oct_visitors.pxd":79
1661  *     cdef np.uint8_t[:] oct_mask
1662  *
1663  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
1664  *     cdef np.int64_t[:] oct_index
1665  *     cdef np.uint8_t[:] oct_mask
1666  */
1667 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
1668   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1669   __Pyx_memviewslice oct_index;
1670   __Pyx_memviewslice oct_mask;
1671   __Pyx_memviewslice map_domain_ind;
1672   __pyx_t_5numpy_uint64_t map_index;
1673 };
1674 
1675 
1676 /* "oct_visitors.pxd":85
1677  *     cdef np.uint64_t map_index
1678  *
1679  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1680  *     cdef np.int64_t[:,:] icoords
1681  *
1682  */
1683 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts {
1684   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1685   __Pyx_memviewslice icoords;
1686 };
1687 
1688 
1689 /* "oct_visitors.pxd":88
1690  *     cdef np.int64_t[:,:] icoords
1691  *
1692  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
1693  *     cdef np.int64_t[:] ires
1694  *
1695  */
1696 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts {
1697   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1698   __Pyx_memviewslice ires;
1699 };
1700 
1701 
1702 /* "oct_visitors.pxd":91
1703  *     cdef np.int64_t[:] ires
1704  *
1705  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1706  *     cdef np.float64_t[:,:] fcoords
1707  *
1708  */
1709 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts {
1710   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1711   __Pyx_memviewslice fcoords;
1712 };
1713 
1714 
1715 /* "oct_visitors.pxd":94
1716  *     cdef np.float64_t[:,:] fcoords
1717  *
1718  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
1719  *     cdef np.float64_t[:,:] fwidth
1720  *
1721  */
1722 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts {
1723   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1724   __Pyx_memviewslice fwidth;
1725 };
1726 
1727 
1728 /* "oct_visitors.pxd":97
1729  *     cdef np.float64_t[:,:] fwidth
1730  *
1731  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
1732  *     cdef np.int64_t[:,:,:,:,:,:] source
1733  *     cdef np.int64_t[:,:] dest
1734  */
1735 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 {
1736   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1737   __Pyx_memviewslice source;
1738   __Pyx_memviewslice dest;
1739 };
1740 
1741 
1742 /* "oct_visitors.pxd":101
1743  *     cdef np.int64_t[:,:] dest
1744  *
1745  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
1746  *     cdef np.float64_t[:,:,:,:,:] source
1747  *     cdef np.float64_t[:,:] dest
1748  */
1749 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 {
1750   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1751   __Pyx_memviewslice source;
1752   __Pyx_memviewslice dest;
1753 };
1754 
1755 
1756 /* "oct_visitors.pxd":105
1757  *     cdef np.float64_t[:,:] dest
1758  *
1759  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
1760  *     cdef np.int64_t root
1761  *     cdef np.uint8_t[:] source
1762  */
1763 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
1764   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1765   __pyx_t_5numpy_int64_t root;
1766   __Pyx_memviewslice source;
1767   __Pyx_memviewslice dest;
1768 };
1769 
1770 
1771 /* "oct_visitors.pxd":110
1772  *     cdef np.uint8_t[:] dest
1773  *
1774  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
1775  *     cdef np.uint8_t[:] domain_mask
1776  *
1777  */
1778 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts {
1779   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1780   __Pyx_memviewslice domain_mask;
1781 };
1782 
1783 
1784 /* "oct_visitors.pxd":113
1785  *     cdef np.uint8_t[:] domain_mask
1786  *
1787  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
1788  *     pass
1789  *
1790  */
1791 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd {
1792   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1793 };
1794 
1795 
1796 /* "oct_visitors.pxd":116
1797  *     pass
1798  *
1799  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
1800  *     cdef np.uint8_t[:] levels
1801  *     cdef np.int64_t[:] file_inds
1802  */
1803 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO {
1804   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1805   __Pyx_memviewslice levels;
1806   __Pyx_memviewslice file_inds;
1807   __Pyx_memviewslice cell_inds;
1808 };
1809 
1810 
1811 /* "oct_visitors.pxd":121
1812  *     cdef np.uint8_t[:] cell_inds
1813  *
1814  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
1815  *     cdef np.uint8_t[:] levels
1816  *     cdef np.int64_t[:] file_inds
1817  */
1818 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR {
1819   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1820   __Pyx_memviewslice levels;
1821   __Pyx_memviewslice file_inds;
1822   __Pyx_memviewslice cell_inds;
1823 };
1824 
1825 
1826 /* "oct_visitors.pxd":126
1827  *     cdef np.uint8_t[:] cell_inds
1828  *
1829  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
1830  *     cdef np.int64_t[:] domain_counts
1831  *
1832  */
1833 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain {
1834   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1835   __Pyx_memviewslice domain_counts;
1836 };
1837 
1838 
1839 /* "oct_visitors.pxd":129
1840  *     cdef np.int64_t[:] domain_counts
1841  *
1842  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
1843  *     cdef np.uint8_t[:] ref_mask
1844  *
1845  */
1846 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree {
1847   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1848   __Pyx_memviewslice ref_mask;
1849 };
1850 
1851 
1852 /* "oct_visitors.pxd":132
1853  *     cdef np.uint8_t[:] ref_mask
1854  *
1855  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
1856  *     cdef np.uint8_t[:] ref_mask
1857  *     cdef Oct* octs
1858  */
1859 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree {
1860   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1861   __Pyx_memviewslice ref_mask;
1862   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs;
1863   __pyx_t_5numpy_uint64_t *nocts;
1864   __pyx_t_5numpy_uint64_t *nfinest;
1865 };
1866 
1867 
1868 /* "oct_visitors.pxd":138
1869  *     cdef np.uint64_t *nfinest
1870  *
1871  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1872  *     cdef np.uint8_t[:] level_arr
1873  *     cdef np.uint64_t[:] morton_ind
1874  */
1875 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts {
1876   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1877   __Pyx_memviewslice level_arr;
1878   __Pyx_memviewslice morton_ind;
1879 };
1880 
1881 
1882 /* "oct_visitors.pxd":149
1883  *
1884  *
1885  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
1886  *     cdef np.int64_t[:,:,:,:] cell_inds
1887  *
1888  */
1889 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex {
1890   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1891   __Pyx_memviewslice cell_inds;
1892 };
1893 
1894 
1895 /* "oct_visitors.pxd":153
1896  *
1897  * # cimport oct_container
1898  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
1899  *     cdef int idim      # 0,1,2 for x,y,z
1900  *     cdef int direction # +1 for +x, -1 for -x
1901  */
1902 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
1903   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1904   int idim;
1905   int direction;
1906   __pyx_t_5numpy_uint8_t neigh_ind[3];
1907   int other_oct;
1908   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *neighbour;
1909   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *octree;
1910   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo oi;
1911   int n_ghost_zones;
1912 };
1913 
1914 
1915 /* "oct_visitors.pxd":169
1916  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
1917  *
1918  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1919  *     cdef np.uint8_t[::1] cell_inds
1920  *     cdef np.int64_t[::1] domain_inds
1921  */
1922 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
1923   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1924   __Pyx_memviewslice cell_inds;
1925   __Pyx_memviewslice domain_inds;
1926 };
1927 
1928 
1929 /* "oct_visitors.pxd":173
1930  *     cdef np.int64_t[::1] domain_inds
1931  *
1932  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1933  *     cdef np.uint8_t[::1] levels
1934  *     cdef np.int64_t[::1] file_inds
1935  */
1936 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
1937   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1938   __Pyx_memviewslice levels;
1939   __Pyx_memviewslice file_inds;
1940   __Pyx_memviewslice cell_inds;
1941   __Pyx_memviewslice domains;
1942 };
1943 
1944 
1945 /* "selection_routines.pxd":24
1946  *
1947  *
1948  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
1949  *     cdef public np.int32_t min_level
1950  *     cdef public np.int32_t max_level
1951  */
1952 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject {
1953   PyObject_HEAD
1954   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtab;
1955   __pyx_t_5numpy_int32_t min_level;
1956   __pyx_t_5numpy_int32_t max_level;
1957   int overlap_cells;
1958   __pyx_t_5numpy_float64_t domain_width[3];
1959   __pyx_t_5numpy_float64_t domain_center[3];
1960   int periodicity[3];
1961   int _hash_initialized;
1962   __pyx_t_5numpy_int64_t _hash;
1963 };
1964 
1965 
1966 /* "selection_routines.pxd":70
1967  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
1968  *
1969  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
1970  *     pass
1971  *
1972  */
1973 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector {
1974   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
1975 };
1976 
1977 
1978 /* "selection_routines.pxd":73
1979  *     pass
1980  *
1981  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
1982  *     cdef public SelectorObject base_selector
1983  *     cdef public np.int64_t domain_id
1984  */
1985 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
1986   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
1987   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
1988   __pyx_t_5numpy_int64_t domain_id;
1989 };
1990 
1991 
1992 /* "selection_routines.pxd":77
1993  *     cdef public np.int64_t domain_id
1994  *
1995  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
1996  *     cdef public SelectorObject sel1
1997  *     cdef public SelectorObject sel2
1998  */
1999 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector {
2000   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2001   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1;
2002   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2;
2003 };
2004 
2005 
2006 /* "yt/utilities/lib/allocation_container.pxd":20
2007  *     void *my_objs
2008  *
2009  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2010  *     cdef public np.uint64_t itemsize
2011  *     cdef np.uint64_t n_con
2012  */
2013 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2014   PyObject_HEAD
2015   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab;
2016   __pyx_t_5numpy_uint64_t itemsize;
2017   __pyx_t_5numpy_uint64_t n_con;
2018   struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers;
2019 };
2020 
2021 
2022 /* "yt/geometry/oct_container.pxd":47
2023  *     Oct *my_objs
2024  *
2025  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2026  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2027  *         return <OctAllocationContainer*> (&self.containers[i])
2028  */
2029 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool {
2030   struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2031 };
2032 
2033 
2034 /* "yt/geometry/oct_container.pxd":55
2035  * cdef void OctList_delete(OctList *list)
2036  *
2037  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2038  *     cdef public OctObjectPool domains
2039  *     cdef Oct ****root_mesh
2040  */
2041 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer {
2042   PyObject_HEAD
2043   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab;
2044   struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains;
2045   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh;
2046   int partial_coverage;
2047   int level_offset;
2048   int nn[3];
2049   __pyx_t_5numpy_uint8_t oref;
2050   __pyx_t_5numpy_float64_t DLE[3];
2051   __pyx_t_5numpy_float64_t DRE[3];
2052   __pyx_t_5numpy_int64_t nocts;
2053   int num_domains;
2054   PyObject *fill_style;
2055 };
2056 
2057 
2058 /* "yt/geometry/oct_container.pxd":85
2059  *     cdef public object fill_style
2060  *
2061  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2062  *     cdef OctKey *root_nodes
2063  *     cdef void *tree_root
2064  */
2065 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer {
2066   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2067   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *root_nodes;
2068   void *tree_root;
2069   int num_root;
2070   int max_root;
2071 };
2072 
2073 
2074 /* "yt/geometry/oct_container.pxd":93
2075  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2076  *
2077  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2078  *     pass
2079  *
2080  */
2081 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2082   struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2083 };
2084 
2085 
2086 /* "yt/geometry/oct_container.pyx":1082
2087  *         if self.root_nodes != NULL: free(self.root_nodes)
2088  *
2089  * cdef class ARTOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2090  *     def __init__(self, oct_domain_dimensions, domain_left_edge,
2091  *                  domain_right_edge, partial_coverage = 0,
2092  */
2093 struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer {
2094   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2095 };
2096 
2097 
2098 /* "View.MemoryView":105
2099  *
2100  * @cname("__pyx_array")
2101  * cdef class array:             # <<<<<<<<<<<<<<
2102  *
2103  *     cdef:
2104  */
2105 struct __pyx_array_obj {
2106   PyObject_HEAD
2107   struct __pyx_vtabstruct_array *__pyx_vtab;
2108   char *data;
2109   Py_ssize_t len;
2110   char *format;
2111   int ndim;
2112   Py_ssize_t *_shape;
2113   Py_ssize_t *_strides;
2114   Py_ssize_t itemsize;
2115   PyObject *mode;
2116   PyObject *_format;
2117   void (*callback_free_data)(void *);
2118   int free_data;
2119   int dtype_is_object;
2120 };
2121 
2122 
2123 /* "View.MemoryView":279
2124  *
2125  * @cname('__pyx_MemviewEnum')
2126  * cdef class Enum(object):             # <<<<<<<<<<<<<<
2127  *     cdef object name
2128  *     def __init__(self, name):
2129  */
2130 struct __pyx_MemviewEnum_obj {
2131   PyObject_HEAD
2132   PyObject *name;
2133 };
2134 
2135 
2136 /* "View.MemoryView":330
2137  *
2138  * @cname('__pyx_memoryview')
2139  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2140  *
2141  *     cdef object obj
2142  */
2143 struct __pyx_memoryview_obj {
2144   PyObject_HEAD
2145   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2146   PyObject *obj;
2147   PyObject *_size;
2148   PyObject *_array_interface;
2149   PyThread_type_lock lock;
2150   __pyx_atomic_int acquisition_count[2];
2151   __pyx_atomic_int *acquisition_count_aligned_p;
2152   Py_buffer view;
2153   int flags;
2154   int dtype_is_object;
2155   __Pyx_TypeInfo *typeinfo;
2156 };
2157 
2158 
2159 /* "View.MemoryView":961
2160  *
2161  * @cname('__pyx_memoryviewslice')
2162  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2163  *     "Internal class for passing memoryview slices to Python"
2164  *
2165  */
2166 struct __pyx_memoryviewslice_obj {
2167   struct __pyx_memoryview_obj __pyx_base;
2168   __Pyx_memviewslice from_slice;
2169   PyObject *from_object;
2170   PyObject *(*to_object_func)(char *);
2171   int (*to_dtype_func)(char *, PyObject *);
2172 };
2173 
2174 
2175 
2176 /* "oct_visitors.pxd":33
2177  *     np.int64_t padding
2178  *
2179  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
2180  *     cdef np.uint64_t index
2181  *     cdef np.uint64_t last
2182  */
2183 
2184 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor {
2185   void (*visit)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t);
2186   int (*oind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2187   int (*rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2188 };
2189 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor;
2190 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2191 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2192 
2193 
2194 /* "oct_visitors.pxd":59
2195  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
2196  *
2197  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
2198  *     pass
2199  *
2200  */
2201 
2202 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts {
2203   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2204 };
2205 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts;
2206 
2207 
2208 /* "oct_visitors.pxd":62
2209  *     pass
2210  *
2211  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
2212  *     pass
2213  *
2214  */
2215 
2216 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells {
2217   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2218 };
2219 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells;
2220 
2221 
2222 /* "oct_visitors.pxd":65
2223  *     pass
2224  *
2225  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
2226  *     # Unused
2227  *     cdef np.uint8_t[:,:,:,:] mark
2228  */
2229 
2230 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts {
2231   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2232 };
2233 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts;
2234 
2235 
2236 /* "oct_visitors.pxd":69
2237  *     cdef np.uint8_t[:,:,:,:] mark
2238  *
2239  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
2240  *     cdef np.uint8_t[:,:,:,:] mask
2241  *
2242  */
2243 
2244 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts {
2245   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2246 };
2247 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts;
2248 
2249 
2250 /* "oct_visitors.pxd":72
2251  *     cdef np.uint8_t[:,:,:,:] mask
2252  *
2253  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2254  *     cdef np.int64_t[:] oct_index
2255  *
2256  */
2257 
2258 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts {
2259   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2260 };
2261 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts;
2262 
2263 
2264 /* "oct_visitors.pxd":75
2265  *     cdef np.int64_t[:] oct_index
2266  *
2267  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2268  *     cdef np.int64_t[:] oct_index
2269  *     cdef np.uint8_t[:] oct_mask
2270  */
2271 
2272 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
2273   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2274 };
2275 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
2276 
2277 
2278 /* "oct_visitors.pxd":79
2279  *     cdef np.uint8_t[:] oct_mask
2280  *
2281  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
2282  *     cdef np.int64_t[:] oct_index
2283  *     cdef np.uint8_t[:] oct_mask
2284  */
2285 
2286 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
2287   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2288 };
2289 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
2290 
2291 
2292 /* "oct_visitors.pxd":85
2293  *     cdef np.uint64_t map_index
2294  *
2295  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2296  *     cdef np.int64_t[:,:] icoords
2297  *
2298  */
2299 
2300 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts {
2301   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2302 };
2303 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts;
2304 
2305 
2306 /* "oct_visitors.pxd":88
2307  *     cdef np.int64_t[:,:] icoords
2308  *
2309  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
2310  *     cdef np.int64_t[:] ires
2311  *
2312  */
2313 
2314 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts {
2315   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2316 };
2317 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts;
2318 
2319 
2320 /* "oct_visitors.pxd":91
2321  *     cdef np.int64_t[:] ires
2322  *
2323  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2324  *     cdef np.float64_t[:,:] fcoords
2325  *
2326  */
2327 
2328 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts {
2329   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2330 };
2331 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts;
2332 
2333 
2334 /* "oct_visitors.pxd":94
2335  *     cdef np.float64_t[:,:] fcoords
2336  *
2337  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
2338  *     cdef np.float64_t[:,:] fwidth
2339  *
2340  */
2341 
2342 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts {
2343   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2344 };
2345 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts;
2346 
2347 
2348 /* "oct_visitors.pxd":97
2349  *     cdef np.float64_t[:,:] fwidth
2350  *
2351  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
2352  *     cdef np.int64_t[:,:,:,:,:,:] source
2353  *     cdef np.int64_t[:,:] dest
2354  */
2355 
2356 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 {
2357   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2358 };
2359 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64;
2360 
2361 
2362 /* "oct_visitors.pxd":101
2363  *     cdef np.int64_t[:,:] dest
2364  *
2365  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
2366  *     cdef np.float64_t[:,:,:,:,:] source
2367  *     cdef np.float64_t[:,:] dest
2368  */
2369 
2370 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 {
2371   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2372 };
2373 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64;
2374 
2375 
2376 /* "oct_visitors.pxd":105
2377  *     cdef np.float64_t[:,:] dest
2378  *
2379  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
2380  *     cdef np.int64_t root
2381  *     cdef np.uint8_t[:] source
2382  */
2383 
2384 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
2385   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2386 };
2387 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
2388 
2389 
2390 /* "oct_visitors.pxd":110
2391  *     cdef np.uint8_t[:] dest
2392  *
2393  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
2394  *     cdef np.uint8_t[:] domain_mask
2395  *
2396  */
2397 
2398 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts {
2399   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2400 };
2401 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts;
2402 
2403 
2404 /* "oct_visitors.pxd":113
2405  *     cdef np.uint8_t[:] domain_mask
2406  *
2407  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
2408  *     pass
2409  *
2410  */
2411 
2412 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd {
2413   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2414 };
2415 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd;
2416 
2417 
2418 /* "oct_visitors.pxd":116
2419  *     pass
2420  *
2421  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
2422  *     cdef np.uint8_t[:] levels
2423  *     cdef np.int64_t[:] file_inds
2424  */
2425 
2426 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO {
2427   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2428 };
2429 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO;
2430 
2431 
2432 /* "oct_visitors.pxd":121
2433  *     cdef np.uint8_t[:] cell_inds
2434  *
2435  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
2436  *     cdef np.uint8_t[:] levels
2437  *     cdef np.int64_t[:] file_inds
2438  */
2439 
2440 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR {
2441   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2442 };
2443 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR;
2444 
2445 
2446 /* "oct_visitors.pxd":126
2447  *     cdef np.uint8_t[:] cell_inds
2448  *
2449  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
2450  *     cdef np.int64_t[:] domain_counts
2451  *
2452  */
2453 
2454 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain {
2455   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2456 };
2457 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain;
2458 
2459 
2460 /* "oct_visitors.pxd":129
2461  *     cdef np.int64_t[:] domain_counts
2462  *
2463  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
2464  *     cdef np.uint8_t[:] ref_mask
2465  *
2466  */
2467 
2468 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree {
2469   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2470 };
2471 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree;
2472 
2473 
2474 /* "oct_visitors.pxd":132
2475  *     cdef np.uint8_t[:] ref_mask
2476  *
2477  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
2478  *     cdef np.uint8_t[:] ref_mask
2479  *     cdef Oct* octs
2480  */
2481 
2482 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree {
2483   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2484 };
2485 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree;
2486 
2487 
2488 /* "oct_visitors.pxd":138
2489  *     cdef np.uint64_t *nfinest
2490  *
2491  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2492  *     cdef np.uint8_t[:] level_arr
2493  *     cdef np.uint64_t[:] morton_ind
2494  */
2495 
2496 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts {
2497   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2498 };
2499 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts;
2500 
2501 
2502 /* "oct_visitors.pxd":149
2503  *
2504  *
2505  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
2506  *     cdef np.int64_t[:,:,:,:] cell_inds
2507  *
2508  */
2509 
2510 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex {
2511   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2512 };
2513 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex;
2514 
2515 
2516 /* "oct_visitors.pxd":153
2517  *
2518  * # cimport oct_container
2519  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
2520  *     cdef int idim      # 0,1,2 for x,y,z
2521  *     cdef int direction # +1 for +x, -1 for -x
2522  */
2523 
2524 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
2525   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2526   void (*set_neighbour_info)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2527   __pyx_t_5numpy_uint8_t (*neighbour_rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2528 };
2529 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
2530 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2531 
2532 
2533 /* "oct_visitors.pxd":169
2534  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
2535  *
2536  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2537  *     cdef np.uint8_t[::1] cell_inds
2538  *     cdef np.int64_t[::1] domain_inds
2539  */
2540 
2541 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
2542   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2543 };
2544 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
2545 
2546 
2547 /* "oct_visitors.pxd":173
2548  *     cdef np.int64_t[::1] domain_inds
2549  *
2550  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2551  *     cdef np.uint8_t[::1] levels
2552  *     cdef np.int64_t[::1] file_inds
2553  */
2554 
2555 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
2556   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2557 };
2558 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
2559 
2560 
2561 /* "selection_routines.pxd":24
2562  *
2563  *
2564  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2565  *     cdef public np.int32_t min_level
2566  *     cdef public np.int32_t max_level
2567  */
2568 
2569 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject {
2570   void (*recursively_visit_octs)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs *__pyx_optional_args);
2571   void (*visit_oct_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, int, int, int);
2572   int (*select_grid)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args);
2573   int (*select_grid_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge *__pyx_optional_args);
2574   int (*select_cell)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2575   int (*select_point)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *);
2576   int (*select_sphere)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t);
2577   int (*select_bbox)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2578   int (*select_bbox_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2579   int (*fill_mask_selector)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int);
2580   void (*visit_grid_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args);
2581   __pyx_t_5numpy_float64_t (*periodic_difference)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int);
2582 };
2583 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;
2584 
2585 
2586 /* "selection_routines.pxd":70
2587  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2588  *
2589  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2590  *     pass
2591  *
2592  */
2593 
2594 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector {
2595   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2596 };
2597 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector;
2598 
2599 
2600 /* "selection_routines.pxd":73
2601  *     pass
2602  *
2603  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2604  *     cdef public SelectorObject base_selector
2605  *     cdef public np.int64_t domain_id
2606  */
2607 
2608 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2609   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2610 };
2611 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
2612 
2613 
2614 /* "selection_routines.pxd":77
2615  *     cdef public np.int64_t domain_id
2616  *
2617  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2618  *     cdef public SelectorObject sel1
2619  *     cdef public SelectorObject sel2
2620  */
2621 
2622 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector {
2623   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2624 };
2625 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector;
2626 
2627 
2628 /* "yt/utilities/lib/allocation_container.pxd":20
2629  *     void *my_objs
2630  *
2631  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2632  *     cdef public np.uint64_t itemsize
2633  *     cdef np.uint64_t n_con
2634  */
2635 
2636 struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2637   void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args);
2638   void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2639   void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2640 };
2641 static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool;
2642 
2643 
2644 /* "yt/geometry/oct_container.pyx":1164
2645  *         this = next
2646  *
2647  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2648  *     # This is an inherited version of the ObjectPool that provides setup and
2649  *     # teardown functions for the individually allocated objects.  These allow
2650  */
2651 
2652 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool {
2653   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2654   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2655 };
2656 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool;
2657 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2658 
2659 
2660 /* "yt/geometry/oct_container.pyx":46
2661  * #     given allocator.
2662  *
2663  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2664  *
2665  *     def __init__(self, oct_domain_dimensions, domain_left_edge,
2666  */
2667 
2668 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer {
2669   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*get)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args);
2670   int (*get_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **);
2671   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **(*neighbors)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *, __pyx_t_5numpy_int64_t *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2672   __pyx_t_5numpy_int64_t (*get_domain_offset)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int);
2673   void (*visit_all_octs)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args);
2674   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *);
2675   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_child)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *);
2676   void (*append_domain)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t);
2677 };
2678 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
2679 
2680 
2681 /* "yt/geometry/oct_container.pyx":950
2682  *         return 1
2683  *
2684  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2685  *
2686  *     def __init__(self, domain_dimensions, domain_left_edge, domain_right_edge,
2687  */
2688 
2689 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer {
2690   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2691   void (*key_to_ipos)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *);
2692   __pyx_t_5numpy_int64_t (*ipos_to_key)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *);
2693 };
2694 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
2695 
2696 
2697 /* "yt/geometry/oct_container.pxd":93
2698  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2699  *
2700  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2701  *     pass
2702  *
2703  */
2704 
2705 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2706   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2707 };
2708 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
2709 
2710 
2711 /* "yt/geometry/oct_container.pyx":1082
2712  *         if self.root_nodes != NULL: free(self.root_nodes)
2713  *
2714  * cdef class ARTOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2715  *     def __init__(self, oct_domain_dimensions, domain_left_edge,
2716  *                  domain_right_edge, partial_coverage = 0,
2717  */
2718 
2719 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_ARTOctreeContainer {
2720   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2721 };
2722 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer;
2723 
2724 
2725 /* "View.MemoryView":105
2726  *
2727  * @cname("__pyx_array")
2728  * cdef class array:             # <<<<<<<<<<<<<<
2729  *
2730  *     cdef:
2731  */
2732 
2733 struct __pyx_vtabstruct_array {
2734   PyObject *(*get_memview)(struct __pyx_array_obj *);
2735 };
2736 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2737 
2738 
2739 /* "View.MemoryView":330
2740  *
2741  * @cname('__pyx_memoryview')
2742  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2743  *
2744  *     cdef object obj
2745  */
2746 
2747 struct __pyx_vtabstruct_memoryview {
2748   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2749   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2750   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2751   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2752   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2753   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2754   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2755 };
2756 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2757 
2758 
2759 /* "View.MemoryView":961
2760  *
2761  * @cname('__pyx_memoryviewslice')
2762  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2763  *     "Internal class for passing memoryview slices to Python"
2764  *
2765  */
2766 
2767 struct __pyx_vtabstruct__memoryviewslice {
2768   struct __pyx_vtabstruct_memoryview __pyx_base;
2769 };
2770 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2771 
2772 /* --- Runtime support code (head) --- */
2773 /* Refnanny.proto */
2774 #ifndef CYTHON_REFNANNY
2775   #define CYTHON_REFNANNY 0
2776 #endif
2777 #if CYTHON_REFNANNY
2778   typedef struct {
2779     void (*INCREF)(void*, PyObject*, int);
2780     void (*DECREF)(void*, PyObject*, int);
2781     void (*GOTREF)(void*, PyObject*, int);
2782     void (*GIVEREF)(void*, PyObject*, int);
2783     void* (*SetupContext)(const char*, int, const char*);
2784     void (*FinishContext)(void**);
2785   } __Pyx_RefNannyAPIStruct;
2786   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2787   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2788   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2789 #ifdef WITH_THREAD
2790   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2791           if (acquire_gil) {\
2792               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2793               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2794               PyGILState_Release(__pyx_gilstate_save);\
2795           } else {\
2796               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2797           }
2798 #else
2799   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2800           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
2801 #endif
2802   #define __Pyx_RefNannyFinishContext()\
2803           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2804   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2805   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2806   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2807   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2808   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
2809   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
2810   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
2811   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
2812 #else
2813   #define __Pyx_RefNannyDeclarations
2814   #define __Pyx_RefNannySetupContext(name, acquire_gil)
2815   #define __Pyx_RefNannyFinishContext()
2816   #define __Pyx_INCREF(r) Py_INCREF(r)
2817   #define __Pyx_DECREF(r) Py_DECREF(r)
2818   #define __Pyx_GOTREF(r)
2819   #define __Pyx_GIVEREF(r)
2820   #define __Pyx_XINCREF(r) Py_XINCREF(r)
2821   #define __Pyx_XDECREF(r) Py_XDECREF(r)
2822   #define __Pyx_XGOTREF(r)
2823   #define __Pyx_XGIVEREF(r)
2824 #endif
2825 #define __Pyx_XDECREF_SET(r, v) do {\
2826         PyObject *tmp = (PyObject *) r;\
2827         r = v; __Pyx_XDECREF(tmp);\
2828     } while (0)
2829 #define __Pyx_DECREF_SET(r, v) do {\
2830         PyObject *tmp = (PyObject *) r;\
2831         r = v; __Pyx_DECREF(tmp);\
2832     } while (0)
2833 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2834 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2835 
2836 /* PyObjectGetAttrStr.proto */
2837 #if CYTHON_USE_TYPE_SLOTS
2838 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2839 #else
2840 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2841 #endif
2842 
2843 /* GetBuiltinName.proto */
2844 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2845 
2846 /* RaiseArgTupleInvalid.proto */
2847 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2848     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2849 
2850 /* RaiseDoubleKeywords.proto */
2851 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2852 
2853 /* ParseKeywords.proto */
2854 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
2855     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
2856     const char* function_name);
2857 
2858 /* GetItemInt.proto */
2859 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2860     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2861     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2862     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2863                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2864 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2865     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2866     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2867     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2868 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2869                                                               int wraparound, int boundscheck);
2870 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2871     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2872     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2873     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2874 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2875                                                               int wraparound, int boundscheck);
2876 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2877 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2878                                                      int is_list, int wraparound, int boundscheck);
2879 
2880 /* PyFunctionFastCall.proto */
2881 #if CYTHON_FAST_PYCALL
2882 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2883     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2884 #if 1 || PY_VERSION_HEX < 0x030600B1
2885 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2886 #else
2887 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2888 #endif
2889 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2890     (sizeof(char [1 - 2*!(cond)]) - 1)
2891 #ifndef Py_MEMBER_SIZE
2892 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2893 #endif
2894   static size_t __pyx_pyframe_localsplus_offset = 0;
2895   #include "frameobject.h"
2896   #define __Pxy_PyFrame_Initialize_Offsets()\
2897     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2898      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2899   #define __Pyx_PyFrame_GetLocalsplus(frame)\
2900     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2901 #endif
2902 
2903 /* PyObjectCall.proto */
2904 #if CYTHON_COMPILING_IN_CPYTHON
2905 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2906 #else
2907 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2908 #endif
2909 
2910 /* PyObjectCallMethO.proto */
2911 #if CYTHON_COMPILING_IN_CPYTHON
2912 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2913 #endif
2914 
2915 /* PyObjectCallNoArg.proto */
2916 #if CYTHON_COMPILING_IN_CPYTHON
2917 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2918 #else
2919 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2920 #endif
2921 
2922 /* PyCFunctionFastCall.proto */
2923 #if CYTHON_FAST_PYCCALL
2924 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2925 #else
2926 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
2927 #endif
2928 
2929 /* PyObjectCallOneArg.proto */
2930 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2931 
2932 /* DictGetItem.proto */
2933 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2934 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2935 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2936     (likely(PyDict_CheckExact(obj)) ?\
2937      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2938 #else
2939 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2940 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
2941 #endif
2942 
2943 /* ExtTypeTest.proto */
2944 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2945 
2946 /* IsLittleEndian.proto */
2947 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2948 
2949 /* BufferFormatCheck.proto */
2950 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2951 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2952                               __Pyx_BufFmt_StackElem* stack,
2953                               __Pyx_TypeInfo* type);
2954 
2955 /* BufferGetAndValidate.proto */
2956 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2957     ((obj == Py_None || obj == NULL) ?\
2958     (__Pyx_ZeroBuffer(buf), 0) :\
2959     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2960 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2961     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2962 static void __Pyx_ZeroBuffer(Py_buffer* buf);
2963 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2964 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2965 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2966 
2967 /* BufferFallbackError.proto */
2968 static void __Pyx_RaiseBufferFallbackError(void);
2969 
2970 /* None.proto */
2971 static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t);
2972 
2973 /* UnaryNegOverflows.proto */
2974 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2975         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2976 
2977 /* PyObjectCall2Args.proto */
2978 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2979 
2980 /* MemviewSliceInit.proto */
2981 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2982 #define __Pyx_MEMVIEW_DIRECT   1
2983 #define __Pyx_MEMVIEW_PTR      2
2984 #define __Pyx_MEMVIEW_FULL     4
2985 #define __Pyx_MEMVIEW_CONTIG   8
2986 #define __Pyx_MEMVIEW_STRIDED  16
2987 #define __Pyx_MEMVIEW_FOLLOW   32
2988 #define __Pyx_IS_C_CONTIG 1
2989 #define __Pyx_IS_F_CONTIG 2
2990 static int __Pyx_init_memviewslice(
2991                 struct __pyx_memoryview_obj *memview,
2992                 int ndim,
2993                 __Pyx_memviewslice *memviewslice,
2994                 int memview_is_new_reference);
2995 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2996     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2997 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2998     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2999 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
3000 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
3001 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3002 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
3003 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3004 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
3005 
3006 /* PyThreadStateGet.proto */
3007 #if CYTHON_FAST_THREAD_STATE
3008 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
3009 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
3010 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
3011 #else
3012 #define __Pyx_PyThreadState_declare
3013 #define __Pyx_PyThreadState_assign
3014 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
3015 #endif
3016 
3017 /* PyErrFetchRestore.proto */
3018 #if CYTHON_FAST_THREAD_STATE
3019 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
3020 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
3021 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
3022 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
3023 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
3024 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3025 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3026 #if CYTHON_COMPILING_IN_CPYTHON
3027 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
3028 #else
3029 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3030 #endif
3031 #else
3032 #define __Pyx_PyErr_Clear() PyErr_Clear()
3033 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3034 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
3035 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
3036 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
3037 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
3038 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
3039 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
3040 #endif
3041 
3042 /* RaiseException.proto */
3043 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3044 
3045 /* WriteUnraisableException.proto */
3046 static void __Pyx_WriteUnraisable(const char *name, int clineno,
3047                                   int lineno, const char *filename,
3048                                   int full_traceback, int nogil);
3049 
3050 /* PyDictVersioning.proto */
3051 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3052 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
3053 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
3054 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3055     (version_var) = __PYX_GET_DICT_VERSION(dict);\
3056     (cache_var) = (value);
3057 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3058     static PY_UINT64_T __pyx_dict_version = 0;\
3059     static PyObject *__pyx_dict_cached_value = NULL;\
3060     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3061         (VAR) = __pyx_dict_cached_value;\
3062     } else {\
3063         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3064         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3065     }\
3066 }
3067 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3068 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3069 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3070 #else
3071 #define __PYX_GET_DICT_VERSION(dict)  (0)
3072 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3073 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
3074 #endif
3075 
3076 /* GetModuleGlobalName.proto */
3077 #if CYTHON_USE_DICT_VERSIONS
3078 #define __Pyx_GetModuleGlobalName(var, name)  {\
3079     static PY_UINT64_T __pyx_dict_version = 0;\
3080     static PyObject *__pyx_dict_cached_value = NULL;\
3081     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
3082         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
3083         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3084 }
3085 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
3086     PY_UINT64_T __pyx_dict_version;\
3087     PyObject *__pyx_dict_cached_value;\
3088     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3089 }
3090 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
3091 #else
3092 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3093 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3094 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
3095 #endif
3096 
3097 /* BufferIndexError.proto */
3098 static void __Pyx_RaiseBufferIndexError(int axis);
3099 
3100 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
3101 /* ArgTypeTest.proto */
3102 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
3103     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
3104         __Pyx__ArgTypeTest(obj, type, name, exact))
3105 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
3106 
3107 /* ListAppend.proto */
3108 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)3109 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
3110     PyListObject* L = (PyListObject*) list;
3111     Py_ssize_t len = Py_SIZE(list);
3112     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
3113         Py_INCREF(x);
3114         PyList_SET_ITEM(list, len, x);
3115         Py_SIZE(list) = len+1;
3116         return 0;
3117     }
3118     return PyList_Append(list, x);
3119 }
3120 #else
3121 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3122 #endif
3123 
3124 /* ObjectGetItem.proto */
3125 #if CYTHON_USE_TYPE_SLOTS
3126 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
3127 #else
3128 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
3129 #endif
3130 
3131 /* PyIntBinop.proto */
3132 #if !CYTHON_COMPILING_IN_PYPY
3133 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3134 #else
3135 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
3136     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
3137 #endif
3138 
3139 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
3140 /* PyObjectGetMethod.proto */
3141 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
3142 
3143 /* PyObjectCallMethod1.proto */
3144 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3145 
3146 /* append.proto */
3147 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
3148 
3149 /* IncludeStringH.proto */
3150 #include <string.h>
3151 
3152 /* BytesEquals.proto */
3153 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
3154 
3155 /* UnicodeEquals.proto */
3156 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
3157 
3158 /* StrEquals.proto */
3159 #if PY_MAJOR_VERSION >= 3
3160 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
3161 #else
3162 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
3163 #endif
3164 
3165 /* IterFinish.proto */
3166 static CYTHON_INLINE int __Pyx_IterFinish(void);
3167 
3168 /* PyObjectCallMethod0.proto */
3169 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3170 
3171 /* RaiseNeedMoreValuesToUnpack.proto */
3172 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3173 
3174 /* RaiseTooManyValuesToUnpack.proto */
3175 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3176 
3177 /* UnpackItemEndCheck.proto */
3178 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
3179 
3180 /* RaiseNoneIterError.proto */
3181 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3182 
3183 /* UnpackTupleError.proto */
3184 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
3185 
3186 /* UnpackTuple2.proto */
3187 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
3188     (likely(is_tuple || PyTuple_Check(tuple)) ?\
3189         (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
3190             __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
3191             (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
3192         __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
3193 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
3194     PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
3195 static int __Pyx_unpack_tuple2_generic(
3196     PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
3197 
3198 /* dict_iter.proto */
3199 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
3200                                                    Py_ssize_t* p_orig_length, int* p_is_dict);
3201 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
3202                                               PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
3203 
3204 /* KeywordStringCheck.proto */
3205 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
3206 
3207 /* GetTopmostException.proto */
3208 #if CYTHON_USE_EXC_INFO_STACK
3209 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3210 #endif
3211 
3212 /* SaveResetException.proto */
3213 #if CYTHON_FAST_THREAD_STATE
3214 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3215 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3216 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3217 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3218 #else
3219 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
3220 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
3221 #endif
3222 
3223 /* PyErrExceptionMatches.proto */
3224 #if CYTHON_FAST_THREAD_STATE
3225 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
3226 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
3227 #else
3228 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
3229 #endif
3230 
3231 /* GetException.proto */
3232 #if CYTHON_FAST_THREAD_STATE
3233 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
3234 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3235 #else
3236 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3237 #endif
3238 
3239 /* GetAttr.proto */
3240 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
3241 
3242 /* HasAttr.proto */
3243 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3244 
3245 /* None.proto */
3246 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
3247 
3248 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3249 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3250 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)3251 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
3252     int byteorder = 0;
3253     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3254 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)3255 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
3256     int byteorder = -1;
3257     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3258 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)3259 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
3260     int byteorder = 1;
3261     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3262 }
3263 
3264 /* decode_c_string.proto */
3265 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
3266          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
3267          const char* encoding, const char* errors,
3268          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
3269 
3270 /* GetAttr3.proto */
3271 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
3272 
3273 /* SwapException.proto */
3274 #if CYTHON_FAST_THREAD_STATE
3275 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3276 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3277 #else
3278 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3279 #endif
3280 
3281 /* Import.proto */
3282 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
3283 
3284 /* FastTypeChecks.proto */
3285 #if CYTHON_COMPILING_IN_CPYTHON
3286 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
3287 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
3288 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3289 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3290 #else
3291 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
3292 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3293 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
3294 #endif
3295 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3296 
3297 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3298 /* ListCompAppend.proto */
3299 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)3300 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
3301     PyListObject* L = (PyListObject*) list;
3302     Py_ssize_t len = Py_SIZE(list);
3303     if (likely(L->allocated > len)) {
3304         Py_INCREF(x);
3305         PyList_SET_ITEM(list, len, x);
3306         Py_SIZE(list) = len+1;
3307         return 0;
3308     }
3309     return PyList_Append(list, x);
3310 }
3311 #else
3312 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
3313 #endif
3314 
3315 /* PyIntBinop.proto */
3316 #if !CYTHON_COMPILING_IN_PYPY
3317 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3318 #else
3319 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3320     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3321 #endif
3322 
3323 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)3324 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
3325 #if CYTHON_COMPILING_IN_CPYTHON
3326     PyObject* none = _PyList_Extend((PyListObject*)L, v);
3327     if (unlikely(!none))
3328         return -1;
3329     Py_DECREF(none);
3330     return 0;
3331 #else
3332     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
3333 #endif
3334 }
3335 
3336 /* None.proto */
3337 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
3338 
3339 /* None.proto */
3340 static CYTHON_INLINE long __Pyx_div_long(long, long);
3341 
3342 /* ImportFrom.proto */
3343 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3344 
3345 /* StringJoin.proto */
3346 #if PY_MAJOR_VERSION < 3
3347 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
3348 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
3349 #else
3350 #define __Pyx_PyString_Join PyUnicode_Join
3351 #define __Pyx_PyBaseString_Join PyUnicode_Join
3352 #endif
3353 #if CYTHON_COMPILING_IN_CPYTHON
3354     #if PY_MAJOR_VERSION < 3
3355     #define __Pyx_PyBytes_Join _PyString_Join
3356     #else
3357     #define __Pyx_PyBytes_Join _PyBytes_Join
3358     #endif
3359 #else
3360 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3361 #endif
3362 
3363 /* PyObject_Unicode.proto */
3364 #if PY_MAJOR_VERSION >= 3
3365 #define __Pyx_PyObject_Unicode(obj)\
3366     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3367 #else
3368 #define __Pyx_PyObject_Unicode(obj)\
3369     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
3370 #endif
3371 
3372 /* CallNextTpDealloc.proto */
3373 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
3374 
3375 /* PyObject_GenericGetAttrNoDict.proto */
3376 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3377 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
3378 #else
3379 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
3380 #endif
3381 
3382 /* PyObject_GenericGetAttr.proto */
3383 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3384 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
3385 #else
3386 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
3387 #endif
3388 
3389 /* TypeImport.proto */
3390 #ifndef __PYX_HAVE_RT_ImportType_proto
3391 #define __PYX_HAVE_RT_ImportType_proto
3392 enum __Pyx_ImportType_CheckSize {
3393    __Pyx_ImportType_CheckSize_Error = 0,
3394    __Pyx_ImportType_CheckSize_Warn = 1,
3395    __Pyx_ImportType_CheckSize_Ignore = 2
3396 };
3397 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
3398 #endif
3399 
3400 /* GetVTable.proto */
3401 static void* __Pyx_GetVtable(PyObject *dict);
3402 
3403 /* SetVTable.proto */
3404 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
3405 
3406 /* SetupReduce.proto */
3407 static int __Pyx_setup_reduce(PyObject* type_obj);
3408 
3409 /* ClassMethod.proto */
3410 #include "descrobject.h"
3411 static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);
3412 
3413 /* GetNameInClass.proto */
3414 #define __Pyx_GetNameInClass(var, nmspace, name)  (var) = __Pyx__GetNameInClass(nmspace, name)
3415 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
3416 
3417 /* CLineInTraceback.proto */
3418 #ifdef CYTHON_CLINE_IN_TRACEBACK
3419 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3420 #else
3421 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3422 #endif
3423 
3424 /* CodeObjectCache.proto */
3425 typedef struct {
3426     PyCodeObject* code_object;
3427     int code_line;
3428 } __Pyx_CodeObjectCacheEntry;
3429 struct __Pyx_CodeObjectCache {
3430     int count;
3431     int max_count;
3432     __Pyx_CodeObjectCacheEntry* entries;
3433 };
3434 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3435 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3436 static PyCodeObject *__pyx_find_code_object(int code_line);
3437 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3438 
3439 /* AddTraceback.proto */
3440 static void __Pyx_AddTraceback(const char *funcname, int c_line,
3441                                int py_line, const char *filename);
3442 
3443 #if PY_MAJOR_VERSION < 3
3444     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3445     static void __Pyx_ReleaseBuffer(Py_buffer *view);
3446 #else
3447     #define __Pyx_GetBuffer PyObject_GetBuffer
3448     #define __Pyx_ReleaseBuffer PyBuffer_Release
3449 #endif
3450 
3451 
3452 /* BufferStructDeclare.proto */
3453 typedef struct {
3454   Py_ssize_t shape, strides, suboffsets;
3455 } __Pyx_Buf_DimInfo;
3456 typedef struct {
3457   size_t refcount;
3458   Py_buffer pybuffer;
3459 } __Pyx_Buffer;
3460 typedef struct {
3461   __Pyx_Buffer *rcbuffer;
3462   char *data;
3463   __Pyx_Buf_DimInfo diminfo[8];
3464 } __Pyx_LocalBuf_ND;
3465 
3466 /* MemviewSliceIsContig.proto */
3467 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3468 
3469 /* OverlappingSlices.proto */
3470 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3471                                 __Pyx_memviewslice *slice2,
3472                                 int ndim, size_t itemsize);
3473 
3474 /* Capsule.proto */
3475 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
3476 
3477 /* CIntToPy.proto */
3478 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3479 
3480 /* TypeInfoCompare.proto */
3481 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3482 
3483 /* MemviewSliceValidateAndInit.proto */
3484 static int __Pyx_ValidateAndInit_memviewslice(
3485                 int *axes_specs,
3486                 int c_or_f_flag,
3487                 int buf_flags,
3488                 int ndim,
3489                 __Pyx_TypeInfo *dtype,
3490                 __Pyx_BufFmt_StackElem stack[],
3491                 __Pyx_memviewslice *memviewslice,
3492                 PyObject *original_obj);
3493 
3494 /* ObjectToMemviewSlice.proto */
3495 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3496 
3497 /* ObjectToMemviewSlice.proto */
3498 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag);
3499 
3500 /* ObjectToMemviewSlice.proto */
3501 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3502 
3503 /* ObjectToMemviewSlice.proto */
3504 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
3505 
3506 /* CIntToPy.proto */
3507 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3508 
3509 /* CIntToPy.proto */
3510 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3511 
3512 /* CIntToPy.proto */
3513 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value);
3514 
3515 /* MemviewDtypeToObject.proto */
3516 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp);
3517 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj);
3518 
3519 /* CIntToPy.proto */
3520 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3521 
3522 /* CIntToPy.proto */
3523 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
3524 
3525 /* Print.proto */
3526 static int __Pyx_Print(PyObject*, PyObject *, int);
3527 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
3528 static PyObject* __pyx_print = 0;
3529 static PyObject* __pyx_print_kwargs = 0;
3530 #endif
3531 
3532 /* CIntToPy.proto */
3533 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);
3534 
3535 /* MemviewDtypeToObject.proto */
3536 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp);
3537 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj);
3538 
3539 /* MemviewDtypeToObject.proto */
3540 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp);
3541 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj);
3542 
3543 /* MemviewDtypeToObject.proto */
3544 static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp);
3545 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj);
3546 
3547 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded;
3548 static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s);
3549 /* MemviewDtypeToObject.proto */
3550 static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp);
3551 static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj);
3552 
3553 /* RealImag.proto */
3554 #if CYTHON_CCOMPLEX
3555   #ifdef __cplusplus
3556     #define __Pyx_CREAL(z) ((z).real())
3557     #define __Pyx_CIMAG(z) ((z).imag())
3558   #else
3559     #define __Pyx_CREAL(z) (__real__(z))
3560     #define __Pyx_CIMAG(z) (__imag__(z))
3561   #endif
3562 #else
3563     #define __Pyx_CREAL(z) ((z).real)
3564     #define __Pyx_CIMAG(z) ((z).imag)
3565 #endif
3566 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3567         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3568     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3569     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3570 #else
3571     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3572     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3573 #endif
3574 
3575 /* Arithmetic.proto */
3576 #if CYTHON_CCOMPLEX
3577     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
3578     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
3579     #define __Pyx_c_diff_float(a, b) ((a)-(b))
3580     #define __Pyx_c_prod_float(a, b) ((a)*(b))
3581     #define __Pyx_c_quot_float(a, b) ((a)/(b))
3582     #define __Pyx_c_neg_float(a)     (-(a))
3583   #ifdef __cplusplus
3584     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3585     #define __Pyx_c_conj_float(z)    (::std::conj(z))
3586     #if 1
3587         #define __Pyx_c_abs_float(z)     (::std::abs(z))
3588         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
3589     #endif
3590   #else
3591     #define __Pyx_c_is_zero_float(z) ((z)==0)
3592     #define __Pyx_c_conj_float(z)    (conjf(z))
3593     #if 1
3594         #define __Pyx_c_abs_float(z)     (cabsf(z))
3595         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
3596     #endif
3597  #endif
3598 #else
3599     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3600     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3601     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3602     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3603     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3604     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3605     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3606     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3607     #if 1
3608         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3609         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3610     #endif
3611 #endif
3612 
3613 /* Arithmetic.proto */
3614 #if CYTHON_CCOMPLEX
3615     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
3616     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
3617     #define __Pyx_c_diff_double(a, b) ((a)-(b))
3618     #define __Pyx_c_prod_double(a, b) ((a)*(b))
3619     #define __Pyx_c_quot_double(a, b) ((a)/(b))
3620     #define __Pyx_c_neg_double(a)     (-(a))
3621   #ifdef __cplusplus
3622     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3623     #define __Pyx_c_conj_double(z)    (::std::conj(z))
3624     #if 1
3625         #define __Pyx_c_abs_double(z)     (::std::abs(z))
3626         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
3627     #endif
3628   #else
3629     #define __Pyx_c_is_zero_double(z) ((z)==0)
3630     #define __Pyx_c_conj_double(z)    (conj(z))
3631     #if 1
3632         #define __Pyx_c_abs_double(z)     (cabs(z))
3633         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
3634     #endif
3635  #endif
3636 #else
3637     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3638     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3639     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3640     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3641     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3642     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3643     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3644     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3645     #if 1
3646         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3647         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3648     #endif
3649 #endif
3650 
3651 /* CIntToPy.proto */
3652 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
3653 
3654 /* MemviewSliceCopyTemplate.proto */
3655 static __Pyx_memviewslice
3656 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3657                                  const char *mode, int ndim,
3658                                  size_t sizeof_dtype, int contig_flag,
3659                                  int dtype_is_object);
3660 
3661 /* CIntFromPy.proto */
3662 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
3663 
3664 /* TypeInfoToFormat.proto */
3665 struct __pyx_typeinfo_string {
3666     char string[3];
3667 };
3668 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
3669 
3670 /* CIntFromPy.proto */
3671 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3672 
3673 /* CIntFromPy.proto */
3674 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
3675 
3676 /* CIntFromPy.proto */
3677 static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);
3678 
3679 /* CIntFromPy.proto */
3680 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3681 
3682 /* CIntFromPy.proto */
3683 static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *);
3684 
3685 /* CIntFromPy.proto */
3686 static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);
3687 
3688 /* PrintOne.proto */
3689 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
3690 
3691 /* CIntFromPy.proto */
3692 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3693 
3694 /* ObjectToMemviewSlice.proto */
3695 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag);
3696 
3697 /* ObjectToMemviewSlice.proto */
3698 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3699 
3700 /* ObjectToMemviewSlice.proto */
3701 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3702 
3703 /* ObjectToMemviewSlice.proto */
3704 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
3705 
3706 /* ObjectToMemviewSlice.proto */
3707 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *, int writable_flag);
3708 
3709 /* ObjectToMemviewSlice.proto */
3710 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3711 
3712 /* ObjectToMemviewSlice.proto */
3713 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag);
3714 
3715 /* ObjectToMemviewSlice.proto */
3716 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3717 
3718 /* ObjectToMemviewSlice.proto */
3719 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
3720 
3721 /* ObjectToMemviewSlice.proto */
3722 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *, int writable_flag);
3723 
3724 /* CheckBinaryVersion.proto */
3725 static int __Pyx_check_binary_version(void);
3726 
3727 /* PyObjectSetAttrStr.proto */
3728 #if CYTHON_USE_TYPE_SLOTS
3729 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
3730 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
3731 #else
3732 #define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
3733 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
3734 #endif
3735 
3736 /* VoidPtrExport.proto */
3737 static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
3738 
3739 /* FunctionExport.proto */
3740 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
3741 
3742 /* FunctionImport.proto */
3743 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
3744 
3745 /* InitStrings.proto */
3746 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3747 
3748 static void __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args); /* proto*/
3749 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, CYTHON_UNUSED int __pyx_v_domain_id); /* proto*/
3750 static int __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_o); /* proto*/
3751 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_ppos, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args); /* proto*/
3752 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_neighbors(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *__pyx_v_oi, __pyx_t_5numpy_int64_t *__pyx_v_nneighbors, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, int *__pyx_v_periodicity); /* proto*/
3753 static void __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_domain_count); /* proto*/
3754 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind); /* proto*/
3755 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_child(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_parent); /* proto*/
3756 static int __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_o); /* proto*/
3757 static void __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_key_to_ipos(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, __pyx_t_5numpy_int64_t *__pyx_v_pos); /* proto*/
3758 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_ipos_to_key(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int *__pyx_v_pos); /* proto*/
3759 static void __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor, struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs *__pyx_optional_args); /* proto*/
3760 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED int __pyx_v_domain_id); /* proto*/
3761 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind); /* proto*/
3762 static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/
3763 static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id); /* proto*/
3764 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3765 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3766 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self); /* proto*/
3767 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/
3768 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3769 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3770 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3771 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3772 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3773 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3774 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3775 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3776 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3777 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3778 
3779 /* Module declarations from 'cython.view' */
3780 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3781 
3782 /* Module declarations from 'cython' */
3783 
3784 /* Module declarations from 'cpython.buffer' */
3785 
3786 /* Module declarations from 'libc.string' */
3787 
3788 /* Module declarations from 'libc.stdio' */
3789 
3790 /* Module declarations from '__builtin__' */
3791 
3792 /* Module declarations from 'cpython.type' */
3793 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
3794 
3795 /* Module declarations from 'cpython' */
3796 
3797 /* Module declarations from 'cpython.object' */
3798 
3799 /* Module declarations from 'cpython.ref' */
3800 
3801 /* Module declarations from 'cpython.mem' */
3802 
3803 /* Module declarations from 'numpy' */
3804 
3805 /* Module declarations from 'numpy' */
3806 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
3807 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
3808 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
3809 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
3810 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
3811 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
3812 
3813 /* Module declarations from 'yt.geometry.oct_visitors' */
3814 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = 0;
3815 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = 0;
3816 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = 0;
3817 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = 0;
3818 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = 0;
3819 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = 0;
3820 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = 0;
3821 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = 0;
3822 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = 0;
3823 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = 0;
3824 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = 0;
3825 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = 0;
3826 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = 0;
3827 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = 0;
3828 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = 0;
3829 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = 0;
3830 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = 0;
3831 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = 0;
3832 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = 0;
3833 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = 0;
3834 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = 0;
3835 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = 0;
3836 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = 0;
3837 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = 0;
3838 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = 0;
3839 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = 0;
3840 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = 0;
3841 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/
3842 
3843 /* Module declarations from 'yt.geometry.grid_visitors' */
3844 static __pyx_t_5numpy_uint8_t (*__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3845 
3846 /* Module declarations from 'yt.utilities.lib.fp_utils' */
3847 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3848 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3849 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *); /*proto*/
3850 
3851 /* Module declarations from 'libc.float' */
3852 
3853 /* Module declarations from 'libc.math' */
3854 
3855 /* Module declarations from 'yt.utilities.lib.geometry_utils' */
3856 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_int64_t *); /*proto*/
3857 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
3858 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3859 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3860 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3861 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t); /*proto*/
3862 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t *); /*proto*/
3863 
3864 /* Module declarations from 'yt.geometry.selection_routines' */
3865 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0;
3866 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0;
3867 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0;
3868 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0;
3869 
3870 /* Module declarations from 'libc.stdlib' */
3871 
3872 /* Module declarations from 'yt.utilities.lib.allocation_container' */
3873 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0;
3874 
3875 /* Module declarations from 'yt.geometry.oct_container' */
3876 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0;
3877 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0;
3878 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0;
3879 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0;
3880 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_ARTOctreeContainer = 0;
3881 static PyTypeObject *__pyx_array_type = 0;
3882 static PyTypeObject *__pyx_MemviewEnum_type = 0;
3883 static PyTypeObject *__pyx_memoryview_type = 0;
3884 static PyTypeObject *__pyx_memoryviewslice_type = 0;
3885 static int __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX;
3886 static PyObject *generic = 0;
3887 static PyObject *strided = 0;
3888 static PyObject *indirect = 0;
3889 static PyObject *contiguous = 0;
3890 static PyObject *indirect_contiguous = 0;
3891 static int __pyx_memoryview_thread_locks_used;
3892 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3893 static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_append(struct __pyx_t_2yt_8geometry_13oct_container_OctList *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *); /*proto*/
3894 static int __pyx_f_2yt_8geometry_13oct_container_OctList_count(struct __pyx_t_2yt_8geometry_13oct_container_OctList *); /*proto*/
3895 static void __pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList *); /*proto*/
3896 static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void const *, void const *); /*proto*/
3897 static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(struct __pyx_t_2yt_8geometry_13oct_container_OctList *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int, int, int); /*proto*/
3898 static struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *); /*proto*/
3899 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3900 static void *__pyx_align_pointer(void *, size_t); /*proto*/
3901 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3902 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3903 static PyObject *_unellipsify(PyObject *, int); /*proto*/
3904 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3905 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3906 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3907 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3908 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3909 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3910 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3911 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3912 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3913 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3914 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3915 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3916 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3917 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3918 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3919 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3920 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3921 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3922 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
3923 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
3924 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3925 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3926 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3927 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3928 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3929 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3930 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3931 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3932 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
3933 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
3934 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
3935 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 };
3936 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 };
3937 static __Pyx_StructField __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded[] = {
3938   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "file_ind", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, file_ind)},
3939   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "domain_ind", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, domain_ind)},
3940   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "domain", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, domain)},
3941   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "padding", offsetof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded, padding)},
3942   {NULL, NULL, 0}
3943 };
3944 static __Pyx_TypeInfo __Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded = { "OctPadded", __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded), { 0 }, 0, 'S', 0, 0 };
3945 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t = { "uint64_t", NULL, sizeof(__pyx_t_5numpy_uint64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint64_t), 0 };
3946 #define __Pyx_MODULE_NAME "yt.geometry.oct_container"
3947 extern int __pyx_module_is_main_yt__geometry__oct_container;
3948 int __pyx_module_is_main_yt__geometry__oct_container = 0;
3949 
3950 /* Implementation of 'yt.geometry.oct_container' */
3951 static PyObject *__pyx_builtin_range;
3952 static PyObject *__pyx_builtin_RuntimeError;
3953 static PyObject *__pyx_builtin_KeyError;
3954 static PyObject *__pyx_builtin_NotImplementedError;
3955 static PyObject *__pyx_builtin_enumerate;
3956 static PyObject *__pyx_builtin_TypeError;
3957 static PyObject *__pyx_builtin_ValueError;
3958 static PyObject *__pyx_builtin_ImportError;
3959 static PyObject *__pyx_builtin_MemoryError;
3960 static PyObject *__pyx_builtin_Ellipsis;
3961 static PyObject *__pyx_builtin_id;
3962 static PyObject *__pyx_builtin_IndexError;
3963 static const char __pyx_k_C[] = "C";
3964 static const char __pyx_k_O[] = "O";
3965 static const char __pyx_k_T[] = "T{";
3966   static const char __pyx_k_c[] = "c";
3967   static const char __pyx_k_o[] = "o";
3968   static const char __pyx_k_r[] = "r";
3969   static const char __pyx_k_s[] = "(%s)";
3970   static const char __pyx_k_id[] = "id";
3971   static const char __pyx_k_np[] = "np";
3972   static const char __pyx_k__42[] = "^";
3973   static const char __pyx_k__43[] = "";
3974   static const char __pyx_k__44[] = ":";
3975 static const char __pyx_k__45[] = "}";
3976 static const char __pyx_k__46[] = ",";
3977 static const char __pyx_k_end[] = "end";
3978 static const char __pyx_k_nan[] = "nan";
3979 static const char __pyx_k_new[] = "__new__";
3980 static const char __pyx_k_obj[] = "obj";
3981 static const char __pyx_k_pos[] = "pos";
3982 static const char __pyx_k_base[] = "base";
3983 static const char __pyx_k_bool[] = "bool";
3984 static const char __pyx_k_copy[] = "copy";
3985 static const char __pyx_k_dest[] = "dest";
3986 static const char __pyx_k_dict[] = "__dict__";
3987 static const char __pyx_k_dims[] = "dims";
3988 static const char __pyx_k_file[] = "file";
3989 static const char __pyx_k_full[] = "full";
3990 static const char __pyx_k_init[] = "__init__";
3991 static const char __pyx_k_join[] = "join";
3992 static const char __pyx_k_main[] = "__main__";
3993 static const char __pyx_k_mode[] = "mode";
3994 static const char __pyx_k_name[] = "name";
3995 static const char __pyx_k_ndim[] = "ndim";
3996 static const char __pyx_k_ones[] = "ones";
3997 static const char __pyx_k_pack[] = "pack";
3998 static const char __pyx_k_size[] = "size";
3999 static const char __pyx_k_step[] = "step";
4000 static const char __pyx_k_stop[] = "stop";
4001 static const char __pyx_k_test[] = "__test__";
4002 static const char __pyx_k_ASCII[] = "ASCII";
4003 static const char __pyx_k_class[] = "__class__";
4004 static const char __pyx_k_dtype[] = "dtype";
4005 static const char __pyx_k_empty[] = "empty";
4006 static const char __pyx_k_error[] = "error";
4007 static const char __pyx_k_flags[] = "flags";
4008 static const char __pyx_k_int32[] = "int32";
4009 static const char __pyx_k_int64[] = "int64";
4010 static const char __pyx_k_level[] = "level";
4011 static const char __pyx_k_numpy[] = "numpy";
4012 static const char __pyx_k_order[] = "order";
4013 static const char __pyx_k_print[] = "print";
4014 static const char __pyx_k_range[] = "range";
4015 static const char __pyx_k_shape[] = "shape";
4016 static const char __pyx_k_start[] = "start";
4017 static const char __pyx_k_uint8[] = "uint8";
4018 static const char __pyx_k_units[] = "units";
4019 static const char __pyx_k_zeros[] = "zeros";
4020 static const char __pyx_k_append[] = "append";
4021 static const char __pyx_k_astype[] = "astype";
4022 static const char __pyx_k_curdom[] = "curdom";
4023 static const char __pyx_k_domain[] = "domain";
4024 static const char __pyx_k_encode[] = "encode";
4025 static const char __pyx_k_format[] = "format";
4026 static const char __pyx_k_import[] = "__import__";
4027 static const char __pyx_k_levels[] = "levels";
4028 static const char __pyx_k_name_2[] = "__name__";
4029 static const char __pyx_k_octree[] = "octree";
4030 static const char __pyx_k_offset[] = "offset";
4031 static const char __pyx_k_pickle[] = "pickle";
4032 static const char __pyx_k_reduce[] = "__reduce__";
4033 static const char __pyx_k_source[] = "source";
4034 static const char __pyx_k_struct[] = "struct";
4035 static const char __pyx_k_uint64[] = "uint64";
4036 static const char __pyx_k_unpack[] = "unpack";
4037 static const char __pyx_k_update[] = "update";
4038 static const char __pyx_k_asarray[] = "asarray";
4039 static const char __pyx_k_domains[] = "domains";
4040 static const char __pyx_k_float64[] = "float64";
4041 static const char __pyx_k_fortran[] = "fortran";
4042 static const char __pyx_k_memview[] = "memview";
4043 static const char __pyx_k_padding[] = "padding";
4044 static const char __pyx_k_reshape[] = "reshape";
4045 static const char __pyx_k_Ellipsis[] = "Ellipsis";
4046 static const char __pyx_k_KeyError[] = "KeyError";
4047 static const char __pyx_k_curlevel[] = "curlevel";
4048 static const char __pyx_k_file_ind[] = "file_ind";
4049 static const char __pyx_k_getstate[] = "__getstate__";
4050 static const char __pyx_k_itemsize[] = "itemsize";
4051 static const char __pyx_k_num_octs[] = "num_octs";
4052 static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
4053 static const char __pyx_k_pyx_type[] = "__pyx_type";
4054 static const char __pyx_k_selector[] = "selector";
4055 static const char __pyx_k_setstate[] = "__setstate__";
4056 static const char __pyx_k_ORDER_MAX[] = "ORDER_MAX";
4057 static const char __pyx_k_TypeError[] = "TypeError";
4058 static const char __pyx_k_cell_inds[] = "cell_inds";
4059 static const char __pyx_k_domain_id[] = "domain_id";
4060 static const char __pyx_k_enumerate[] = "enumerate";
4061 static const char __pyx_k_file_inds[] = "file_inds";
4062 static const char __pyx_k_left_edge[] = "left_edge";
4063 static const char __pyx_k_num_cells[] = "num_cells";
4064 static const char __pyx_k_pyx_state[] = "__pyx_state";
4065 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4066 static const char __pyx_k_to_arrays[] = "to_arrays";
4067 static const char __pyx_k_IndexError[] = "IndexError";
4068 static const char __pyx_k_ValueError[] = "ValueError";
4069 static const char __pyx_k_count_octs[] = "count_octs";
4070 static const char __pyx_k_domain_ind[] = "domain_ind";
4071 static const char __pyx_k_pyx_result[] = "__pyx_result";
4072 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4073 static const char __pyx_k_right_edge[] = "right_edge";
4074 static const char __pyx_k_root_nodes[] = "root_nodes";
4075 static const char __pyx_k_ImportError[] = "ImportError";
4076 static const char __pyx_k_MemoryError[] = "MemoryError";
4077 static const char __pyx_k_ORDER_MAX_2[] = "_ORDER_MAX";
4078 static const char __pyx_k_PickleError[] = "PickleError";
4079 static const char __pyx_k_code_length[] = "code_length";
4080 static const char __pyx_k_dest_fields[] = "dest_fields";
4081 static const char __pyx_k_load_octree[] = "load_octree";
4082 static const char __pyx_k_over_refine[] = "over_refine";
4083 static const char __pyx_k_RuntimeError[] = "RuntimeError";
4084 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4085 static const char __pyx_k_stringsource[] = "stringsource";
4086 static const char __pyx_k_OctObjectPool[] = "OctObjectPool";
4087 static const char __pyx_k_Oct_container[] = "\nOct container\n\n\n\n\n";
4088 static const char __pyx_k_domain_counts[] = "domain_counts";
4089 static const char __pyx_k_n_ghost_zones[] = "n_ghost_zones";
4090 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
4091 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4092 static const char __pyx_k_skip_boundary[] = "skip_boundary";
4093 static const char __pyx_k_source_fields[] = "source_fields";
4094 static const char __pyx_k_Too_many_roots[] = "Too many roots.";
4095 static const char __pyx_k_count_boundary[] = "count_boundary";
4096 static const char __pyx_k_OctreeContainer[] = "OctreeContainer";
4097 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
4098 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4099 static const char __pyx_k_count_oct_cells[] = "count_oct_cells";
4100 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4101 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4102 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
4103 static const char __pyx_k_allocate_domains[] = "allocate_domains";
4104 static const char __pyx_k_convert_to_units[] = "convert_to_units";
4105 static const char __pyx_k_domain_left_edge[] = "domain_left_edge";
4106 static const char __pyx_k_partial_coverage[] = "partial_coverage";
4107 static const char __pyx_k_Too_many_assigned[] = "Too many assigned.";
4108 static const char __pyx_k_domain_dimensions[] = "domain_dimensions";
4109 static const char __pyx_k_domain_right_edge[] = "domain_right_edge";
4110 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
4111 static const char __pyx_k_ARTOctreeContainer[] = "ARTOctreeContainer";
4112 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
4113 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
4114 static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
4115 static const char __pyx_k_DEST_INDEX_RAN_AHEAD[] = "DEST INDEX RAN AHEAD.";
4116 static const char __pyx_k_initialize_root_mesh[] = "_initialize_root_mesh";
4117 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
4118 static const char __pyx_k_RAMSESOctreeContainer[] = "RAMSESOctreeContainer";
4119 static const char __pyx_k_SparseOctreeContainer[] = "SparseOctreeContainer";
4120 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
4121 static const char __pyx_k_oct_domain_dimensions[] = "oct_domain_dimensions";
4122 static const char __pyx_k_GLOBAL_INDEX_RAN_AHEAD[] = "GLOBAL INDEX RAN AHEAD.";
4123 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
4124 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
4125 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
4126 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
4127 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
4128 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4129 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
4130 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
4131 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
4132 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
4133 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
4134 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4135 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4136 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
4137 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4138 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4139 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
4140 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
4141 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4142 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
4143 static const char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'file_ind'";
4144 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
4145 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
4146 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4147 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
4148 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
4149 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
4150 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
4151 static const char __pyx_k_self_root_mesh_cannot_be_convert[] = "self.root_mesh cannot be converted to a Python object for pickling";
4152 static const char __pyx_k_self_root_mesh_self_root_nodes_s[] = "self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling";
4153 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
4154 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
4155 static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'domain_ind'";
4156 static const char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'domain'";
4157 static const char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'padding'";
4158 static PyObject *__pyx_n_s_ARTOctreeContainer;
4159 static PyObject *__pyx_n_s_ASCII;
4160 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
4161 static PyObject *__pyx_n_s_C;
4162 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
4163 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
4164 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
4165 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
4166 static PyObject *__pyx_kp_s_DEST_INDEX_RAN_AHEAD;
4167 static PyObject *__pyx_n_s_Ellipsis;
4168 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
4169 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
4170 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
4171 static PyObject *__pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD;
4172 static PyObject *__pyx_n_s_ImportError;
4173 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
4174 static PyObject *__pyx_n_s_IndexError;
4175 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4176 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
4177 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
4178 static PyObject *__pyx_n_s_KeyError;
4179 static PyObject *__pyx_n_s_MemoryError;
4180 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4181 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
4182 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
4183 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
4184 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
4185 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
4186 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
4187 static PyObject *__pyx_n_s_NotImplementedError;
4188 static PyObject *__pyx_n_b_O;
4189 static PyObject *__pyx_n_s_ORDER_MAX;
4190 static PyObject *__pyx_n_s_ORDER_MAX_2;
4191 static PyObject *__pyx_n_s_OctObjectPool;
4192 static PyObject *__pyx_n_s_OctreeContainer;
4193 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
4194 static PyObject *__pyx_n_s_PickleError;
4195 static PyObject *__pyx_n_s_RAMSESOctreeContainer;
4196 static PyObject *__pyx_n_s_RuntimeError;
4197 static PyObject *__pyx_n_s_SparseOctreeContainer;
4198 static PyObject *__pyx_kp_b_T;
4199 static PyObject *__pyx_kp_s_Too_many_assigned;
4200 static PyObject *__pyx_kp_s_Too_many_roots;
4201 static PyObject *__pyx_n_s_TypeError;
4202 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4203 static PyObject *__pyx_n_s_ValueError;
4204 static PyObject *__pyx_n_s_View_MemoryView;
4205 static PyObject *__pyx_kp_b__42;
4206 static PyObject *__pyx_kp_b__43;
4207 static PyObject *__pyx_kp_b__44;
4208 static PyObject *__pyx_kp_b__45;
4209 static PyObject *__pyx_kp_u__46;
4210 static PyObject *__pyx_n_s_allocate_buffer;
4211 static PyObject *__pyx_n_s_allocate_domains;
4212 static PyObject *__pyx_n_s_append;
4213 static PyObject *__pyx_n_s_asarray;
4214 static PyObject *__pyx_n_s_astype;
4215 static PyObject *__pyx_n_s_base;
4216 static PyObject *__pyx_n_s_bool;
4217 static PyObject *__pyx_n_s_c;
4218 static PyObject *__pyx_n_u_c;
4219 static PyObject *__pyx_n_s_cell_inds;
4220 static PyObject *__pyx_n_s_class;
4221 static PyObject *__pyx_n_s_cline_in_traceback;
4222 static PyObject *__pyx_n_s_code_length;
4223 static PyObject *__pyx_kp_s_contiguous_and_direct;
4224 static PyObject *__pyx_kp_s_contiguous_and_indirect;
4225 static PyObject *__pyx_n_s_convert_to_units;
4226 static PyObject *__pyx_n_s_copy;
4227 static PyObject *__pyx_n_s_count_boundary;
4228 static PyObject *__pyx_n_s_count_oct_cells;
4229 static PyObject *__pyx_n_s_count_octs;
4230 static PyObject *__pyx_n_s_curdom;
4231 static PyObject *__pyx_n_s_curlevel;
4232 static PyObject *__pyx_n_s_dest;
4233 static PyObject *__pyx_n_s_dest_fields;
4234 static PyObject *__pyx_n_s_dict;
4235 static PyObject *__pyx_n_s_dims;
4236 static PyObject *__pyx_n_s_domain;
4237 static PyObject *__pyx_n_s_domain_counts;
4238 static PyObject *__pyx_n_s_domain_dimensions;
4239 static PyObject *__pyx_n_s_domain_id;
4240 static PyObject *__pyx_n_s_domain_ind;
4241 static PyObject *__pyx_n_s_domain_left_edge;
4242 static PyObject *__pyx_n_s_domain_right_edge;
4243 static PyObject *__pyx_n_s_domains;
4244 static PyObject *__pyx_n_s_dtype;
4245 static PyObject *__pyx_n_s_dtype_is_object;
4246 static PyObject *__pyx_n_s_empty;
4247 static PyObject *__pyx_n_s_encode;
4248 static PyObject *__pyx_n_s_end;
4249 static PyObject *__pyx_n_s_enumerate;
4250 static PyObject *__pyx_n_s_error;
4251 static PyObject *__pyx_n_s_file;
4252 static PyObject *__pyx_n_s_file_ind;
4253 static PyObject *__pyx_n_s_file_inds;
4254 static PyObject *__pyx_n_s_flags;
4255 static PyObject *__pyx_n_s_float64;
4256 static PyObject *__pyx_n_s_format;
4257 static PyObject *__pyx_n_s_fortran;
4258 static PyObject *__pyx_n_u_fortran;
4259 static PyObject *__pyx_n_s_full;
4260 static PyObject *__pyx_n_s_getstate;
4261 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
4262 static PyObject *__pyx_n_s_id;
4263 static PyObject *__pyx_n_s_import;
4264 static PyObject *__pyx_n_s_init;
4265 static PyObject *__pyx_n_s_initialize_root_mesh;
4266 static PyObject *__pyx_n_s_int32;
4267 static PyObject *__pyx_n_s_int64;
4268 static PyObject *__pyx_n_s_itemsize;
4269 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4270 static PyObject *__pyx_n_s_join;
4271 static PyObject *__pyx_n_s_left_edge;
4272 static PyObject *__pyx_n_s_level;
4273 static PyObject *__pyx_n_s_levels;
4274 static PyObject *__pyx_n_s_load_octree;
4275 static PyObject *__pyx_n_s_main;
4276 static PyObject *__pyx_n_s_memview;
4277 static PyObject *__pyx_n_s_mode;
4278 static PyObject *__pyx_n_s_n_ghost_zones;
4279 static PyObject *__pyx_n_s_name;
4280 static PyObject *__pyx_n_s_name_2;
4281 static PyObject *__pyx_n_s_nan;
4282 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
4283 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
4284 static PyObject *__pyx_n_s_ndim;
4285 static PyObject *__pyx_n_s_new;
4286 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4287 static PyObject *__pyx_n_s_np;
4288 static PyObject *__pyx_n_s_num_cells;
4289 static PyObject *__pyx_n_s_num_octs;
4290 static PyObject *__pyx_n_s_numpy;
4291 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
4292 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
4293 static PyObject *__pyx_n_s_o;
4294 static PyObject *__pyx_n_s_obj;
4295 static PyObject *__pyx_n_s_oct_domain_dimensions;
4296 static PyObject *__pyx_n_s_octree;
4297 static PyObject *__pyx_n_s_offset;
4298 static PyObject *__pyx_n_s_ones;
4299 static PyObject *__pyx_n_s_order;
4300 static PyObject *__pyx_n_s_over_refine;
4301 static PyObject *__pyx_n_s_pack;
4302 static PyObject *__pyx_n_s_padding;
4303 static PyObject *__pyx_n_s_partial_coverage;
4304 static PyObject *__pyx_n_s_pickle;
4305 static PyObject *__pyx_n_s_pos;
4306 static PyObject *__pyx_n_s_print;
4307 static PyObject *__pyx_n_s_pyx_PickleError;
4308 static PyObject *__pyx_n_s_pyx_capi;
4309 static PyObject *__pyx_n_s_pyx_checksum;
4310 static PyObject *__pyx_n_s_pyx_getbuffer;
4311 static PyObject *__pyx_n_s_pyx_result;
4312 static PyObject *__pyx_n_s_pyx_state;
4313 static PyObject *__pyx_n_s_pyx_type;
4314 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
4315 static PyObject *__pyx_n_s_pyx_vtable;
4316 static PyObject *__pyx_n_s_r;
4317 static PyObject *__pyx_n_s_range;
4318 static PyObject *__pyx_n_s_reduce;
4319 static PyObject *__pyx_n_s_reduce_cython;
4320 static PyObject *__pyx_n_s_reduce_ex;
4321 static PyObject *__pyx_n_s_reshape;
4322 static PyObject *__pyx_n_s_right_edge;
4323 static PyObject *__pyx_n_s_root_nodes;
4324 static PyObject *__pyx_kp_u_s;
4325 static PyObject *__pyx_n_s_selector;
4326 static PyObject *__pyx_kp_s_self_root_mesh_cannot_be_convert;
4327 static PyObject *__pyx_kp_s_self_root_mesh_self_root_nodes_s;
4328 static PyObject *__pyx_n_s_setstate;
4329 static PyObject *__pyx_n_s_setstate_cython;
4330 static PyObject *__pyx_n_s_shape;
4331 static PyObject *__pyx_n_s_size;
4332 static PyObject *__pyx_n_s_skip_boundary;
4333 static PyObject *__pyx_n_s_source;
4334 static PyObject *__pyx_n_s_source_fields;
4335 static PyObject *__pyx_n_s_start;
4336 static PyObject *__pyx_n_s_step;
4337 static PyObject *__pyx_n_s_stop;
4338 static PyObject *__pyx_kp_s_strided_and_direct;
4339 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4340 static PyObject *__pyx_kp_s_strided_and_indirect;
4341 static PyObject *__pyx_kp_s_stringsource;
4342 static PyObject *__pyx_n_s_struct;
4343 static PyObject *__pyx_n_s_test;
4344 static PyObject *__pyx_n_s_to_arrays;
4345 static PyObject *__pyx_n_s_uint64;
4346 static PyObject *__pyx_n_s_uint8;
4347 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4348 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4349 static PyObject *__pyx_n_s_units;
4350 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
4351 static PyObject *__pyx_n_s_unpack;
4352 static PyObject *__pyx_n_s_update;
4353 static PyObject *__pyx_n_s_zeros;
4354 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine); /* proto */
4355 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_2_initialize_root_mesh(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4356 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4357 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_4load_octree(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_header); /* proto */
4358 static void __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_6__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4359 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions); /* proto */
4360 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */
4361 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */
4362 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */
4363 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */
4364 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */
4365 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id); /* proto */
4366 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4367 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id); /* proto */
4368 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id); /* proto */
4369 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary); /* proto */
4370 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts); /* proto */
4371 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells); /* proto */
4372 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34morton_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells); /* proto */
4373 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */
4374 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset); /* proto */
4375 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */
4376 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_num_octs, int __pyx_v_domain_id, int __pyx_v_n_ghost_zones); /* proto */
4377 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, __Pyx_memviewslice __pyx_v_levels, __Pyx_memviewslice __pyx_v_cell_inds, __Pyx_memviewslice __pyx_v_file_inds, __Pyx_memviewslice __pyx_v_domains, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int32_t __pyx_v_domain, __pyx_t_5numpy_int64_t __pyx_v_offset); /* proto */
4378 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, int __pyx_v_num_cells, int __pyx_v_n_ghost_zones); /* proto */
4379 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_48finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4380 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4381 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4382 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4383 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4384 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4385 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4386 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4387 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4388 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4389 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4390 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_50__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self); /* proto */
4391 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_52__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4392 static int __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_over_refine); /* proto */
4393 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_2load_octree(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_header); /* proto */
4394 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_4save_octree(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */
4395 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_6allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts, int __pyx_v_root_nodes); /* proto */
4396 static void __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_8__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */
4397 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self); /* proto */
4398 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4399 static int __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine); /* proto */
4400 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self); /* proto */
4401 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4402 static int __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self); /* proto */
4403 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto */
4404 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self); /* proto */
4405 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4406 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4407 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
4408 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
4409 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4410 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4411 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4412 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4413 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4414 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4415 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
4416 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4417 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4418 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4419 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4420 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4421 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4422 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
4423 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4424 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4425 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
4426 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4427 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4428 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4429 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4430 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4431 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4432 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4433 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4434 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4435 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4436 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4437 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4438 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4439 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4440 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4441 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4442 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4443 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4444 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4445 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4446 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4447 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4448 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4449 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
4450 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4451 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4452 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4453 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_RAMSESOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4454 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_ARTOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4455 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4456 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4457 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4458 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4459 static PyObject *__pyx_int_0;
4460 static PyObject *__pyx_int_1;
4461 static PyObject *__pyx_int_2;
4462 static PyObject *__pyx_int_3;
4463 static PyObject *__pyx_int_8;
4464 static PyObject *__pyx_int_255;
4465 static PyObject *__pyx_int_184977713;
4466 static PyObject *__pyx_int_neg_1;
4467 static struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_k__5;
4468 static PyObject *__pyx_tuple_;
4469 static PyObject *__pyx_slice__2;
4470 static PyObject *__pyx_tuple__3;
4471 static PyObject *__pyx_tuple__4;
4472 static PyObject *__pyx_tuple__6;
4473 static PyObject *__pyx_tuple__7;
4474 static PyObject *__pyx_tuple__8;
4475 static PyObject *__pyx_tuple__9;
4476 static PyObject *__pyx_tuple__10;
4477 static PyObject *__pyx_tuple__11;
4478 static PyObject *__pyx_tuple__12;
4479 static PyObject *__pyx_tuple__13;
4480 static PyObject *__pyx_tuple__14;
4481 static PyObject *__pyx_tuple__15;
4482 static PyObject *__pyx_tuple__16;
4483 static PyObject *__pyx_tuple__17;
4484 static PyObject *__pyx_tuple__18;
4485 static PyObject *__pyx_tuple__19;
4486 static PyObject *__pyx_tuple__20;
4487 static PyObject *__pyx_tuple__21;
4488 static PyObject *__pyx_tuple__22;
4489 static PyObject *__pyx_tuple__23;
4490 static PyObject *__pyx_tuple__24;
4491 static PyObject *__pyx_tuple__25;
4492 static PyObject *__pyx_tuple__26;
4493 static PyObject *__pyx_tuple__27;
4494 static PyObject *__pyx_tuple__28;
4495 static PyObject *__pyx_tuple__29;
4496 static PyObject *__pyx_tuple__30;
4497 static PyObject *__pyx_tuple__31;
4498 static PyObject *__pyx_tuple__32;
4499 static PyObject *__pyx_tuple__33;
4500 static PyObject *__pyx_tuple__34;
4501 static PyObject *__pyx_tuple__35;
4502 static PyObject *__pyx_tuple__36;
4503 static PyObject *__pyx_tuple__37;
4504 static PyObject *__pyx_tuple__38;
4505 static PyObject *__pyx_tuple__39;
4506 static PyObject *__pyx_tuple__40;
4507 static PyObject *__pyx_tuple__41;
4508 static PyObject *__pyx_tuple__47;
4509 static PyObject *__pyx_tuple__48;
4510 static PyObject *__pyx_tuple__49;
4511 static PyObject *__pyx_tuple__50;
4512 static PyObject *__pyx_tuple__51;
4513 static PyObject *__pyx_tuple__52;
4514 static PyObject *__pyx_codeobj__53;
4515 /* Late includes */
4516 
4517 /* "yt/geometry/oct_container.pyx":48
4518  * cdef class OctreeContainer:
4519  *
4520  *     def __init__(self, oct_domain_dimensions, domain_left_edge,             # <<<<<<<<<<<<<<
4521  *                  domain_right_edge, partial_coverage = 0,
4522  *                  over_refine = 1):
4523  */
4524 
4525 /* Python wrapper */
4526 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4527 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4528   PyObject *__pyx_v_oct_domain_dimensions = 0;
4529   PyObject *__pyx_v_domain_left_edge = 0;
4530   PyObject *__pyx_v_domain_right_edge = 0;
4531   PyObject *__pyx_v_partial_coverage = 0;
4532   PyObject *__pyx_v_over_refine = 0;
4533   int __pyx_r;
4534   __Pyx_RefNannyDeclarations
4535   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4536   {
4537     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oct_domain_dimensions,&__pyx_n_s_domain_left_edge,&__pyx_n_s_domain_right_edge,&__pyx_n_s_partial_coverage,&__pyx_n_s_over_refine,0};
4538     PyObject* values[5] = {0,0,0,0,0};
4539     values[3] = ((PyObject *)__pyx_int_0);
4540     values[4] = ((PyObject *)__pyx_int_1);
4541     if (unlikely(__pyx_kwds)) {
4542       Py_ssize_t kw_args;
4543       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4544       switch (pos_args) {
4545         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4546         CYTHON_FALLTHROUGH;
4547         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4548         CYTHON_FALLTHROUGH;
4549         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4550         CYTHON_FALLTHROUGH;
4551         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4552         CYTHON_FALLTHROUGH;
4553         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4554         CYTHON_FALLTHROUGH;
4555         case  0: break;
4556         default: goto __pyx_L5_argtuple_error;
4557       }
4558       kw_args = PyDict_Size(__pyx_kwds);
4559       switch (pos_args) {
4560         case  0:
4561         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oct_domain_dimensions)) != 0)) kw_args--;
4562         else goto __pyx_L5_argtuple_error;
4563         CYTHON_FALLTHROUGH;
4564         case  1:
4565         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--;
4566         else {
4567           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 48, __pyx_L3_error)
4568         }
4569         CYTHON_FALLTHROUGH;
4570         case  2:
4571         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--;
4572         else {
4573           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 48, __pyx_L3_error)
4574         }
4575         CYTHON_FALLTHROUGH;
4576         case  3:
4577         if (kw_args > 0) {
4578           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_partial_coverage);
4579           if (value) { values[3] = value; kw_args--; }
4580         }
4581         CYTHON_FALLTHROUGH;
4582         case  4:
4583         if (kw_args > 0) {
4584           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_over_refine);
4585           if (value) { values[4] = value; kw_args--; }
4586         }
4587       }
4588       if (unlikely(kw_args > 0)) {
4589         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
4590       }
4591     } else {
4592       switch (PyTuple_GET_SIZE(__pyx_args)) {
4593         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4594         CYTHON_FALLTHROUGH;
4595         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4596         CYTHON_FALLTHROUGH;
4597         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4598         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4599         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4600         break;
4601         default: goto __pyx_L5_argtuple_error;
4602       }
4603     }
4604     __pyx_v_oct_domain_dimensions = values[0];
4605     __pyx_v_domain_left_edge = values[1];
4606     __pyx_v_domain_right_edge = values[2];
4607     __pyx_v_partial_coverage = values[3];
4608     __pyx_v_over_refine = values[4];
4609   }
4610   goto __pyx_L4_argument_unpacking_done;
4611   __pyx_L5_argtuple_error:;
4612   __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)
4613   __pyx_L3_error:;
4614   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4615   __Pyx_RefNannyFinishContext();
4616   return -1;
4617   __pyx_L4_argument_unpacking_done:;
4618   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer___init__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine);
4619 
4620   /* function exit code */
4621   __Pyx_RefNannyFinishContext();
4622   return __pyx_r;
4623 }
4624 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_oct_domain_dimensions,PyObject * __pyx_v_domain_left_edge,PyObject * __pyx_v_domain_right_edge,PyObject * __pyx_v_partial_coverage,PyObject * __pyx_v_over_refine)4625 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine) {
4626   int __pyx_v_i;
4627   CYTHON_UNUSED int __pyx_v_p;
4628   int __pyx_r;
4629   __Pyx_RefNannyDeclarations
4630   __pyx_t_5numpy_uint8_t __pyx_t_1;
4631   int __pyx_t_2;
4632   PyObject *__pyx_t_3 = NULL;
4633   int __pyx_t_4;
4634   __pyx_t_5numpy_float64_t __pyx_t_5;
4635   PyObject *__pyx_t_6 = NULL;
4636   PyObject *__pyx_t_7 = NULL;
4637   __Pyx_RefNannySetupContext("__init__", 0);
4638 
4639   /* "yt/geometry/oct_container.pyx":52
4640  *                  over_refine = 1):
4641  *         # This will just initialize the root mesh octs
4642  *         self.oref = over_refine             # <<<<<<<<<<<<<<
4643  *         self.partial_coverage = partial_coverage
4644  *         cdef int i, j, k, p
4645  */
4646   __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
4647   __pyx_v_self->oref = __pyx_t_1;
4648 
4649   /* "yt/geometry/oct_container.pyx":53
4650  *         # This will just initialize the root mesh octs
4651  *         self.oref = over_refine
4652  *         self.partial_coverage = partial_coverage             # <<<<<<<<<<<<<<
4653  *         cdef int i, j, k, p
4654  *         for i in range(3):
4655  */
4656   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_partial_coverage); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
4657   __pyx_v_self->partial_coverage = __pyx_t_2;
4658 
4659   /* "yt/geometry/oct_container.pyx":55
4660  *         self.partial_coverage = partial_coverage
4661  *         cdef int i, j, k, p
4662  *         for i in range(3):             # <<<<<<<<<<<<<<
4663  *             self.nn[i] = oct_domain_dimensions[i]
4664  *         self.num_domains = 0
4665  */
4666   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
4667     __pyx_v_i = __pyx_t_2;
4668 
4669     /* "yt/geometry/oct_container.pyx":56
4670  *         cdef int i, j, k, p
4671  *         for i in range(3):
4672  *             self.nn[i] = oct_domain_dimensions[i]             # <<<<<<<<<<<<<<
4673  *         self.num_domains = 0
4674  *         self.level_offset = 0
4675  */
4676     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oct_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4677     __Pyx_GOTREF(__pyx_t_3);
4678     __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
4679     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4680     (__pyx_v_self->nn[__pyx_v_i]) = __pyx_t_4;
4681   }
4682 
4683   /* "yt/geometry/oct_container.pyx":57
4684  *         for i in range(3):
4685  *             self.nn[i] = oct_domain_dimensions[i]
4686  *         self.num_domains = 0             # <<<<<<<<<<<<<<
4687  *         self.level_offset = 0
4688  *         self.domains = OctObjectPool()
4689  */
4690   __pyx_v_self->num_domains = 0;
4691 
4692   /* "yt/geometry/oct_container.pyx":58
4693  *             self.nn[i] = oct_domain_dimensions[i]
4694  *         self.num_domains = 0
4695  *         self.level_offset = 0             # <<<<<<<<<<<<<<
4696  *         self.domains = OctObjectPool()
4697  *         p = 0
4698  */
4699   __pyx_v_self->level_offset = 0;
4700 
4701   /* "yt/geometry/oct_container.pyx":59
4702  *         self.num_domains = 0
4703  *         self.level_offset = 0
4704  *         self.domains = OctObjectPool()             # <<<<<<<<<<<<<<
4705  *         p = 0
4706  *         self.nocts = 0 # Increment when initialized
4707  */
4708   __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
4709   __Pyx_GOTREF(__pyx_t_3);
4710   __Pyx_GIVEREF(__pyx_t_3);
4711   __Pyx_GOTREF(__pyx_v_self->domains);
4712   __Pyx_DECREF(((PyObject *)__pyx_v_self->domains));
4713   __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_3);
4714   __pyx_t_3 = 0;
4715 
4716   /* "yt/geometry/oct_container.pyx":60
4717  *         self.level_offset = 0
4718  *         self.domains = OctObjectPool()
4719  *         p = 0             # <<<<<<<<<<<<<<
4720  *         self.nocts = 0 # Increment when initialized
4721  *         for i in range(3):
4722  */
4723   __pyx_v_p = 0;
4724 
4725   /* "yt/geometry/oct_container.pyx":61
4726  *         self.domains = OctObjectPool()
4727  *         p = 0
4728  *         self.nocts = 0 # Increment when initialized             # <<<<<<<<<<<<<<
4729  *         for i in range(3):
4730  *             self.DLE[i] = domain_left_edge[i] #0
4731  */
4732   __pyx_v_self->nocts = 0;
4733 
4734   /* "yt/geometry/oct_container.pyx":62
4735  *         p = 0
4736  *         self.nocts = 0 # Increment when initialized
4737  *         for i in range(3):             # <<<<<<<<<<<<<<
4738  *             self.DLE[i] = domain_left_edge[i] #0
4739  *             self.DRE[i] = domain_right_edge[i] #num_grid
4740  */
4741   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
4742     __pyx_v_i = __pyx_t_2;
4743 
4744     /* "yt/geometry/oct_container.pyx":63
4745  *         self.nocts = 0 # Increment when initialized
4746  *         for i in range(3):
4747  *             self.DLE[i] = domain_left_edge[i] #0             # <<<<<<<<<<<<<<
4748  *             self.DRE[i] = domain_right_edge[i] #num_grid
4749  *         self._initialize_root_mesh()
4750  */
4751     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
4752     __Pyx_GOTREF(__pyx_t_3);
4753     __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
4754     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4755     (__pyx_v_self->DLE[__pyx_v_i]) = __pyx_t_5;
4756 
4757     /* "yt/geometry/oct_container.pyx":64
4758  *         for i in range(3):
4759  *             self.DLE[i] = domain_left_edge[i] #0
4760  *             self.DRE[i] = domain_right_edge[i] #num_grid             # <<<<<<<<<<<<<<
4761  *         self._initialize_root_mesh()
4762  *         self.fill_style = "o"
4763  */
4764     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
4765     __Pyx_GOTREF(__pyx_t_3);
4766     __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
4767     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4768     (__pyx_v_self->DRE[__pyx_v_i]) = __pyx_t_5;
4769   }
4770 
4771   /* "yt/geometry/oct_container.pyx":65
4772  *             self.DLE[i] = domain_left_edge[i] #0
4773  *             self.DRE[i] = domain_right_edge[i] #num_grid
4774  *         self._initialize_root_mesh()             # <<<<<<<<<<<<<<
4775  *         self.fill_style = "o"
4776  *
4777  */
4778   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initialize_root_mesh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error)
4779   __Pyx_GOTREF(__pyx_t_6);
4780   __pyx_t_7 = NULL;
4781   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4782     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
4783     if (likely(__pyx_t_7)) {
4784       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4785       __Pyx_INCREF(__pyx_t_7);
4786       __Pyx_INCREF(function);
4787       __Pyx_DECREF_SET(__pyx_t_6, function);
4788     }
4789   }
4790   __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
4791   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4792   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
4793   __Pyx_GOTREF(__pyx_t_3);
4794   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4795   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4796 
4797   /* "yt/geometry/oct_container.pyx":66
4798  *             self.DRE[i] = domain_right_edge[i] #num_grid
4799  *         self._initialize_root_mesh()
4800  *         self.fill_style = "o"             # <<<<<<<<<<<<<<
4801  *
4802  *     def _initialize_root_mesh(self):
4803  */
4804   __Pyx_INCREF(__pyx_n_s_o);
4805   __Pyx_GIVEREF(__pyx_n_s_o);
4806   __Pyx_GOTREF(__pyx_v_self->fill_style);
4807   __Pyx_DECREF(__pyx_v_self->fill_style);
4808   __pyx_v_self->fill_style = __pyx_n_s_o;
4809 
4810   /* "yt/geometry/oct_container.pyx":48
4811  * cdef class OctreeContainer:
4812  *
4813  *     def __init__(self, oct_domain_dimensions, domain_left_edge,             # <<<<<<<<<<<<<<
4814  *                  domain_right_edge, partial_coverage = 0,
4815  *                  over_refine = 1):
4816  */
4817 
4818   /* function exit code */
4819   __pyx_r = 0;
4820   goto __pyx_L0;
4821   __pyx_L1_error:;
4822   __Pyx_XDECREF(__pyx_t_3);
4823   __Pyx_XDECREF(__pyx_t_6);
4824   __Pyx_XDECREF(__pyx_t_7);
4825   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4826   __pyx_r = -1;
4827   __pyx_L0:;
4828   __Pyx_RefNannyFinishContext();
4829   return __pyx_r;
4830 }
4831 
4832 /* "yt/geometry/oct_container.pyx":68
4833  *         self.fill_style = "o"
4834  *
4835  *     def _initialize_root_mesh(self):             # <<<<<<<<<<<<<<
4836  *         self.root_mesh = <Oct****> malloc(sizeof(void*) * self.nn[0])
4837  *         for i in range(self.nn[0]):
4838  */
4839 
4840 /* Python wrapper */
4841 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_3_initialize_root_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_3_initialize_root_mesh(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4842 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_3_initialize_root_mesh(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4843   PyObject *__pyx_r = 0;
4844   __Pyx_RefNannyDeclarations
4845   __Pyx_RefNannySetupContext("_initialize_root_mesh (wrapper)", 0);
4846   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_2_initialize_root_mesh(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
4847 
4848   /* function exit code */
4849   __Pyx_RefNannyFinishContext();
4850   return __pyx_r;
4851 }
4852 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_2_initialize_root_mesh(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)4853 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_2_initialize_root_mesh(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
4854   int __pyx_v_i;
4855   int __pyx_v_j;
4856   int __pyx_v_k;
4857   PyObject *__pyx_r = NULL;
4858   __Pyx_RefNannyDeclarations
4859   int __pyx_t_1;
4860   int __pyx_t_2;
4861   int __pyx_t_3;
4862   int __pyx_t_4;
4863   int __pyx_t_5;
4864   int __pyx_t_6;
4865   int __pyx_t_7;
4866   int __pyx_t_8;
4867   int __pyx_t_9;
4868   __Pyx_RefNannySetupContext("_initialize_root_mesh", 0);
4869 
4870   /* "yt/geometry/oct_container.pyx":69
4871  *
4872  *     def _initialize_root_mesh(self):
4873  *         self.root_mesh = <Oct****> malloc(sizeof(void*) * self.nn[0])             # <<<<<<<<<<<<<<
4874  *         for i in range(self.nn[0]):
4875  *             self.root_mesh[i] = <Oct ***> malloc(sizeof(void*) * self.nn[1])
4876  */
4877   __pyx_v_self->root_mesh = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****)malloc(((sizeof(void *)) * (__pyx_v_self->nn[0]))));
4878 
4879   /* "yt/geometry/oct_container.pyx":70
4880  *     def _initialize_root_mesh(self):
4881  *         self.root_mesh = <Oct****> malloc(sizeof(void*) * self.nn[0])
4882  *         for i in range(self.nn[0]):             # <<<<<<<<<<<<<<
4883  *             self.root_mesh[i] = <Oct ***> malloc(sizeof(void*) * self.nn[1])
4884  *             for j in range(self.nn[1]):
4885  */
4886   __pyx_t_1 = (__pyx_v_self->nn[0]);
4887   __pyx_t_2 = __pyx_t_1;
4888   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4889     __pyx_v_i = __pyx_t_3;
4890 
4891     /* "yt/geometry/oct_container.pyx":71
4892  *         self.root_mesh = <Oct****> malloc(sizeof(void*) * self.nn[0])
4893  *         for i in range(self.nn[0]):
4894  *             self.root_mesh[i] = <Oct ***> malloc(sizeof(void*) * self.nn[1])             # <<<<<<<<<<<<<<
4895  *             for j in range(self.nn[1]):
4896  *                 self.root_mesh[i][j] = <Oct **> malloc(sizeof(void*) * self.nn[2])
4897  */
4898     (__pyx_v_self->root_mesh[__pyx_v_i]) = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ***)malloc(((sizeof(void *)) * (__pyx_v_self->nn[1]))));
4899 
4900     /* "yt/geometry/oct_container.pyx":72
4901  *         for i in range(self.nn[0]):
4902  *             self.root_mesh[i] = <Oct ***> malloc(sizeof(void*) * self.nn[1])
4903  *             for j in range(self.nn[1]):             # <<<<<<<<<<<<<<
4904  *                 self.root_mesh[i][j] = <Oct **> malloc(sizeof(void*) * self.nn[2])
4905  *                 for k in range(self.nn[2]):
4906  */
4907     __pyx_t_4 = (__pyx_v_self->nn[1]);
4908     __pyx_t_5 = __pyx_t_4;
4909     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4910       __pyx_v_j = __pyx_t_6;
4911 
4912       /* "yt/geometry/oct_container.pyx":73
4913  *             self.root_mesh[i] = <Oct ***> malloc(sizeof(void*) * self.nn[1])
4914  *             for j in range(self.nn[1]):
4915  *                 self.root_mesh[i][j] = <Oct **> malloc(sizeof(void*) * self.nn[2])             # <<<<<<<<<<<<<<
4916  *                 for k in range(self.nn[2]):
4917  *                     self.root_mesh[i][j][k] = NULL
4918  */
4919       ((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j]) = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(void *)) * (__pyx_v_self->nn[2]))));
4920 
4921       /* "yt/geometry/oct_container.pyx":74
4922  *             for j in range(self.nn[1]):
4923  *                 self.root_mesh[i][j] = <Oct **> malloc(sizeof(void*) * self.nn[2])
4924  *                 for k in range(self.nn[2]):             # <<<<<<<<<<<<<<
4925  *                     self.root_mesh[i][j][k] = NULL
4926  *
4927  */
4928       __pyx_t_7 = (__pyx_v_self->nn[2]);
4929       __pyx_t_8 = __pyx_t_7;
4930       for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4931         __pyx_v_k = __pyx_t_9;
4932 
4933         /* "yt/geometry/oct_container.pyx":75
4934  *                 self.root_mesh[i][j] = <Oct **> malloc(sizeof(void*) * self.nn[2])
4935  *                 for k in range(self.nn[2]):
4936  *                     self.root_mesh[i][j][k] = NULL             # <<<<<<<<<<<<<<
4937  *
4938  *     @property
4939  */
4940         (((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = NULL;
4941       }
4942     }
4943   }
4944 
4945   /* "yt/geometry/oct_container.pyx":68
4946  *         self.fill_style = "o"
4947  *
4948  *     def _initialize_root_mesh(self):             # <<<<<<<<<<<<<<
4949  *         self.root_mesh = <Oct****> malloc(sizeof(void*) * self.nn[0])
4950  *         for i in range(self.nn[0]):
4951  */
4952 
4953   /* function exit code */
4954   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4955   __Pyx_XGIVEREF(__pyx_r);
4956   __Pyx_RefNannyFinishContext();
4957   return __pyx_r;
4958 }
4959 
4960 /* "yt/geometry/oct_container.pyx":78
4961  *
4962  *     @property
4963  *     def oct_arrays(self):             # <<<<<<<<<<<<<<
4964  *         return self.domains.to_arrays()
4965  *
4966  */
4967 
4968 /* Python wrapper */
4969 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays_1__get__(PyObject * __pyx_v_self)4970 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays_1__get__(PyObject *__pyx_v_self) {
4971   PyObject *__pyx_r = 0;
4972   __Pyx_RefNannyDeclarations
4973   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4974   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
4975 
4976   /* function exit code */
4977   __Pyx_RefNannyFinishContext();
4978   return __pyx_r;
4979 }
4980 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)4981 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
4982   PyObject *__pyx_r = NULL;
4983   __Pyx_RefNannyDeclarations
4984   PyObject *__pyx_t_1 = NULL;
4985   PyObject *__pyx_t_2 = NULL;
4986   PyObject *__pyx_t_3 = NULL;
4987   __Pyx_RefNannySetupContext("__get__", 0);
4988 
4989   /* "yt/geometry/oct_container.pyx":79
4990  *     @property
4991  *     def oct_arrays(self):
4992  *         return self.domains.to_arrays()             # <<<<<<<<<<<<<<
4993  *
4994  *     @classmethod
4995  */
4996   __Pyx_XDECREF(__pyx_r);
4997   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->domains), __pyx_n_s_to_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
4998   __Pyx_GOTREF(__pyx_t_2);
4999   __pyx_t_3 = NULL;
5000   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5001     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5002     if (likely(__pyx_t_3)) {
5003       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5004       __Pyx_INCREF(__pyx_t_3);
5005       __Pyx_INCREF(function);
5006       __Pyx_DECREF_SET(__pyx_t_2, function);
5007     }
5008   }
5009   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
5010   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5011   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
5012   __Pyx_GOTREF(__pyx_t_1);
5013   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5014   __pyx_r = __pyx_t_1;
5015   __pyx_t_1 = 0;
5016   goto __pyx_L0;
5017 
5018   /* "yt/geometry/oct_container.pyx":78
5019  *
5020  *     @property
5021  *     def oct_arrays(self):             # <<<<<<<<<<<<<<
5022  *         return self.domains.to_arrays()
5023  *
5024  */
5025 
5026   /* function exit code */
5027   __pyx_L1_error:;
5028   __Pyx_XDECREF(__pyx_t_1);
5029   __Pyx_XDECREF(__pyx_t_2);
5030   __Pyx_XDECREF(__pyx_t_3);
5031   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.oct_arrays.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5032   __pyx_r = NULL;
5033   __pyx_L0:;
5034   __Pyx_XGIVEREF(__pyx_r);
5035   __Pyx_RefNannyFinishContext();
5036   return __pyx_r;
5037 }
5038 
5039 /* "yt/geometry/oct_container.pyx":82
5040  *
5041  *     @classmethod
5042  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
5043  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5044  *         ref_mask = header['octree']
5045  */
5046 
5047 /* Python wrapper */
5048 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5load_octree(PyObject *__pyx_v_cls, PyObject *__pyx_v_header); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5load_octree(PyObject * __pyx_v_cls,PyObject * __pyx_v_header)5049 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5load_octree(PyObject *__pyx_v_cls, PyObject *__pyx_v_header) {
5050   PyObject *__pyx_r = 0;
5051   __Pyx_RefNannyDeclarations
5052   __Pyx_RefNannySetupContext("load_octree (wrapper)", 0);
5053   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_4load_octree(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_header));
5054 
5055   /* function exit code */
5056   __Pyx_RefNannyFinishContext();
5057   return __pyx_r;
5058 }
5059 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_4load_octree(PyTypeObject * __pyx_v_cls,PyObject * __pyx_v_header)5060 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_4load_octree(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_header) {
5061   PyArrayObject *__pyx_v_ref_mask = 0;
5062   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_obj = 0;
5063   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
5064   struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_v_visitor = 0;
5065   int __pyx_v_i;
5066   int __pyx_v_j;
5067   int __pyx_v_k;
5068   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
5069   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
5070   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cur;
5071   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o;
5072   __pyx_t_5numpy_uint64_t __pyx_v_nfinest;
5073   __Pyx_LocalBuf_ND __pyx_pybuffernd_ref_mask;
5074   __Pyx_Buffer __pyx_pybuffer_ref_mask;
5075   PyObject *__pyx_r = NULL;
5076   __Pyx_RefNannyDeclarations
5077   PyObject *__pyx_t_1 = NULL;
5078   PyArrayObject *__pyx_t_2 = NULL;
5079   int __pyx_t_3;
5080   PyObject *__pyx_t_4 = NULL;
5081   PyObject *__pyx_t_5 = NULL;
5082   PyObject *__pyx_t_6 = NULL;
5083   PyObject *__pyx_t_7 = NULL;
5084   PyObject *__pyx_t_8 = NULL;
5085   PyObject *__pyx_t_9 = NULL;
5086   __pyx_t_5numpy_float64_t __pyx_t_10;
5087   __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
5088   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_12;
5089   int __pyx_t_13;
5090   int __pyx_t_14;
5091   int __pyx_t_15;
5092   int __pyx_t_16;
5093   int __pyx_t_17;
5094   int __pyx_t_18;
5095   int __pyx_t_19;
5096   int __pyx_t_20;
5097   int __pyx_t_21;
5098   struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs __pyx_t_22;
5099   long __pyx_t_23;
5100   __pyx_t_5numpy_uint64_t __pyx_t_24;
5101   PyObject *__pyx_t_25 = NULL;
5102   PyObject *__pyx_t_26 = NULL;
5103   __Pyx_RefNannySetupContext("load_octree", 0);
5104   __pyx_pybuffer_ref_mask.pybuffer.buf = NULL;
5105   __pyx_pybuffer_ref_mask.refcount = 0;
5106   __pyx_pybuffernd_ref_mask.data = NULL;
5107   __pyx_pybuffernd_ref_mask.rcbuffer = &__pyx_pybuffer_ref_mask;
5108 
5109   /* "yt/geometry/oct_container.pyx":84
5110  *     def load_octree(cls, header):
5111  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5112  *         ref_mask = header['octree']             # <<<<<<<<<<<<<<
5113  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],
5114  *                 header['right_edge'], over_refine = header['over_refine'],
5115  */
5116   __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_octree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
5117   __Pyx_GOTREF(__pyx_t_1);
5118   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 84, __pyx_L1_error)
5119   __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
5120   {
5121     __Pyx_BufFmt_StackElem __pyx_stack[1];
5122     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
5123     __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
5124     if (unlikely(__pyx_t_3 < 0)) {
5125       PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
5126       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_ref_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
5127         Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
5128         __Pyx_RaiseBufferFallbackError();
5129       } else {
5130         PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
5131       }
5132       __pyx_t_4 = __pyx_t_5 = __pyx_t_6 = 0;
5133     }
5134     __pyx_pybuffernd_ref_mask.diminfo[0].strides = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ref_mask.diminfo[0].shape = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.shape[0];
5135     if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
5136   }
5137   __pyx_t_2 = 0;
5138   __pyx_v_ref_mask = ((PyArrayObject *)__pyx_t_1);
5139   __pyx_t_1 = 0;
5140 
5141   /* "yt/geometry/oct_container.pyx":85
5142  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5143  *         ref_mask = header['octree']
5144  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],             # <<<<<<<<<<<<<<
5145  *                 header['right_edge'], over_refine = header['over_refine'],
5146  *                 partial_coverage = header['partial_coverage'])
5147  */
5148   __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
5149   __Pyx_GOTREF(__pyx_t_1);
5150   __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_left_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error)
5151   __Pyx_GOTREF(__pyx_t_7);
5152 
5153   /* "yt/geometry/oct_container.pyx":86
5154  *         ref_mask = header['octree']
5155  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],
5156  *                 header['right_edge'], over_refine = header['over_refine'],             # <<<<<<<<<<<<<<
5157  *                 partial_coverage = header['partial_coverage'])
5158  *         # NOTE: We do not allow domain/file indices to be specified.
5159  */
5160   __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_right_edge); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
5161   __Pyx_GOTREF(__pyx_t_8);
5162 
5163   /* "yt/geometry/oct_container.pyx":85
5164  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5165  *         ref_mask = header['octree']
5166  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],             # <<<<<<<<<<<<<<
5167  *                 header['right_edge'], over_refine = header['over_refine'],
5168  *                 partial_coverage = header['partial_coverage'])
5169  */
5170   __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 85, __pyx_L1_error)
5171   __Pyx_GOTREF(__pyx_t_9);
5172   __Pyx_GIVEREF(__pyx_t_1);
5173   PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
5174   __Pyx_GIVEREF(__pyx_t_7);
5175   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
5176   __Pyx_GIVEREF(__pyx_t_8);
5177   PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
5178   __pyx_t_1 = 0;
5179   __pyx_t_7 = 0;
5180   __pyx_t_8 = 0;
5181 
5182   /* "yt/geometry/oct_container.pyx":86
5183  *         ref_mask = header['octree']
5184  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],
5185  *                 header['right_edge'], over_refine = header['over_refine'],             # <<<<<<<<<<<<<<
5186  *                 partial_coverage = header['partial_coverage'])
5187  *         # NOTE: We do not allow domain/file indices to be specified.
5188  */
5189   __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 86, __pyx_L1_error)
5190   __Pyx_GOTREF(__pyx_t_8);
5191   __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_over_refine); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 86, __pyx_L1_error)
5192   __Pyx_GOTREF(__pyx_t_7);
5193   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_over_refine, __pyx_t_7) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
5194   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5195 
5196   /* "yt/geometry/oct_container.pyx":87
5197  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],
5198  *                 header['right_edge'], over_refine = header['over_refine'],
5199  *                 partial_coverage = header['partial_coverage'])             # <<<<<<<<<<<<<<
5200  *         # NOTE: We do not allow domain/file indices to be specified.
5201  *         cdef SelectorObject selector = AlwaysSelector(None)
5202  */
5203   __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_header, __pyx_n_s_partial_coverage); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error)
5204   __Pyx_GOTREF(__pyx_t_7);
5205   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_partial_coverage, __pyx_t_7) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
5206   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5207 
5208   /* "yt/geometry/oct_container.pyx":85
5209  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5210  *         ref_mask = header['octree']
5211  *         cdef OctreeContainer obj = cls(header['dims'], header['left_edge'],             # <<<<<<<<<<<<<<
5212  *                 header['right_edge'], over_refine = header['over_refine'],
5213  *                 partial_coverage = header['partial_coverage'])
5214  */
5215   __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error)
5216   __Pyx_GOTREF(__pyx_t_7);
5217   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5218   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5219   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer))))) __PYX_ERR(0, 85, __pyx_L1_error)
5220   __pyx_v_obj = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_t_7);
5221   __pyx_t_7 = 0;
5222 
5223   /* "yt/geometry/oct_container.pyx":89
5224  *                 partial_coverage = header['partial_coverage'])
5225  *         # NOTE: We do not allow domain/file indices to be specified.
5226  *         cdef SelectorObject selector = AlwaysSelector(None)             # <<<<<<<<<<<<<<
5227  *         cdef oct_visitors.LoadOctree visitor
5228  *         visitor = oct_visitors.LoadOctree(obj, -1)
5229  */
5230   __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
5231   __Pyx_GOTREF(__pyx_t_7);
5232   __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_7);
5233   __pyx_t_7 = 0;
5234 
5235   /* "yt/geometry/oct_container.pyx":91
5236  *         cdef SelectorObject selector = AlwaysSelector(None)
5237  *         cdef oct_visitors.LoadOctree visitor
5238  *         visitor = oct_visitors.LoadOctree(obj, -1)             # <<<<<<<<<<<<<<
5239  *         cdef int i, j, k, n
5240  *         visitor.global_index = -1
5241  */
5242   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
5243   __Pyx_GOTREF(__pyx_t_7);
5244   __Pyx_INCREF(((PyObject *)__pyx_v_obj));
5245   __Pyx_GIVEREF(((PyObject *)__pyx_v_obj));
5246   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_obj));
5247   __Pyx_INCREF(__pyx_int_neg_1);
5248   __Pyx_GIVEREF(__pyx_int_neg_1);
5249   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
5250   __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 91, __pyx_L1_error)
5251   __Pyx_GOTREF(__pyx_t_8);
5252   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5253   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree *)__pyx_t_8);
5254   __pyx_t_8 = 0;
5255 
5256   /* "yt/geometry/oct_container.pyx":93
5257  *         visitor = oct_visitors.LoadOctree(obj, -1)
5258  *         cdef int i, j, k, n
5259  *         visitor.global_index = -1             # <<<<<<<<<<<<<<
5260  *         visitor.level = 0
5261  *         visitor.oref = 0
5262  */
5263   __pyx_v_visitor->__pyx_base.global_index = -1LL;
5264 
5265   /* "yt/geometry/oct_container.pyx":94
5266  *         cdef int i, j, k, n
5267  *         visitor.global_index = -1
5268  *         visitor.level = 0             # <<<<<<<<<<<<<<
5269  *         visitor.oref = 0
5270  *         visitor.nz = 1
5271  */
5272   __pyx_v_visitor->__pyx_base.level = 0;
5273 
5274   /* "yt/geometry/oct_container.pyx":95
5275  *         visitor.global_index = -1
5276  *         visitor.level = 0
5277  *         visitor.oref = 0             # <<<<<<<<<<<<<<
5278  *         visitor.nz = 1
5279  *         assert(ref_mask.shape[0] / float(visitor.nz) ==
5280  */
5281   __pyx_v_visitor->__pyx_base.oref = 0;
5282 
5283   /* "yt/geometry/oct_container.pyx":96
5284  *         visitor.level = 0
5285  *         visitor.oref = 0
5286  *         visitor.nz = 1             # <<<<<<<<<<<<<<
5287  *         assert(ref_mask.shape[0] / float(visitor.nz) ==
5288  *             <int>(ref_mask.shape[0]/float(visitor.nz)))
5289  */
5290   __pyx_v_visitor->__pyx_base.nz = 1;
5291 
5292   /* "yt/geometry/oct_container.pyx":97
5293  *         visitor.oref = 0
5294  *         visitor.nz = 1
5295  *         assert(ref_mask.shape[0] / float(visitor.nz) ==             # <<<<<<<<<<<<<<
5296  *             <int>(ref_mask.shape[0]/float(visitor.nz)))
5297  *         obj.allocate_domains([ref_mask.shape[0] / visitor.nz])
5298  */
5299   #ifndef CYTHON_WITHOUT_ASSERTIONS
5300   if (unlikely(!Py_OptimizeFlag)) {
5301     if (unlikely(((double)__pyx_v_visitor->__pyx_base.nz) == 0)) {
5302       PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5303       __PYX_ERR(0, 97, __pyx_L1_error)
5304     }
5305 
5306     /* "yt/geometry/oct_container.pyx":98
5307  *         visitor.nz = 1
5308  *         assert(ref_mask.shape[0] / float(visitor.nz) ==
5309  *             <int>(ref_mask.shape[0]/float(visitor.nz)))             # <<<<<<<<<<<<<<
5310  *         obj.allocate_domains([ref_mask.shape[0] / visitor.nz])
5311  *         cdef np.float64_t pos[3]
5312  */
5313     if (unlikely(((double)__pyx_v_visitor->__pyx_base.nz) == 0)) {
5314       PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5315       __PYX_ERR(0, 98, __pyx_L1_error)
5316     }
5317 
5318     /* "yt/geometry/oct_container.pyx":97
5319  *         visitor.oref = 0
5320  *         visitor.nz = 1
5321  *         assert(ref_mask.shape[0] / float(visitor.nz) ==             # <<<<<<<<<<<<<<
5322  *             <int>(ref_mask.shape[0]/float(visitor.nz)))
5323  *         obj.allocate_domains([ref_mask.shape[0] / visitor.nz])
5324  */
5325     if (unlikely(!((((__pyx_v_ref_mask->dimensions[0]) / ((double)__pyx_v_visitor->__pyx_base.nz)) == ((int)((__pyx_v_ref_mask->dimensions[0]) / ((double)__pyx_v_visitor->__pyx_base.nz)))) != 0))) {
5326       PyErr_SetNone(PyExc_AssertionError);
5327       __PYX_ERR(0, 97, __pyx_L1_error)
5328     }
5329   }
5330   #endif
5331 
5332   /* "yt/geometry/oct_container.pyx":99
5333  *         assert(ref_mask.shape[0] / float(visitor.nz) ==
5334  *             <int>(ref_mask.shape[0]/float(visitor.nz)))
5335  *         obj.allocate_domains([ref_mask.shape[0] / visitor.nz])             # <<<<<<<<<<<<<<
5336  *         cdef np.float64_t pos[3]
5337  *         cdef np.float64_t dds[3]
5338  */
5339   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
5340   __Pyx_GOTREF(__pyx_t_7);
5341   if (unlikely(__pyx_v_visitor->__pyx_base.nz == 0)) {
5342     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
5343     __PYX_ERR(0, 99, __pyx_L1_error)
5344   }
5345   else if (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (!(((__pyx_t_5numpy_int32_t)-1) > 0)) && unlikely(__pyx_v_visitor->__pyx_base.nz == (__pyx_t_5numpy_int32_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW((__pyx_v_ref_mask->dimensions[0])))) {
5346     PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
5347     __PYX_ERR(0, 99, __pyx_L1_error)
5348   }
5349   __pyx_t_9 = __Pyx_PyInt_From_npy_int32(__Pyx_div___pyx_t_5numpy_int32_t((__pyx_v_ref_mask->dimensions[0]), __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 99, __pyx_L1_error)
5350   __Pyx_GOTREF(__pyx_t_9);
5351   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
5352   __Pyx_GOTREF(__pyx_t_1);
5353   __Pyx_GIVEREF(__pyx_t_9);
5354   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
5355   __pyx_t_9 = 0;
5356   __pyx_t_9 = NULL;
5357   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
5358     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
5359     if (likely(__pyx_t_9)) {
5360       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
5361       __Pyx_INCREF(__pyx_t_9);
5362       __Pyx_INCREF(function);
5363       __Pyx_DECREF_SET(__pyx_t_7, function);
5364     }
5365   }
5366   __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
5367   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5368   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5369   if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
5370   __Pyx_GOTREF(__pyx_t_8);
5371   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5372   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5373 
5374   /* "yt/geometry/oct_container.pyx":103
5375  *         cdef np.float64_t dds[3]
5376  *         # This dds is the oct-width
5377  *         for i in range(3):             # <<<<<<<<<<<<<<
5378  *             dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i]
5379  *         # Pos is the center of the octs
5380  */
5381   for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) {
5382     __pyx_v_i = __pyx_t_3;
5383 
5384     /* "yt/geometry/oct_container.pyx":104
5385  *         # This dds is the oct-width
5386  *         for i in range(3):
5387  *             dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i]             # <<<<<<<<<<<<<<
5388  *         # Pos is the center of the octs
5389  *         cdef OctAllocationContainer *cur = obj.domains.get_cont(0)
5390  */
5391     __pyx_t_10 = ((__pyx_v_obj->DRE[__pyx_v_i]) - (__pyx_v_obj->DLE[__pyx_v_i]));
5392     if (unlikely((__pyx_v_obj->nn[__pyx_v_i]) == 0)) {
5393       PyErr_SetString(PyExc_ZeroDivisionError, "float division");
5394       __PYX_ERR(0, 104, __pyx_L1_error)
5395     }
5396     (__pyx_v_dds[__pyx_v_i]) = (__pyx_t_10 / (__pyx_v_obj->nn[__pyx_v_i]));
5397   }
5398 
5399   /* "yt/geometry/oct_container.pyx":106
5400  *             dds[i] = (obj.DRE[i] - obj.DLE[i]) / obj.nn[i]
5401  *         # Pos is the center of the octs
5402  *         cdef OctAllocationContainer *cur = obj.domains.get_cont(0)             # <<<<<<<<<<<<<<
5403  *         cdef Oct *o
5404  *         cdef np.uint64_t nfinest = 0
5405  */
5406   __pyx_v_cur = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_obj->domains, 0);
5407 
5408   /* "yt/geometry/oct_container.pyx":108
5409  *         cdef OctAllocationContainer *cur = obj.domains.get_cont(0)
5410  *         cdef Oct *o
5411  *         cdef np.uint64_t nfinest = 0             # <<<<<<<<<<<<<<
5412  *         visitor.ref_mask = ref_mask
5413  *         visitor.octs = cur.my_objs
5414  */
5415   __pyx_v_nfinest = 0;
5416 
5417   /* "yt/geometry/oct_container.pyx":109
5418  *         cdef Oct *o
5419  *         cdef np.uint64_t nfinest = 0
5420  *         visitor.ref_mask = ref_mask             # <<<<<<<<<<<<<<
5421  *         visitor.octs = cur.my_objs
5422  *         visitor.nocts = &cur.n_assigned
5423  */
5424   __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_ref_mask), PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 109, __pyx_L1_error)
5425   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ref_mask, 0);
5426   __pyx_v_visitor->ref_mask = __pyx_t_11;
5427   __pyx_t_11.memview = NULL;
5428   __pyx_t_11.data = NULL;
5429 
5430   /* "yt/geometry/oct_container.pyx":110
5431  *         cdef np.uint64_t nfinest = 0
5432  *         visitor.ref_mask = ref_mask
5433  *         visitor.octs = cur.my_objs             # <<<<<<<<<<<<<<
5434  *         visitor.nocts = &cur.n_assigned
5435  *         visitor.nfinest = &nfinest
5436  */
5437   __pyx_t_12 = __pyx_v_cur->my_objs;
5438   __pyx_v_visitor->octs = __pyx_t_12;
5439 
5440   /* "yt/geometry/oct_container.pyx":111
5441  *         visitor.ref_mask = ref_mask
5442  *         visitor.octs = cur.my_objs
5443  *         visitor.nocts = &cur.n_assigned             # <<<<<<<<<<<<<<
5444  *         visitor.nfinest = &nfinest
5445  *         pos[0] = obj.DLE[0] + dds[0]/2.0
5446  */
5447   __pyx_v_visitor->nocts = (&__pyx_v_cur->n_assigned);
5448 
5449   /* "yt/geometry/oct_container.pyx":112
5450  *         visitor.octs = cur.my_objs
5451  *         visitor.nocts = &cur.n_assigned
5452  *         visitor.nfinest = &nfinest             # <<<<<<<<<<<<<<
5453  *         pos[0] = obj.DLE[0] + dds[0]/2.0
5454  *         for i in range(obj.nn[0]):
5455  */
5456   __pyx_v_visitor->nfinest = (&__pyx_v_nfinest);
5457 
5458   /* "yt/geometry/oct_container.pyx":113
5459  *         visitor.nocts = &cur.n_assigned
5460  *         visitor.nfinest = &nfinest
5461  *         pos[0] = obj.DLE[0] + dds[0]/2.0             # <<<<<<<<<<<<<<
5462  *         for i in range(obj.nn[0]):
5463  *             pos[1] = obj.DLE[1] + dds[1]/2.0
5464  */
5465   (__pyx_v_pos[0]) = ((__pyx_v_obj->DLE[0]) + ((__pyx_v_dds[0]) / 2.0));
5466 
5467   /* "yt/geometry/oct_container.pyx":114
5468  *         visitor.nfinest = &nfinest
5469  *         pos[0] = obj.DLE[0] + dds[0]/2.0
5470  *         for i in range(obj.nn[0]):             # <<<<<<<<<<<<<<
5471  *             pos[1] = obj.DLE[1] + dds[1]/2.0
5472  *             for j in range(obj.nn[1]):
5473  */
5474   __pyx_t_3 = (__pyx_v_obj->nn[0]);
5475   __pyx_t_13 = __pyx_t_3;
5476   for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5477     __pyx_v_i = __pyx_t_14;
5478 
5479     /* "yt/geometry/oct_container.pyx":115
5480  *         pos[0] = obj.DLE[0] + dds[0]/2.0
5481  *         for i in range(obj.nn[0]):
5482  *             pos[1] = obj.DLE[1] + dds[1]/2.0             # <<<<<<<<<<<<<<
5483  *             for j in range(obj.nn[1]):
5484  *                 pos[2] = obj.DLE[2] + dds[2]/2.0
5485  */
5486     (__pyx_v_pos[1]) = ((__pyx_v_obj->DLE[1]) + ((__pyx_v_dds[1]) / 2.0));
5487 
5488     /* "yt/geometry/oct_container.pyx":116
5489  *         for i in range(obj.nn[0]):
5490  *             pos[1] = obj.DLE[1] + dds[1]/2.0
5491  *             for j in range(obj.nn[1]):             # <<<<<<<<<<<<<<
5492  *                 pos[2] = obj.DLE[2] + dds[2]/2.0
5493  *                 for k in range(obj.nn[2]):
5494  */
5495     __pyx_t_15 = (__pyx_v_obj->nn[1]);
5496     __pyx_t_16 = __pyx_t_15;
5497     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
5498       __pyx_v_j = __pyx_t_17;
5499 
5500       /* "yt/geometry/oct_container.pyx":117
5501  *             pos[1] = obj.DLE[1] + dds[1]/2.0
5502  *             for j in range(obj.nn[1]):
5503  *                 pos[2] = obj.DLE[2] + dds[2]/2.0             # <<<<<<<<<<<<<<
5504  *                 for k in range(obj.nn[2]):
5505  *                     if obj.root_mesh[i][j][k] != NULL:
5506  */
5507       (__pyx_v_pos[2]) = ((__pyx_v_obj->DLE[2]) + ((__pyx_v_dds[2]) / 2.0));
5508 
5509       /* "yt/geometry/oct_container.pyx":118
5510  *             for j in range(obj.nn[1]):
5511  *                 pos[2] = obj.DLE[2] + dds[2]/2.0
5512  *                 for k in range(obj.nn[2]):             # <<<<<<<<<<<<<<
5513  *                     if obj.root_mesh[i][j][k] != NULL:
5514  *                         raise RuntimeError
5515  */
5516       __pyx_t_18 = (__pyx_v_obj->nn[2]);
5517       __pyx_t_19 = __pyx_t_18;
5518       for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
5519         __pyx_v_k = __pyx_t_20;
5520 
5521         /* "yt/geometry/oct_container.pyx":119
5522  *                 pos[2] = obj.DLE[2] + dds[2]/2.0
5523  *                 for k in range(obj.nn[2]):
5524  *                     if obj.root_mesh[i][j][k] != NULL:             # <<<<<<<<<<<<<<
5525  *                         raise RuntimeError
5526  *                     o = &cur.my_objs[cur.n_assigned]
5527  */
5528         __pyx_t_21 = (((((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) != NULL) != 0);
5529         if (unlikely(__pyx_t_21)) {
5530 
5531           /* "yt/geometry/oct_container.pyx":120
5532  *                 for k in range(obj.nn[2]):
5533  *                     if obj.root_mesh[i][j][k] != NULL:
5534  *                         raise RuntimeError             # <<<<<<<<<<<<<<
5535  *                     o = &cur.my_objs[cur.n_assigned]
5536  *                     o.domain_ind = o.file_ind = 0
5537  */
5538           __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
5539           __PYX_ERR(0, 120, __pyx_L1_error)
5540 
5541           /* "yt/geometry/oct_container.pyx":119
5542  *                 pos[2] = obj.DLE[2] + dds[2]/2.0
5543  *                 for k in range(obj.nn[2]):
5544  *                     if obj.root_mesh[i][j][k] != NULL:             # <<<<<<<<<<<<<<
5545  *                         raise RuntimeError
5546  *                     o = &cur.my_objs[cur.n_assigned]
5547  */
5548         }
5549 
5550         /* "yt/geometry/oct_container.pyx":121
5551  *                     if obj.root_mesh[i][j][k] != NULL:
5552  *                         raise RuntimeError
5553  *                     o = &cur.my_objs[cur.n_assigned]             # <<<<<<<<<<<<<<
5554  *                     o.domain_ind = o.file_ind = 0
5555  *                     o.domain = 1
5556  */
5557         __pyx_v_o = (&(__pyx_v_cur->my_objs[__pyx_v_cur->n_assigned]));
5558 
5559         /* "yt/geometry/oct_container.pyx":122
5560  *                         raise RuntimeError
5561  *                     o = &cur.my_objs[cur.n_assigned]
5562  *                     o.domain_ind = o.file_ind = 0             # <<<<<<<<<<<<<<
5563  *                     o.domain = 1
5564  *                     obj.root_mesh[i][j][k] = o
5565  */
5566         __pyx_v_o->domain_ind = 0;
5567         __pyx_v_o->file_ind = 0;
5568 
5569         /* "yt/geometry/oct_container.pyx":123
5570  *                     o = &cur.my_objs[cur.n_assigned]
5571  *                     o.domain_ind = o.file_ind = 0
5572  *                     o.domain = 1             # <<<<<<<<<<<<<<
5573  *                     obj.root_mesh[i][j][k] = o
5574  *                     cur.n_assigned += 1
5575  */
5576         __pyx_v_o->domain = 1;
5577 
5578         /* "yt/geometry/oct_container.pyx":124
5579  *                     o.domain_ind = o.file_ind = 0
5580  *                     o.domain = 1
5581  *                     obj.root_mesh[i][j][k] = o             # <<<<<<<<<<<<<<
5582  *                     cur.n_assigned += 1
5583  *                     visitor.pos[0] = i
5584  */
5585         (((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) = __pyx_v_o;
5586 
5587         /* "yt/geometry/oct_container.pyx":125
5588  *                     o.domain = 1
5589  *                     obj.root_mesh[i][j][k] = o
5590  *                     cur.n_assigned += 1             # <<<<<<<<<<<<<<
5591  *                     visitor.pos[0] = i
5592  *                     visitor.pos[1] = j
5593  */
5594         __pyx_v_cur->n_assigned = (__pyx_v_cur->n_assigned + 1);
5595 
5596         /* "yt/geometry/oct_container.pyx":126
5597  *                     obj.root_mesh[i][j][k] = o
5598  *                     cur.n_assigned += 1
5599  *                     visitor.pos[0] = i             # <<<<<<<<<<<<<<
5600  *                     visitor.pos[1] = j
5601  *                     visitor.pos[2] = k
5602  */
5603         (__pyx_v_visitor->__pyx_base.pos[0]) = __pyx_v_i;
5604 
5605         /* "yt/geometry/oct_container.pyx":127
5606  *                     cur.n_assigned += 1
5607  *                     visitor.pos[0] = i
5608  *                     visitor.pos[1] = j             # <<<<<<<<<<<<<<
5609  *                     visitor.pos[2] = k
5610  *                     # Always visit covered
5611  */
5612         (__pyx_v_visitor->__pyx_base.pos[1]) = __pyx_v_j;
5613 
5614         /* "yt/geometry/oct_container.pyx":128
5615  *                     visitor.pos[0] = i
5616  *                     visitor.pos[1] = j
5617  *                     visitor.pos[2] = k             # <<<<<<<<<<<<<<
5618  *                     # Always visit covered
5619  *                     selector.recursively_visit_octs(
5620  */
5621         (__pyx_v_visitor->__pyx_base.pos[2]) = __pyx_v_k;
5622 
5623         /* "yt/geometry/oct_container.pyx":130
5624  *                     visitor.pos[2] = k
5625  *                     # Always visit covered
5626  *                     selector.recursively_visit_octs(             # <<<<<<<<<<<<<<
5627  *                         obj.root_mesh[i][j][k],
5628  *                         pos, dds, 0, visitor, 1)
5629  */
5630         __pyx_t_22.__pyx_n = 1;
5631         __pyx_t_22.visit_covered = 1;
5632         ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, (((__pyx_v_obj->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_pos, __pyx_v_dds, 0, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), &__pyx_t_22);
5633 
5634         /* "yt/geometry/oct_container.pyx":133
5635  *                         obj.root_mesh[i][j][k],
5636  *                         pos, dds, 0, visitor, 1)
5637  *                     pos[2] += dds[2]             # <<<<<<<<<<<<<<
5638  *                 pos[1] += dds[1]
5639  *             pos[0] += dds[0]
5640  */
5641         __pyx_t_23 = 2;
5642         (__pyx_v_pos[__pyx_t_23]) = ((__pyx_v_pos[__pyx_t_23]) + (__pyx_v_dds[2]));
5643       }
5644 
5645       /* "yt/geometry/oct_container.pyx":134
5646  *                         pos, dds, 0, visitor, 1)
5647  *                     pos[2] += dds[2]
5648  *                 pos[1] += dds[1]             # <<<<<<<<<<<<<<
5649  *             pos[0] += dds[0]
5650  *         obj.nocts = cur.n_assigned
5651  */
5652       __pyx_t_23 = 1;
5653       (__pyx_v_pos[__pyx_t_23]) = ((__pyx_v_pos[__pyx_t_23]) + (__pyx_v_dds[1]));
5654     }
5655 
5656     /* "yt/geometry/oct_container.pyx":135
5657  *                     pos[2] += dds[2]
5658  *                 pos[1] += dds[1]
5659  *             pos[0] += dds[0]             # <<<<<<<<<<<<<<
5660  *         obj.nocts = cur.n_assigned
5661  *         if obj.nocts * visitor.nz != ref_mask.size:
5662  */
5663     __pyx_t_23 = 0;
5664     (__pyx_v_pos[__pyx_t_23]) = ((__pyx_v_pos[__pyx_t_23]) + (__pyx_v_dds[0]));
5665   }
5666 
5667   /* "yt/geometry/oct_container.pyx":136
5668  *                 pos[1] += dds[1]
5669  *             pos[0] += dds[0]
5670  *         obj.nocts = cur.n_assigned             # <<<<<<<<<<<<<<
5671  *         if obj.nocts * visitor.nz != ref_mask.size:
5672  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,
5673  */
5674   __pyx_t_24 = __pyx_v_cur->n_assigned;
5675   __pyx_v_obj->nocts = __pyx_t_24;
5676 
5677   /* "yt/geometry/oct_container.pyx":137
5678  *             pos[0] += dds[0]
5679  *         obj.nocts = cur.n_assigned
5680  *         if obj.nocts * visitor.nz != ref_mask.size:             # <<<<<<<<<<<<<<
5681  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,
5682  *                 obj.partial_coverage, visitor.nz)
5683  */
5684   __pyx_t_8 = __Pyx_PyInt_From_npy_int64((__pyx_v_obj->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 137, __pyx_L1_error)
5685   __Pyx_GOTREF(__pyx_t_8);
5686   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
5687   __Pyx_GOTREF(__pyx_t_7);
5688   __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
5689   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5690   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5691   __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_21 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
5692   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5693   if (unlikely(__pyx_t_21)) {
5694 
5695     /* "yt/geometry/oct_container.pyx":138
5696  *         obj.nocts = cur.n_assigned
5697  *         if obj.nocts * visitor.nz != ref_mask.size:
5698  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,             # <<<<<<<<<<<<<<
5699  *                 obj.partial_coverage, visitor.nz)
5700  *         return obj
5701  */
5702     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ref_mask), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
5703     __Pyx_GOTREF(__pyx_t_1);
5704     __pyx_t_7 = __Pyx_PyInt_From_npy_int64(__pyx_v_obj->nocts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error)
5705     __Pyx_GOTREF(__pyx_t_7);
5706     __pyx_t_8 = __Pyx_PyInt_From_npy_uint8(__pyx_v_obj->oref); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error)
5707     __Pyx_GOTREF(__pyx_t_8);
5708 
5709     /* "yt/geometry/oct_container.pyx":139
5710  *         if obj.nocts * visitor.nz != ref_mask.size:
5711  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,
5712  *                 obj.partial_coverage, visitor.nz)             # <<<<<<<<<<<<<<
5713  *         return obj
5714  *
5715  */
5716     __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_obj->partial_coverage); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 139, __pyx_L1_error)
5717     __Pyx_GOTREF(__pyx_t_9);
5718     __pyx_t_25 = __Pyx_PyInt_From_npy_int32(__pyx_v_visitor->__pyx_base.nz); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 139, __pyx_L1_error)
5719     __Pyx_GOTREF(__pyx_t_25);
5720 
5721     /* "yt/geometry/oct_container.pyx":138
5722  *         obj.nocts = cur.n_assigned
5723  *         if obj.nocts * visitor.nz != ref_mask.size:
5724  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,             # <<<<<<<<<<<<<<
5725  *                 obj.partial_coverage, visitor.nz)
5726  *         return obj
5727  */
5728     __pyx_t_26 = PyTuple_New(5); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 138, __pyx_L1_error)
5729     __Pyx_GOTREF(__pyx_t_26);
5730     __Pyx_GIVEREF(__pyx_t_1);
5731     PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_1);
5732     __Pyx_GIVEREF(__pyx_t_7);
5733     PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_t_7);
5734     __Pyx_GIVEREF(__pyx_t_8);
5735     PyTuple_SET_ITEM(__pyx_t_26, 2, __pyx_t_8);
5736     __Pyx_GIVEREF(__pyx_t_9);
5737     PyTuple_SET_ITEM(__pyx_t_26, 3, __pyx_t_9);
5738     __Pyx_GIVEREF(__pyx_t_25);
5739     PyTuple_SET_ITEM(__pyx_t_26, 4, __pyx_t_25);
5740     __pyx_t_1 = 0;
5741     __pyx_t_7 = 0;
5742     __pyx_t_8 = 0;
5743     __pyx_t_9 = 0;
5744     __pyx_t_25 = 0;
5745     __pyx_t_25 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_26, NULL); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 138, __pyx_L1_error)
5746     __Pyx_GOTREF(__pyx_t_25);
5747     __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
5748     __Pyx_Raise(__pyx_t_25, 0, 0, 0);
5749     __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
5750     __PYX_ERR(0, 138, __pyx_L1_error)
5751 
5752     /* "yt/geometry/oct_container.pyx":137
5753  *             pos[0] += dds[0]
5754  *         obj.nocts = cur.n_assigned
5755  *         if obj.nocts * visitor.nz != ref_mask.size:             # <<<<<<<<<<<<<<
5756  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,
5757  *                 obj.partial_coverage, visitor.nz)
5758  */
5759   }
5760 
5761   /* "yt/geometry/oct_container.pyx":140
5762  *             raise KeyError(ref_mask.size, obj.nocts, obj.oref,
5763  *                 obj.partial_coverage, visitor.nz)
5764  *         return obj             # <<<<<<<<<<<<<<
5765  *
5766  *     def __dealloc__(self):
5767  */
5768   __Pyx_XDECREF(__pyx_r);
5769   __Pyx_INCREF(((PyObject *)__pyx_v_obj));
5770   __pyx_r = ((PyObject *)__pyx_v_obj);
5771   goto __pyx_L0;
5772 
5773   /* "yt/geometry/oct_container.pyx":82
5774  *
5775  *     @classmethod
5776  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
5777  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
5778  *         ref_mask = header['octree']
5779  */
5780 
5781   /* function exit code */
5782   __pyx_L1_error:;
5783   __Pyx_XDECREF(__pyx_t_1);
5784   __Pyx_XDECREF(__pyx_t_7);
5785   __Pyx_XDECREF(__pyx_t_8);
5786   __Pyx_XDECREF(__pyx_t_9);
5787   __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5788   __Pyx_XDECREF(__pyx_t_25);
5789   __Pyx_XDECREF(__pyx_t_26);
5790   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5791     __Pyx_PyThreadState_declare
5792     __Pyx_PyThreadState_assign
5793     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5794     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
5795   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5796   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.load_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
5797   __pyx_r = NULL;
5798   goto __pyx_L2;
5799   __pyx_L0:;
5800   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
5801   __pyx_L2:;
5802   __Pyx_XDECREF((PyObject *)__pyx_v_ref_mask);
5803   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
5804   __Pyx_XDECREF((PyObject *)__pyx_v_selector);
5805   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
5806   __Pyx_XGIVEREF(__pyx_r);
5807   __Pyx_RefNannyFinishContext();
5808   return __pyx_r;
5809 }
5810 
5811 /* "yt/geometry/oct_container.pyx":142
5812  *         return obj
5813  *
5814  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
5815  *         if self.root_mesh == NULL: return
5816  *         for i in range(self.nn[0]):
5817  */
5818 
5819 /* Python wrapper */
5820 static void __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7__dealloc__(PyObject * __pyx_v_self)5821 static void __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7__dealloc__(PyObject *__pyx_v_self) {
5822   __Pyx_RefNannyDeclarations
5823   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5824   __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_6__dealloc__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
5825 
5826   /* function exit code */
5827   __Pyx_RefNannyFinishContext();
5828 }
5829 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_6__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)5830 static void __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_6__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
5831   int __pyx_v_i;
5832   int __pyx_v_j;
5833   __Pyx_RefNannyDeclarations
5834   int __pyx_t_1;
5835   int __pyx_t_2;
5836   int __pyx_t_3;
5837   int __pyx_t_4;
5838   int __pyx_t_5;
5839   int __pyx_t_6;
5840   int __pyx_t_7;
5841   __Pyx_RefNannySetupContext("__dealloc__", 0);
5842 
5843   /* "yt/geometry/oct_container.pyx":143
5844  *
5845  *     def __dealloc__(self):
5846  *         if self.root_mesh == NULL: return             # <<<<<<<<<<<<<<
5847  *         for i in range(self.nn[0]):
5848  *             if self.root_mesh[i] == NULL: continue
5849  */
5850   __pyx_t_1 = ((__pyx_v_self->root_mesh == NULL) != 0);
5851   if (__pyx_t_1) {
5852     goto __pyx_L0;
5853   }
5854 
5855   /* "yt/geometry/oct_container.pyx":144
5856  *     def __dealloc__(self):
5857  *         if self.root_mesh == NULL: return
5858  *         for i in range(self.nn[0]):             # <<<<<<<<<<<<<<
5859  *             if self.root_mesh[i] == NULL: continue
5860  *             for j in range(self.nn[1]):
5861  */
5862   __pyx_t_2 = (__pyx_v_self->nn[0]);
5863   __pyx_t_3 = __pyx_t_2;
5864   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5865     __pyx_v_i = __pyx_t_4;
5866 
5867     /* "yt/geometry/oct_container.pyx":145
5868  *         if self.root_mesh == NULL: return
5869  *         for i in range(self.nn[0]):
5870  *             if self.root_mesh[i] == NULL: continue             # <<<<<<<<<<<<<<
5871  *             for j in range(self.nn[1]):
5872  *                 if self.root_mesh[i][j] == NULL: continue
5873  */
5874     __pyx_t_1 = (((__pyx_v_self->root_mesh[__pyx_v_i]) == NULL) != 0);
5875     if (__pyx_t_1) {
5876       goto __pyx_L4_continue;
5877     }
5878 
5879     /* "yt/geometry/oct_container.pyx":146
5880  *         for i in range(self.nn[0]):
5881  *             if self.root_mesh[i] == NULL: continue
5882  *             for j in range(self.nn[1]):             # <<<<<<<<<<<<<<
5883  *                 if self.root_mesh[i][j] == NULL: continue
5884  *                 free(self.root_mesh[i][j])
5885  */
5886     __pyx_t_5 = (__pyx_v_self->nn[1]);
5887     __pyx_t_6 = __pyx_t_5;
5888     for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
5889       __pyx_v_j = __pyx_t_7;
5890 
5891       /* "yt/geometry/oct_container.pyx":147
5892  *             if self.root_mesh[i] == NULL: continue
5893  *             for j in range(self.nn[1]):
5894  *                 if self.root_mesh[i][j] == NULL: continue             # <<<<<<<<<<<<<<
5895  *                 free(self.root_mesh[i][j])
5896  *             if self.root_mesh[i] == NULL: continue
5897  */
5898       __pyx_t_1 = ((((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j]) == NULL) != 0);
5899       if (__pyx_t_1) {
5900         goto __pyx_L7_continue;
5901       }
5902 
5903       /* "yt/geometry/oct_container.pyx":148
5904  *             for j in range(self.nn[1]):
5905  *                 if self.root_mesh[i][j] == NULL: continue
5906  *                 free(self.root_mesh[i][j])             # <<<<<<<<<<<<<<
5907  *             if self.root_mesh[i] == NULL: continue
5908  *             free(self.root_mesh[i])
5909  */
5910       free(((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j]));
5911       __pyx_L7_continue:;
5912     }
5913 
5914     /* "yt/geometry/oct_container.pyx":149
5915  *                 if self.root_mesh[i][j] == NULL: continue
5916  *                 free(self.root_mesh[i][j])
5917  *             if self.root_mesh[i] == NULL: continue             # <<<<<<<<<<<<<<
5918  *             free(self.root_mesh[i])
5919  *         free(self.root_mesh)
5920  */
5921     __pyx_t_1 = (((__pyx_v_self->root_mesh[__pyx_v_i]) == NULL) != 0);
5922     if (__pyx_t_1) {
5923       goto __pyx_L4_continue;
5924     }
5925 
5926     /* "yt/geometry/oct_container.pyx":150
5927  *                 free(self.root_mesh[i][j])
5928  *             if self.root_mesh[i] == NULL: continue
5929  *             free(self.root_mesh[i])             # <<<<<<<<<<<<<<
5930  *         free(self.root_mesh)
5931  *
5932  */
5933     free((__pyx_v_self->root_mesh[__pyx_v_i]));
5934     __pyx_L4_continue:;
5935   }
5936 
5937   /* "yt/geometry/oct_container.pyx":151
5938  *             if self.root_mesh[i] == NULL: continue
5939  *             free(self.root_mesh[i])
5940  *         free(self.root_mesh)             # <<<<<<<<<<<<<<
5941  *
5942  *     @cython.cdivision(True)
5943  */
5944   free(__pyx_v_self->root_mesh);
5945 
5946   /* "yt/geometry/oct_container.pyx":142
5947  *         return obj
5948  *
5949  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
5950  *         if self.root_mesh == NULL: return
5951  *         for i in range(self.nn[0]):
5952  */
5953 
5954   /* function exit code */
5955   __pyx_L0:;
5956   __Pyx_RefNannyFinishContext();
5957 }
5958 
5959 /* "yt/geometry/oct_container.pyx":154
5960  *
5961  *     @cython.cdivision(True)
5962  *     cdef void visit_all_octs(self, SelectorObject selector,             # <<<<<<<<<<<<<<
5963  *                         OctVisitor visitor, int vc = -1,
5964  *                         np.int64_t *indices = NULL):
5965  */
5966 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_visitor,struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs * __pyx_optional_args)5967 static void __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args) {
5968   int __pyx_v_vc = ((int)-1);
5969   int __pyx_v_i;
5970   int __pyx_v_j;
5971   int __pyx_v_k;
5972   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
5973   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
5974   __Pyx_RefNannyDeclarations
5975   int __pyx_t_1;
5976   int __pyx_t_2;
5977   int __pyx_t_3;
5978   int __pyx_t_4;
5979   int __pyx_t_5;
5980   int __pyx_t_6;
5981   int __pyx_t_7;
5982   int __pyx_t_8;
5983   int __pyx_t_9;
5984   int __pyx_t_10;
5985   struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs __pyx_t_11;
5986   long __pyx_t_12;
5987   __Pyx_RefNannySetupContext("visit_all_octs", 0);
5988   if (__pyx_optional_args) {
5989     if (__pyx_optional_args->__pyx_n > 0) {
5990       __pyx_v_vc = __pyx_optional_args->vc;
5991     }
5992   }
5993 
5994   /* "yt/geometry/oct_container.pyx":158
5995  *                         np.int64_t *indices = NULL):
5996  *         cdef int i, j, k, n
5997  *         if vc == -1:             # <<<<<<<<<<<<<<
5998  *             vc = self.partial_coverage
5999  *         visitor.global_index = -1
6000  */
6001   __pyx_t_1 = ((__pyx_v_vc == -1L) != 0);
6002   if (__pyx_t_1) {
6003 
6004     /* "yt/geometry/oct_container.pyx":159
6005  *         cdef int i, j, k, n
6006  *         if vc == -1:
6007  *             vc = self.partial_coverage             # <<<<<<<<<<<<<<
6008  *         visitor.global_index = -1
6009  *         visitor.level = 0
6010  */
6011     __pyx_t_2 = __pyx_v_self->partial_coverage;
6012     __pyx_v_vc = __pyx_t_2;
6013 
6014     /* "yt/geometry/oct_container.pyx":158
6015  *                         np.int64_t *indices = NULL):
6016  *         cdef int i, j, k, n
6017  *         if vc == -1:             # <<<<<<<<<<<<<<
6018  *             vc = self.partial_coverage
6019  *         visitor.global_index = -1
6020  */
6021   }
6022 
6023   /* "yt/geometry/oct_container.pyx":160
6024  *         if vc == -1:
6025  *             vc = self.partial_coverage
6026  *         visitor.global_index = -1             # <<<<<<<<<<<<<<
6027  *         visitor.level = 0
6028  *         cdef np.float64_t pos[3]
6029  */
6030   __pyx_v_visitor->global_index = -1LL;
6031 
6032   /* "yt/geometry/oct_container.pyx":161
6033  *             vc = self.partial_coverage
6034  *         visitor.global_index = -1
6035  *         visitor.level = 0             # <<<<<<<<<<<<<<
6036  *         cdef np.float64_t pos[3]
6037  *         cdef np.float64_t dds[3]
6038  */
6039   __pyx_v_visitor->level = 0;
6040 
6041   /* "yt/geometry/oct_container.pyx":165
6042  *         cdef np.float64_t dds[3]
6043  *         # This dds is the oct-width
6044  *         for i in range(3):             # <<<<<<<<<<<<<<
6045  *             dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i]
6046  *         # Pos is the center of the octs
6047  */
6048   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
6049     __pyx_v_i = __pyx_t_2;
6050 
6051     /* "yt/geometry/oct_container.pyx":166
6052  *         # This dds is the oct-width
6053  *         for i in range(3):
6054  *             dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i]             # <<<<<<<<<<<<<<
6055  *         # Pos is the center of the octs
6056  *         pos[0] = self.DLE[0] + dds[0]/2.0
6057  */
6058     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i]));
6059   }
6060 
6061   /* "yt/geometry/oct_container.pyx":168
6062  *             dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i]
6063  *         # Pos is the center of the octs
6064  *         pos[0] = self.DLE[0] + dds[0]/2.0             # <<<<<<<<<<<<<<
6065  *         for i in range(self.nn[0]):
6066  *             pos[1] = self.DLE[1] + dds[1]/2.0
6067  */
6068   (__pyx_v_pos[0]) = ((__pyx_v_self->DLE[0]) + ((__pyx_v_dds[0]) / 2.0));
6069 
6070   /* "yt/geometry/oct_container.pyx":169
6071  *         # Pos is the center of the octs
6072  *         pos[0] = self.DLE[0] + dds[0]/2.0
6073  *         for i in range(self.nn[0]):             # <<<<<<<<<<<<<<
6074  *             pos[1] = self.DLE[1] + dds[1]/2.0
6075  *             for j in range(self.nn[1]):
6076  */
6077   __pyx_t_2 = (__pyx_v_self->nn[0]);
6078   __pyx_t_3 = __pyx_t_2;
6079   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6080     __pyx_v_i = __pyx_t_4;
6081 
6082     /* "yt/geometry/oct_container.pyx":170
6083  *         pos[0] = self.DLE[0] + dds[0]/2.0
6084  *         for i in range(self.nn[0]):
6085  *             pos[1] = self.DLE[1] + dds[1]/2.0             # <<<<<<<<<<<<<<
6086  *             for j in range(self.nn[1]):
6087  *                 pos[2] = self.DLE[2] + dds[2]/2.0
6088  */
6089     (__pyx_v_pos[1]) = ((__pyx_v_self->DLE[1]) + ((__pyx_v_dds[1]) / 2.0));
6090 
6091     /* "yt/geometry/oct_container.pyx":171
6092  *         for i in range(self.nn[0]):
6093  *             pos[1] = self.DLE[1] + dds[1]/2.0
6094  *             for j in range(self.nn[1]):             # <<<<<<<<<<<<<<
6095  *                 pos[2] = self.DLE[2] + dds[2]/2.0
6096  *                 for k in range(self.nn[2]):
6097  */
6098     __pyx_t_5 = (__pyx_v_self->nn[1]);
6099     __pyx_t_6 = __pyx_t_5;
6100     for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
6101       __pyx_v_j = __pyx_t_7;
6102 
6103       /* "yt/geometry/oct_container.pyx":172
6104  *             pos[1] = self.DLE[1] + dds[1]/2.0
6105  *             for j in range(self.nn[1]):
6106  *                 pos[2] = self.DLE[2] + dds[2]/2.0             # <<<<<<<<<<<<<<
6107  *                 for k in range(self.nn[2]):
6108  *                     if self.root_mesh[i][j][k] == NULL:
6109  */
6110       (__pyx_v_pos[2]) = ((__pyx_v_self->DLE[2]) + ((__pyx_v_dds[2]) / 2.0));
6111 
6112       /* "yt/geometry/oct_container.pyx":173
6113  *             for j in range(self.nn[1]):
6114  *                 pos[2] = self.DLE[2] + dds[2]/2.0
6115  *                 for k in range(self.nn[2]):             # <<<<<<<<<<<<<<
6116  *                     if self.root_mesh[i][j][k] == NULL:
6117  *                         raise RuntimeError
6118  */
6119       __pyx_t_8 = (__pyx_v_self->nn[2]);
6120       __pyx_t_9 = __pyx_t_8;
6121       for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
6122         __pyx_v_k = __pyx_t_10;
6123 
6124         /* "yt/geometry/oct_container.pyx":174
6125  *                 pos[2] = self.DLE[2] + dds[2]/2.0
6126  *                 for k in range(self.nn[2]):
6127  *                     if self.root_mesh[i][j][k] == NULL:             # <<<<<<<<<<<<<<
6128  *                         raise RuntimeError
6129  *                     visitor.pos[0] = i
6130  */
6131         __pyx_t_1 = (((((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]) == NULL) != 0);
6132         if (unlikely(__pyx_t_1)) {
6133 
6134           /* "yt/geometry/oct_container.pyx":175
6135  *                 for k in range(self.nn[2]):
6136  *                     if self.root_mesh[i][j][k] == NULL:
6137  *                         raise RuntimeError             # <<<<<<<<<<<<<<
6138  *                     visitor.pos[0] = i
6139  *                     visitor.pos[1] = j
6140  */
6141           __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
6142           __PYX_ERR(0, 175, __pyx_L1_error)
6143 
6144           /* "yt/geometry/oct_container.pyx":174
6145  *                 pos[2] = self.DLE[2] + dds[2]/2.0
6146  *                 for k in range(self.nn[2]):
6147  *                     if self.root_mesh[i][j][k] == NULL:             # <<<<<<<<<<<<<<
6148  *                         raise RuntimeError
6149  *                     visitor.pos[0] = i
6150  */
6151         }
6152 
6153         /* "yt/geometry/oct_container.pyx":176
6154  *                     if self.root_mesh[i][j][k] == NULL:
6155  *                         raise RuntimeError
6156  *                     visitor.pos[0] = i             # <<<<<<<<<<<<<<
6157  *                     visitor.pos[1] = j
6158  *                     visitor.pos[2] = k
6159  */
6160         (__pyx_v_visitor->pos[0]) = __pyx_v_i;
6161 
6162         /* "yt/geometry/oct_container.pyx":177
6163  *                         raise RuntimeError
6164  *                     visitor.pos[0] = i
6165  *                     visitor.pos[1] = j             # <<<<<<<<<<<<<<
6166  *                     visitor.pos[2] = k
6167  *                     selector.recursively_visit_octs(
6168  */
6169         (__pyx_v_visitor->pos[1]) = __pyx_v_j;
6170 
6171         /* "yt/geometry/oct_container.pyx":178
6172  *                     visitor.pos[0] = i
6173  *                     visitor.pos[1] = j
6174  *                     visitor.pos[2] = k             # <<<<<<<<<<<<<<
6175  *                     selector.recursively_visit_octs(
6176  *                         self.root_mesh[i][j][k],
6177  */
6178         (__pyx_v_visitor->pos[2]) = __pyx_v_k;
6179 
6180         /* "yt/geometry/oct_container.pyx":179
6181  *                     visitor.pos[1] = j
6182  *                     visitor.pos[2] = k
6183  *                     selector.recursively_visit_octs(             # <<<<<<<<<<<<<<
6184  *                         self.root_mesh[i][j][k],
6185  *                         pos, dds, 0, visitor, vc)
6186  */
6187         __pyx_t_11.__pyx_n = 1;
6188         __pyx_t_11.visit_covered = __pyx_v_vc;
6189         ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, (((__pyx_v_self->root_mesh[__pyx_v_i])[__pyx_v_j])[__pyx_v_k]), __pyx_v_pos, __pyx_v_dds, 0, __pyx_v_visitor, &__pyx_t_11);
6190 
6191         /* "yt/geometry/oct_container.pyx":182
6192  *                         self.root_mesh[i][j][k],
6193  *                         pos, dds, 0, visitor, vc)
6194  *                     pos[2] += dds[2]             # <<<<<<<<<<<<<<
6195  *                 pos[1] += dds[1]
6196  *             pos[0] += dds[0]
6197  */
6198         __pyx_t_12 = 2;
6199         (__pyx_v_pos[__pyx_t_12]) = ((__pyx_v_pos[__pyx_t_12]) + (__pyx_v_dds[2]));
6200       }
6201 
6202       /* "yt/geometry/oct_container.pyx":183
6203  *                         pos, dds, 0, visitor, vc)
6204  *                     pos[2] += dds[2]
6205  *                 pos[1] += dds[1]             # <<<<<<<<<<<<<<
6206  *             pos[0] += dds[0]
6207  *
6208  */
6209       __pyx_t_12 = 1;
6210       (__pyx_v_pos[__pyx_t_12]) = ((__pyx_v_pos[__pyx_t_12]) + (__pyx_v_dds[1]));
6211     }
6212 
6213     /* "yt/geometry/oct_container.pyx":184
6214  *                     pos[2] += dds[2]
6215  *                 pos[1] += dds[1]
6216  *             pos[0] += dds[0]             # <<<<<<<<<<<<<<
6217  *
6218  *     cdef np.int64_t get_domain_offset(self, int domain_id):
6219  */
6220     __pyx_t_12 = 0;
6221     (__pyx_v_pos[__pyx_t_12]) = ((__pyx_v_pos[__pyx_t_12]) + (__pyx_v_dds[0]));
6222   }
6223 
6224   /* "yt/geometry/oct_container.pyx":154
6225  *
6226  *     @cython.cdivision(True)
6227  *     cdef void visit_all_octs(self, SelectorObject selector,             # <<<<<<<<<<<<<<
6228  *                         OctVisitor visitor, int vc = -1,
6229  *                         np.int64_t *indices = NULL):
6230  */
6231 
6232   /* function exit code */
6233   goto __pyx_L0;
6234   __pyx_L1_error:;
6235   __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.visit_all_octs", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6236   __pyx_L0:;
6237   __Pyx_RefNannyFinishContext();
6238 }
6239 
6240 /* "yt/geometry/oct_container.pyx":186
6241  *             pos[0] += dds[0]
6242  *
6243  *     cdef np.int64_t get_domain_offset(self, int domain_id):             # <<<<<<<<<<<<<<
6244  *         return 0
6245  *
6246  */
6247 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,CYTHON_UNUSED int __pyx_v_domain_id)6248 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, CYTHON_UNUSED int __pyx_v_domain_id) {
6249   __pyx_t_5numpy_int64_t __pyx_r;
6250   __Pyx_RefNannyDeclarations
6251   __Pyx_RefNannySetupContext("get_domain_offset", 0);
6252 
6253   /* "yt/geometry/oct_container.pyx":187
6254  *
6255  *     cdef np.int64_t get_domain_offset(self, int domain_id):
6256  *         return 0             # <<<<<<<<<<<<<<
6257  *
6258  *     cdef int get_root(self, int ind[3], Oct **o) nogil:
6259  */
6260   __pyx_r = 0;
6261   goto __pyx_L0;
6262 
6263   /* "yt/geometry/oct_container.pyx":186
6264  *             pos[0] += dds[0]
6265  *
6266  *     cdef np.int64_t get_domain_offset(self, int domain_id):             # <<<<<<<<<<<<<<
6267  *         return 0
6268  *
6269  */
6270 
6271   /* function exit code */
6272   __pyx_L0:;
6273   __Pyx_RefNannyFinishContext();
6274   return __pyx_r;
6275 }
6276 
6277 /* "yt/geometry/oct_container.pyx":189
6278  *         return 0
6279  *
6280  *     cdef int get_root(self, int ind[3], Oct **o) nogil:             # <<<<<<<<<<<<<<
6281  *         cdef int i
6282  *         for i in range(3):
6283  */
6284 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int * __pyx_v_ind,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ** __pyx_v_o)6285 static int __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_o) {
6286   int __pyx_v_i;
6287   int __pyx_r;
6288   int __pyx_t_1;
6289   int __pyx_t_2;
6290   int __pyx_t_3;
6291 
6292   /* "yt/geometry/oct_container.pyx":191
6293  *     cdef int get_root(self, int ind[3], Oct **o) nogil:
6294  *         cdef int i
6295  *         for i in range(3):             # <<<<<<<<<<<<<<
6296  *             if ind[i] < 0 or ind[i] >= self.nn[i]:
6297  *                 o[0] = NULL
6298  */
6299   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6300     __pyx_v_i = __pyx_t_1;
6301 
6302     /* "yt/geometry/oct_container.pyx":192
6303  *         cdef int i
6304  *         for i in range(3):
6305  *             if ind[i] < 0 or ind[i] >= self.nn[i]:             # <<<<<<<<<<<<<<
6306  *                 o[0] = NULL
6307  *                 return 1
6308  */
6309     __pyx_t_3 = (((__pyx_v_ind[__pyx_v_i]) < 0) != 0);
6310     if (!__pyx_t_3) {
6311     } else {
6312       __pyx_t_2 = __pyx_t_3;
6313       goto __pyx_L6_bool_binop_done;
6314     }
6315     __pyx_t_3 = (((__pyx_v_ind[__pyx_v_i]) >= (__pyx_v_self->nn[__pyx_v_i])) != 0);
6316     __pyx_t_2 = __pyx_t_3;
6317     __pyx_L6_bool_binop_done:;
6318     if (__pyx_t_2) {
6319 
6320       /* "yt/geometry/oct_container.pyx":193
6321  *         for i in range(3):
6322  *             if ind[i] < 0 or ind[i] >= self.nn[i]:
6323  *                 o[0] = NULL             # <<<<<<<<<<<<<<
6324  *                 return 1
6325  *         o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]]
6326  */
6327       (__pyx_v_o[0]) = NULL;
6328 
6329       /* "yt/geometry/oct_container.pyx":194
6330  *             if ind[i] < 0 or ind[i] >= self.nn[i]:
6331  *                 o[0] = NULL
6332  *                 return 1             # <<<<<<<<<<<<<<
6333  *         o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]]
6334  *         return 0
6335  */
6336       __pyx_r = 1;
6337       goto __pyx_L0;
6338 
6339       /* "yt/geometry/oct_container.pyx":192
6340  *         cdef int i
6341  *         for i in range(3):
6342  *             if ind[i] < 0 or ind[i] >= self.nn[i]:             # <<<<<<<<<<<<<<
6343  *                 o[0] = NULL
6344  *                 return 1
6345  */
6346     }
6347   }
6348 
6349   /* "yt/geometry/oct_container.pyx":195
6350  *                 o[0] = NULL
6351  *                 return 1
6352  *         o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]]             # <<<<<<<<<<<<<<
6353  *         return 0
6354  *
6355  */
6356   (__pyx_v_o[0]) = (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]);
6357 
6358   /* "yt/geometry/oct_container.pyx":196
6359  *                 return 1
6360  *         o[0] = self.root_mesh[ind[0]][ind[1]][ind[2]]
6361  *         return 0             # <<<<<<<<<<<<<<
6362  *
6363  *     @cython.boundscheck(False)
6364  */
6365   __pyx_r = 0;
6366   goto __pyx_L0;
6367 
6368   /* "yt/geometry/oct_container.pyx":189
6369  *         return 0
6370  *
6371  *     cdef int get_root(self, int ind[3], Oct **o) nogil:             # <<<<<<<<<<<<<<
6372  *         cdef int i
6373  *         for i in range(3):
6374  */
6375 
6376   /* function exit code */
6377   __pyx_L0:;
6378   return __pyx_r;
6379 }
6380 
6381 /* "yt/geometry/oct_container.pyx":201
6382  *     @cython.wraparound(False)
6383  *     @cython.cdivision(True)
6384  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = NULL,             # <<<<<<<<<<<<<<
6385  *                   int max_level = 99) nogil:
6386  *         #Given a floating point position, retrieve the most
6387  */
6388 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,__pyx_t_5numpy_float64_t * __pyx_v_ppos,struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get * __pyx_optional_args)6389 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __pyx_t_5numpy_float64_t *__pyx_v_ppos, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args) {
6390   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *__pyx_v_oinfo = ((struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *)NULL);
6391   int __pyx_v_max_level = ((int)99);
6392   int __pyx_v_ind32[3];
6393   __pyx_t_5numpy_int64_t __pyx_v_ipos[3];
6394   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
6395   __pyx_t_5numpy_float64_t __pyx_v_cp[3];
6396   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_cur;
6397   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_next;
6398   int __pyx_v_i;
6399   __pyx_t_5numpy_int64_t __pyx_v_ind[3];
6400   __pyx_t_5numpy_int64_t __pyx_v_level;
6401   int __pyx_v_ncells;
6402   __pyx_t_5numpy_float64_t __pyx_v_factor;
6403   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_r;
6404   int __pyx_t_1;
6405   int __pyx_t_2;
6406   int __pyx_t_3;
6407   int __pyx_t_4;
6408   if (__pyx_optional_args) {
6409     if (__pyx_optional_args->__pyx_n > 0) {
6410       __pyx_v_oinfo = __pyx_optional_args->oinfo;
6411       if (__pyx_optional_args->__pyx_n > 1) {
6412         __pyx_v_max_level = __pyx_optional_args->max_level;
6413       }
6414     }
6415   }
6416 
6417   /* "yt/geometry/oct_container.pyx":212
6418  *         cdef Oct *next
6419  *         cdef int i
6420  *         cur = next = NULL             # <<<<<<<<<<<<<<
6421  *         cdef np.int64_t ind[3]
6422  *         cdef np.int64_t level = -1
6423  */
6424   __pyx_v_cur = NULL;
6425   __pyx_v_next = NULL;
6426 
6427   /* "yt/geometry/oct_container.pyx":214
6428  *         cur = next = NULL
6429  *         cdef np.int64_t ind[3]
6430  *         cdef np.int64_t level = -1             # <<<<<<<<<<<<<<
6431  *         for i in range(3):
6432  *             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
6433  */
6434   __pyx_v_level = -1LL;
6435 
6436   /* "yt/geometry/oct_container.pyx":215
6437  *         cdef np.int64_t ind[3]
6438  *         cdef np.int64_t level = -1
6439  *         for i in range(3):             # <<<<<<<<<<<<<<
6440  *             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
6441  *             ind[i] = <np.int64_t> (floor((ppos[i] - self.DLE[i])/dds[i]))
6442  */
6443   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6444     __pyx_v_i = __pyx_t_1;
6445 
6446     /* "yt/geometry/oct_container.pyx":216
6447  *         cdef np.int64_t level = -1
6448  *         for i in range(3):
6449  *             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]             # <<<<<<<<<<<<<<
6450  *             ind[i] = <np.int64_t> (floor((ppos[i] - self.DLE[i])/dds[i]))
6451  *             cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
6452  */
6453     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i]));
6454 
6455     /* "yt/geometry/oct_container.pyx":217
6456  *         for i in range(3):
6457  *             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
6458  *             ind[i] = <np.int64_t> (floor((ppos[i] - self.DLE[i])/dds[i]))             # <<<<<<<<<<<<<<
6459  *             cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
6460  *             ipos[i] = 0 # We add this to ind later, so it should be zero.
6461  */
6462     (__pyx_v_ind[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)floor((((__pyx_v_ppos[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i]))));
6463 
6464     /* "yt/geometry/oct_container.pyx":218
6465  *             dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
6466  *             ind[i] = <np.int64_t> (floor((ppos[i] - self.DLE[i])/dds[i]))
6467  *             cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]             # <<<<<<<<<<<<<<
6468  *             ipos[i] = 0 # We add this to ind later, so it should be zero.
6469  *             ind32[i] = ind[i]
6470  */
6471     (__pyx_v_cp[__pyx_v_i]) = ((((__pyx_v_ind[__pyx_v_i]) + 0.5) * (__pyx_v_dds[__pyx_v_i])) + (__pyx_v_self->DLE[__pyx_v_i]));
6472 
6473     /* "yt/geometry/oct_container.pyx":219
6474  *             ind[i] = <np.int64_t> (floor((ppos[i] - self.DLE[i])/dds[i]))
6475  *             cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
6476  *             ipos[i] = 0 # We add this to ind later, so it should be zero.             # <<<<<<<<<<<<<<
6477  *             ind32[i] = ind[i]
6478  *         self.get_root(ind32, &next)
6479  */
6480     (__pyx_v_ipos[__pyx_v_i]) = 0;
6481 
6482     /* "yt/geometry/oct_container.pyx":220
6483  *             cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
6484  *             ipos[i] = 0 # We add this to ind later, so it should be zero.
6485  *             ind32[i] = ind[i]             # <<<<<<<<<<<<<<
6486  *         self.get_root(ind32, &next)
6487  *         # We want to stop recursing when there's nowhere else to go
6488  */
6489     (__pyx_v_ind32[__pyx_v_i]) = (__pyx_v_ind[__pyx_v_i]);
6490   }
6491 
6492   /* "yt/geometry/oct_container.pyx":221
6493  *             ipos[i] = 0 # We add this to ind later, so it should be zero.
6494  *             ind32[i] = ind[i]
6495  *         self.get_root(ind32, &next)             # <<<<<<<<<<<<<<
6496  *         # We want to stop recursing when there's nowhere else to go
6497  *         while next != NULL and level < max_level:
6498  */
6499   (void)(((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get_root(__pyx_v_self, __pyx_v_ind32, (&__pyx_v_next)));
6500 
6501   /* "yt/geometry/oct_container.pyx":223
6502  *         self.get_root(ind32, &next)
6503  *         # We want to stop recursing when there's nowhere else to go
6504  *         while next != NULL and level < max_level:             # <<<<<<<<<<<<<<
6505  *             level += 1
6506  *             for i in range(3):
6507  */
6508   while (1) {
6509     __pyx_t_3 = ((__pyx_v_next != NULL) != 0);
6510     if (__pyx_t_3) {
6511     } else {
6512       __pyx_t_2 = __pyx_t_3;
6513       goto __pyx_L7_bool_binop_done;
6514     }
6515     __pyx_t_3 = ((__pyx_v_level < __pyx_v_max_level) != 0);
6516     __pyx_t_2 = __pyx_t_3;
6517     __pyx_L7_bool_binop_done:;
6518     if (!__pyx_t_2) break;
6519 
6520     /* "yt/geometry/oct_container.pyx":224
6521  *         # We want to stop recursing when there's nowhere else to go
6522  *         while next != NULL and level < max_level:
6523  *             level += 1             # <<<<<<<<<<<<<<
6524  *             for i in range(3):
6525  *                 ipos[i] = (ipos[i] << 1) + ind[i]
6526  */
6527     __pyx_v_level = (__pyx_v_level + 1);
6528 
6529     /* "yt/geometry/oct_container.pyx":225
6530  *         while next != NULL and level < max_level:
6531  *             level += 1
6532  *             for i in range(3):             # <<<<<<<<<<<<<<
6533  *                 ipos[i] = (ipos[i] << 1) + ind[i]
6534  *             cur = next
6535  */
6536     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6537       __pyx_v_i = __pyx_t_1;
6538 
6539       /* "yt/geometry/oct_container.pyx":226
6540  *             level += 1
6541  *             for i in range(3):
6542  *                 ipos[i] = (ipos[i] << 1) + ind[i]             # <<<<<<<<<<<<<<
6543  *             cur = next
6544  *             for i in range(3):
6545  */
6546       (__pyx_v_ipos[__pyx_v_i]) = (((__pyx_v_ipos[__pyx_v_i]) << 1) + (__pyx_v_ind[__pyx_v_i]));
6547     }
6548 
6549     /* "yt/geometry/oct_container.pyx":227
6550  *             for i in range(3):
6551  *                 ipos[i] = (ipos[i] << 1) + ind[i]
6552  *             cur = next             # <<<<<<<<<<<<<<
6553  *             for i in range(3):
6554  *                 dds[i] = dds[i] / 2.0
6555  */
6556     __pyx_v_cur = __pyx_v_next;
6557 
6558     /* "yt/geometry/oct_container.pyx":228
6559  *                 ipos[i] = (ipos[i] << 1) + ind[i]
6560  *             cur = next
6561  *             for i in range(3):             # <<<<<<<<<<<<<<
6562  *                 dds[i] = dds[i] / 2.0
6563  *                 if cp[i] > ppos[i]:
6564  */
6565     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6566       __pyx_v_i = __pyx_t_1;
6567 
6568       /* "yt/geometry/oct_container.pyx":229
6569  *             cur = next
6570  *             for i in range(3):
6571  *                 dds[i] = dds[i] / 2.0             # <<<<<<<<<<<<<<
6572  *                 if cp[i] > ppos[i]:
6573  *                     ind[i] = 0
6574  */
6575       (__pyx_v_dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) / 2.0);
6576 
6577       /* "yt/geometry/oct_container.pyx":230
6578  *             for i in range(3):
6579  *                 dds[i] = dds[i] / 2.0
6580  *                 if cp[i] > ppos[i]:             # <<<<<<<<<<<<<<
6581  *                     ind[i] = 0
6582  *                     cp[i] -= dds[i] / 2.0
6583  */
6584       __pyx_t_2 = (((__pyx_v_cp[__pyx_v_i]) > (__pyx_v_ppos[__pyx_v_i])) != 0);
6585       if (__pyx_t_2) {
6586 
6587         /* "yt/geometry/oct_container.pyx":231
6588  *                 dds[i] = dds[i] / 2.0
6589  *                 if cp[i] > ppos[i]:
6590  *                     ind[i] = 0             # <<<<<<<<<<<<<<
6591  *                     cp[i] -= dds[i] / 2.0
6592  *                 else:
6593  */
6594         (__pyx_v_ind[__pyx_v_i]) = 0;
6595 
6596         /* "yt/geometry/oct_container.pyx":232
6597  *                 if cp[i] > ppos[i]:
6598  *                     ind[i] = 0
6599  *                     cp[i] -= dds[i] / 2.0             # <<<<<<<<<<<<<<
6600  *                 else:
6601  *                     ind[i] = 1
6602  */
6603         __pyx_t_4 = __pyx_v_i;
6604         (__pyx_v_cp[__pyx_t_4]) = ((__pyx_v_cp[__pyx_t_4]) - ((__pyx_v_dds[__pyx_v_i]) / 2.0));
6605 
6606         /* "yt/geometry/oct_container.pyx":230
6607  *             for i in range(3):
6608  *                 dds[i] = dds[i] / 2.0
6609  *                 if cp[i] > ppos[i]:             # <<<<<<<<<<<<<<
6610  *                     ind[i] = 0
6611  *                     cp[i] -= dds[i] / 2.0
6612  */
6613         goto __pyx_L13;
6614       }
6615 
6616       /* "yt/geometry/oct_container.pyx":234
6617  *                     cp[i] -= dds[i] / 2.0
6618  *                 else:
6619  *                     ind[i] = 1             # <<<<<<<<<<<<<<
6620  *                     cp[i] += dds[i]/2.0
6621  *             if cur.children != NULL:
6622  */
6623       /*else*/ {
6624         (__pyx_v_ind[__pyx_v_i]) = 1;
6625 
6626         /* "yt/geometry/oct_container.pyx":235
6627  *                 else:
6628  *                     ind[i] = 1
6629  *                     cp[i] += dds[i]/2.0             # <<<<<<<<<<<<<<
6630  *             if cur.children != NULL:
6631  *                 next = cur.children[cind(ind[0],ind[1],ind[2])]
6632  */
6633         __pyx_t_4 = __pyx_v_i;
6634         (__pyx_v_cp[__pyx_t_4]) = ((__pyx_v_cp[__pyx_t_4]) + ((__pyx_v_dds[__pyx_v_i]) / 2.0));
6635       }
6636       __pyx_L13:;
6637     }
6638 
6639     /* "yt/geometry/oct_container.pyx":236
6640  *                     ind[i] = 1
6641  *                     cp[i] += dds[i]/2.0
6642  *             if cur.children != NULL:             # <<<<<<<<<<<<<<
6643  *                 next = cur.children[cind(ind[0],ind[1],ind[2])]
6644  *             else:
6645  */
6646     __pyx_t_2 = ((__pyx_v_cur->children != NULL) != 0);
6647     if (__pyx_t_2) {
6648 
6649       /* "yt/geometry/oct_container.pyx":237
6650  *                     cp[i] += dds[i]/2.0
6651  *             if cur.children != NULL:
6652  *                 next = cur.children[cind(ind[0],ind[1],ind[2])]             # <<<<<<<<<<<<<<
6653  *             else:
6654  *                 next = NULL
6655  */
6656       __pyx_v_next = (__pyx_v_cur->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]);
6657 
6658       /* "yt/geometry/oct_container.pyx":236
6659  *                     ind[i] = 1
6660  *                     cp[i] += dds[i]/2.0
6661  *             if cur.children != NULL:             # <<<<<<<<<<<<<<
6662  *                 next = cur.children[cind(ind[0],ind[1],ind[2])]
6663  *             else:
6664  */
6665       goto __pyx_L14;
6666     }
6667 
6668     /* "yt/geometry/oct_container.pyx":239
6669  *                 next = cur.children[cind(ind[0],ind[1],ind[2])]
6670  *             else:
6671  *                 next = NULL             # <<<<<<<<<<<<<<
6672  *         if oinfo == NULL: return cur
6673  *         cdef int ncells = (1 << self.oref)
6674  */
6675     /*else*/ {
6676       __pyx_v_next = NULL;
6677     }
6678     __pyx_L14:;
6679   }
6680 
6681   /* "yt/geometry/oct_container.pyx":240
6682  *             else:
6683  *                 next = NULL
6684  *         if oinfo == NULL: return cur             # <<<<<<<<<<<<<<
6685  *         cdef int ncells = (1 << self.oref)
6686  *         cdef np.float64_t factor = 1.0 / (1 << (self.oref-1))
6687  */
6688   __pyx_t_2 = ((__pyx_v_oinfo == NULL) != 0);
6689   if (__pyx_t_2) {
6690     __pyx_r = __pyx_v_cur;
6691     goto __pyx_L0;
6692   }
6693 
6694   /* "yt/geometry/oct_container.pyx":241
6695  *                 next = NULL
6696  *         if oinfo == NULL: return cur
6697  *         cdef int ncells = (1 << self.oref)             # <<<<<<<<<<<<<<
6698  *         cdef np.float64_t factor = 1.0 / (1 << (self.oref-1))
6699  *         if self.oref == 0: factor = 2.0
6700  */
6701   __pyx_v_ncells = (1 << __pyx_v_self->oref);
6702 
6703   /* "yt/geometry/oct_container.pyx":242
6704  *         if oinfo == NULL: return cur
6705  *         cdef int ncells = (1 << self.oref)
6706  *         cdef np.float64_t factor = 1.0 / (1 << (self.oref-1))             # <<<<<<<<<<<<<<
6707  *         if self.oref == 0: factor = 2.0
6708  *         for i in range(3):
6709  */
6710   __pyx_v_factor = (1.0 / (1 << (__pyx_v_self->oref - 1)));
6711 
6712   /* "yt/geometry/oct_container.pyx":243
6713  *         cdef int ncells = (1 << self.oref)
6714  *         cdef np.float64_t factor = 1.0 / (1 << (self.oref-1))
6715  *         if self.oref == 0: factor = 2.0             # <<<<<<<<<<<<<<
6716  *         for i in range(3):
6717  *             # We don't normally need to change dds[i] as it has been halved
6718  */
6719   __pyx_t_2 = ((__pyx_v_self->oref == 0) != 0);
6720   if (__pyx_t_2) {
6721     __pyx_v_factor = 2.0;
6722   }
6723 
6724   /* "yt/geometry/oct_container.pyx":244
6725  *         cdef np.float64_t factor = 1.0 / (1 << (self.oref-1))
6726  *         if self.oref == 0: factor = 2.0
6727  *         for i in range(3):             # <<<<<<<<<<<<<<
6728  *             # We don't normally need to change dds[i] as it has been halved
6729  *             # from the oct width, thus making it already the cell width.
6730  */
6731   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
6732     __pyx_v_i = __pyx_t_1;
6733 
6734     /* "yt/geometry/oct_container.pyx":249
6735  *             # But, since not everything has the cell width equal to have the
6736  *             # width of the oct, we need to apply "factor".
6737  *             oinfo.dds[i] = dds[i] * factor # Cell width             # <<<<<<<<<<<<<<
6738  *             oinfo.ipos[i] = ipos[i]
6739  *             oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i]
6740  */
6741     (__pyx_v_oinfo->dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) * __pyx_v_factor);
6742 
6743     /* "yt/geometry/oct_container.pyx":250
6744  *             # width of the oct, we need to apply "factor".
6745  *             oinfo.dds[i] = dds[i] * factor # Cell width
6746  *             oinfo.ipos[i] = ipos[i]             # <<<<<<<<<<<<<<
6747  *             oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i]
6748  *         oinfo.level = level
6749  */
6750     (__pyx_v_oinfo->ipos[__pyx_v_i]) = (__pyx_v_ipos[__pyx_v_i]);
6751 
6752     /* "yt/geometry/oct_container.pyx":251
6753  *             oinfo.dds[i] = dds[i] * factor # Cell width
6754  *             oinfo.ipos[i] = ipos[i]
6755  *             oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i]             # <<<<<<<<<<<<<<
6756  *         oinfo.level = level
6757  *         return cur
6758  */
6759     (__pyx_v_oinfo->left_edge[__pyx_v_i]) = (((__pyx_v_oinfo->ipos[__pyx_v_i]) * ((__pyx_v_oinfo->dds[__pyx_v_i]) * __pyx_v_ncells)) + (__pyx_v_self->DLE[__pyx_v_i]));
6760   }
6761 
6762   /* "yt/geometry/oct_container.pyx":252
6763  *             oinfo.ipos[i] = ipos[i]
6764  *             oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i]
6765  *         oinfo.level = level             # <<<<<<<<<<<<<<
6766  *         return cur
6767  *
6768  */
6769   __pyx_v_oinfo->level = __pyx_v_level;
6770 
6771   /* "yt/geometry/oct_container.pyx":253
6772  *             oinfo.left_edge[i] = oinfo.ipos[i] * (oinfo.dds[i] * ncells) + self.DLE[i]
6773  *         oinfo.level = level
6774  *         return cur             # <<<<<<<<<<<<<<
6775  *
6776  *     def locate_positions(self, np.float64_t[:,:] positions):
6777  */
6778   __pyx_r = __pyx_v_cur;
6779   goto __pyx_L0;
6780 
6781   /* "yt/geometry/oct_container.pyx":201
6782  *     @cython.wraparound(False)
6783  *     @cython.cdivision(True)
6784  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = NULL,             # <<<<<<<<<<<<<<
6785  *                   int max_level = 99) nogil:
6786  *         #Given a floating point position, retrieve the most
6787  */
6788 
6789   /* function exit code */
6790   __pyx_L0:;
6791   return __pyx_r;
6792 }
6793 
6794 /* "yt/geometry/oct_container.pyx":255
6795  *         return cur
6796  *
6797  *     def locate_positions(self, np.float64_t[:,:] positions):             # <<<<<<<<<<<<<<
6798  *         """
6799  *         This routine, meant to be called by other internal routines, returns a
6800  */
6801 
6802 /* Python wrapper */
6803 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions); /*proto*/
6804 static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions[] = "\n        This routine, meant to be called by other internal routines, returns a\n        list of oct IDs and a dictionary of Oct info for all the positions\n        supplied.  Positions must be in code_length.\n        ";
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions(PyObject * __pyx_v_self,PyObject * __pyx_arg_positions)6805 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions(PyObject *__pyx_v_self, PyObject *__pyx_arg_positions) {
6806   __Pyx_memviewslice __pyx_v_positions = { 0, 0, { 0 }, { 0 }, { 0 } };
6807   PyObject *__pyx_r = 0;
6808   __Pyx_RefNannyDeclarations
6809   __Pyx_RefNannySetupContext("locate_positions (wrapper)", 0);
6810   assert(__pyx_arg_positions); {
6811     __pyx_v_positions = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(__pyx_arg_positions, PyBUF_WRITABLE); if (unlikely(!__pyx_v_positions.memview)) __PYX_ERR(0, 255, __pyx_L3_error)
6812   }
6813   goto __pyx_L4_argument_unpacking_done;
6814   __pyx_L3_error:;
6815   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.locate_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
6816   __Pyx_RefNannyFinishContext();
6817   return NULL;
6818   __pyx_L4_argument_unpacking_done:;
6819   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_positions);
6820 
6821   /* function exit code */
6822   __Pyx_RefNannyFinishContext();
6823   return __pyx_r;
6824 }
6825 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,__Pyx_memviewslice __pyx_v_positions)6826 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __Pyx_memviewslice __pyx_v_positions) {
6827   __pyx_t_5numpy_float64_t __pyx_v_factor;
6828   PyObject *__pyx_v_all_octs = 0;
6829   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo __pyx_v_oi;
6830   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o;
6831   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
6832   PyArrayObject *__pyx_v_recorded = 0;
6833   PyArrayObject *__pyx_v_oct_id = 0;
6834   __pyx_t_5numpy_int64_t __pyx_v_i;
6835   __pyx_t_5numpy_int64_t __pyx_v_j;
6836   PyObject *__pyx_v_left_edge = NULL;
6837   PyObject *__pyx_v_dds = NULL;
6838   PyObject *__pyx_v_right_edge = NULL;
6839   __Pyx_LocalBuf_ND __pyx_pybuffernd_oct_id;
6840   __Pyx_Buffer __pyx_pybuffer_oct_id;
6841   __Pyx_LocalBuf_ND __pyx_pybuffernd_recorded;
6842   __Pyx_Buffer __pyx_pybuffer_recorded;
6843   PyObject *__pyx_r = NULL;
6844   __Pyx_RefNannyDeclarations
6845   PyObject *__pyx_t_1 = NULL;
6846   PyObject *__pyx_t_2 = NULL;
6847   PyObject *__pyx_t_3 = NULL;
6848   PyObject *__pyx_t_4 = NULL;
6849   PyArrayObject *__pyx_t_5 = NULL;
6850   int __pyx_t_6;
6851   PyObject *__pyx_t_7 = NULL;
6852   PyObject *__pyx_t_8 = NULL;
6853   PyObject *__pyx_t_9 = NULL;
6854   PyArrayObject *__pyx_t_10 = NULL;
6855   Py_ssize_t __pyx_t_11;
6856   Py_ssize_t __pyx_t_12;
6857   __pyx_t_5numpy_int64_t __pyx_t_13;
6858   __pyx_t_5numpy_int64_t __pyx_t_14;
6859   __pyx_t_5numpy_int64_t __pyx_t_15;
6860   __pyx_t_5numpy_int64_t __pyx_t_16;
6861   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_17;
6862   struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get __pyx_t_18;
6863   int __pyx_t_19;
6864   __pyx_t_5numpy_float64_t *__pyx_t_20;
6865   struct __pyx_array_obj *__pyx_t_21 = NULL;
6866   PyObject *__pyx_t_22 = NULL;
6867   __pyx_t_5numpy_int64_t __pyx_t_23;
6868   __pyx_t_5numpy_int64_t __pyx_t_24;
6869   __pyx_t_5numpy_int64_t __pyx_t_25;
6870   __Pyx_RefNannySetupContext("locate_positions", 0);
6871   __pyx_pybuffer_recorded.pybuffer.buf = NULL;
6872   __pyx_pybuffer_recorded.refcount = 0;
6873   __pyx_pybuffernd_recorded.data = NULL;
6874   __pyx_pybuffernd_recorded.rcbuffer = &__pyx_pybuffer_recorded;
6875   __pyx_pybuffer_oct_id.pybuffer.buf = NULL;
6876   __pyx_pybuffer_oct_id.refcount = 0;
6877   __pyx_pybuffernd_oct_id.data = NULL;
6878   __pyx_pybuffernd_oct_id.rcbuffer = &__pyx_pybuffer_oct_id;
6879 
6880   /* "yt/geometry/oct_container.pyx":261
6881  *         supplied.  Positions must be in code_length.
6882  *         """
6883  *         cdef np.float64_t factor = (1 << self.oref)             # <<<<<<<<<<<<<<
6884  *         cdef dict all_octs = {}
6885  *         cdef OctInfo oi
6886  */
6887   __pyx_v_factor = (1 << __pyx_v_self->oref);
6888 
6889   /* "yt/geometry/oct_container.pyx":262
6890  *         """
6891  *         cdef np.float64_t factor = (1 << self.oref)
6892  *         cdef dict all_octs = {}             # <<<<<<<<<<<<<<
6893  *         cdef OctInfo oi
6894  *         cdef Oct* o = NULL
6895  */
6896   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
6897   __Pyx_GOTREF(__pyx_t_1);
6898   __pyx_v_all_octs = ((PyObject*)__pyx_t_1);
6899   __pyx_t_1 = 0;
6900 
6901   /* "yt/geometry/oct_container.pyx":264
6902  *         cdef dict all_octs = {}
6903  *         cdef OctInfo oi
6904  *         cdef Oct* o = NULL             # <<<<<<<<<<<<<<
6905  *         cdef np.float64_t pos[3]
6906  *         cdef np.ndarray[np.uint8_t, ndim=1] recorded
6907  */
6908   __pyx_v_o = NULL;
6909 
6910   /* "yt/geometry/oct_container.pyx":268
6911  *         cdef np.ndarray[np.uint8_t, ndim=1] recorded
6912  *         cdef np.ndarray[np.int64_t, ndim=1] oct_id
6913  *         oct_id = np.ones(positions.shape[0], dtype="int64") * -1             # <<<<<<<<<<<<<<
6914  *         recorded = np.zeros(self.nocts, dtype="uint8")
6915  *         cdef np.int64_t i, j, k
6916  */
6917   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6918   __Pyx_GOTREF(__pyx_t_1);
6919   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
6920   __Pyx_GOTREF(__pyx_t_2);
6921   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6922   __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_positions.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6923   __Pyx_GOTREF(__pyx_t_1);
6924   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
6925   __Pyx_GOTREF(__pyx_t_3);
6926   __Pyx_GIVEREF(__pyx_t_1);
6927   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
6928   __pyx_t_1 = 0;
6929   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6930   __Pyx_GOTREF(__pyx_t_1);
6931   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
6932   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
6933   __Pyx_GOTREF(__pyx_t_4);
6934   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6935   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6936   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6937   __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6938   __Pyx_GOTREF(__pyx_t_1);
6939   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6940   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 268, __pyx_L1_error)
6941   __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
6942   {
6943     __Pyx_BufFmt_StackElem __pyx_stack[1];
6944     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_id.rcbuffer->pybuffer);
6945     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oct_id.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
6946     if (unlikely(__pyx_t_6 < 0)) {
6947       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
6948       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_oct_id.rcbuffer->pybuffer, (PyObject*)__pyx_v_oct_id, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
6949         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
6950         __Pyx_RaiseBufferFallbackError();
6951       } else {
6952         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
6953       }
6954       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
6955     }
6956     __pyx_pybuffernd_oct_id.diminfo[0].strides = __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_oct_id.diminfo[0].shape = __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.shape[0];
6957     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
6958   }
6959   __pyx_t_5 = 0;
6960   __pyx_v_oct_id = ((PyArrayObject *)__pyx_t_1);
6961   __pyx_t_1 = 0;
6962 
6963   /* "yt/geometry/oct_container.pyx":269
6964  *         cdef np.ndarray[np.int64_t, ndim=1] oct_id
6965  *         oct_id = np.ones(positions.shape[0], dtype="int64") * -1
6966  *         recorded = np.zeros(self.nocts, dtype="uint8")             # <<<<<<<<<<<<<<
6967  *         cdef np.int64_t i, j, k
6968  *         for i in range(positions.shape[0]):
6969  */
6970   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6971   __Pyx_GOTREF(__pyx_t_1);
6972   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
6973   __Pyx_GOTREF(__pyx_t_4);
6974   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6975   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6976   __Pyx_GOTREF(__pyx_t_1);
6977   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
6978   __Pyx_GOTREF(__pyx_t_3);
6979   __Pyx_GIVEREF(__pyx_t_1);
6980   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
6981   __pyx_t_1 = 0;
6982   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6983   __Pyx_GOTREF(__pyx_t_1);
6984   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
6985   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
6986   __Pyx_GOTREF(__pyx_t_2);
6987   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6988   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6989   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6990   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 269, __pyx_L1_error)
6991   __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
6992   {
6993     __Pyx_BufFmt_StackElem __pyx_stack[1];
6994     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_recorded.rcbuffer->pybuffer);
6995     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_recorded.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
6996     if (unlikely(__pyx_t_6 < 0)) {
6997       PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
6998       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_recorded.rcbuffer->pybuffer, (PyObject*)__pyx_v_recorded, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
6999         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
7000         __Pyx_RaiseBufferFallbackError();
7001       } else {
7002         PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
7003       }
7004       __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
7005     }
7006     __pyx_pybuffernd_recorded.diminfo[0].strides = __pyx_pybuffernd_recorded.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_recorded.diminfo[0].shape = __pyx_pybuffernd_recorded.rcbuffer->pybuffer.shape[0];
7007     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
7008   }
7009   __pyx_t_10 = 0;
7010   __pyx_v_recorded = ((PyArrayObject *)__pyx_t_2);
7011   __pyx_t_2 = 0;
7012 
7013   /* "yt/geometry/oct_container.pyx":271
7014  *         recorded = np.zeros(self.nocts, dtype="uint8")
7015  *         cdef np.int64_t i, j, k
7016  *         for i in range(positions.shape[0]):             # <<<<<<<<<<<<<<
7017  *             for j in range(3):
7018  *                 pos[j] = positions[i,j]
7019  */
7020   __pyx_t_11 = (__pyx_v_positions.shape[0]);
7021   __pyx_t_12 = __pyx_t_11;
7022   for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
7023     __pyx_v_i = __pyx_t_13;
7024 
7025     /* "yt/geometry/oct_container.pyx":272
7026  *         cdef np.int64_t i, j, k
7027  *         for i in range(positions.shape[0]):
7028  *             for j in range(3):             # <<<<<<<<<<<<<<
7029  *                 pos[j] = positions[i,j]
7030  *             o = self.get(pos, &oi)
7031  */
7032     for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) {
7033       __pyx_v_j = __pyx_t_14;
7034 
7035       /* "yt/geometry/oct_container.pyx":273
7036  *         for i in range(positions.shape[0]):
7037  *             for j in range(3):
7038  *                 pos[j] = positions[i,j]             # <<<<<<<<<<<<<<
7039  *             o = self.get(pos, &oi)
7040  *             if o == NULL:
7041  */
7042       __pyx_t_15 = __pyx_v_i;
7043       __pyx_t_16 = __pyx_v_j;
7044       __pyx_t_6 = -1;
7045       if (__pyx_t_15 < 0) {
7046         __pyx_t_15 += __pyx_v_positions.shape[0];
7047         if (unlikely(__pyx_t_15 < 0)) __pyx_t_6 = 0;
7048       } else if (unlikely(__pyx_t_15 >= __pyx_v_positions.shape[0])) __pyx_t_6 = 0;
7049       if (__pyx_t_16 < 0) {
7050         __pyx_t_16 += __pyx_v_positions.shape[1];
7051         if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 1;
7052       } else if (unlikely(__pyx_t_16 >= __pyx_v_positions.shape[1])) __pyx_t_6 = 1;
7053       if (unlikely(__pyx_t_6 != -1)) {
7054         __Pyx_RaiseBufferIndexError(__pyx_t_6);
7055         __PYX_ERR(0, 273, __pyx_L1_error)
7056       }
7057       (__pyx_v_pos[__pyx_v_j]) = (*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_positions.data + __pyx_t_15 * __pyx_v_positions.strides[0]) ) + __pyx_t_16 * __pyx_v_positions.strides[1]) )));
7058     }
7059 
7060     /* "yt/geometry/oct_container.pyx":274
7061  *             for j in range(3):
7062  *                 pos[j] = positions[i,j]
7063  *             o = self.get(pos, &oi)             # <<<<<<<<<<<<<<
7064  *             if o == NULL:
7065  *                 raise RuntimeError
7066  */
7067     __pyx_t_18.__pyx_n = 1;
7068     __pyx_t_18.oinfo = (&__pyx_v_oi);
7069     __pyx_t_17 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, __pyx_v_pos, &__pyx_t_18);
7070     __pyx_v_o = __pyx_t_17;
7071 
7072     /* "yt/geometry/oct_container.pyx":275
7073  *                 pos[j] = positions[i,j]
7074  *             o = self.get(pos, &oi)
7075  *             if o == NULL:             # <<<<<<<<<<<<<<
7076  *                 raise RuntimeError
7077  *             if recorded[o.domain_ind] == 0:
7078  */
7079     __pyx_t_19 = ((__pyx_v_o == NULL) != 0);
7080     if (unlikely(__pyx_t_19)) {
7081 
7082       /* "yt/geometry/oct_container.pyx":276
7083  *             o = self.get(pos, &oi)
7084  *             if o == NULL:
7085  *                 raise RuntimeError             # <<<<<<<<<<<<<<
7086  *             if recorded[o.domain_ind] == 0:
7087  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()
7088  */
7089       __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
7090       __PYX_ERR(0, 276, __pyx_L1_error)
7091 
7092       /* "yt/geometry/oct_container.pyx":275
7093  *                 pos[j] = positions[i,j]
7094  *             o = self.get(pos, &oi)
7095  *             if o == NULL:             # <<<<<<<<<<<<<<
7096  *                 raise RuntimeError
7097  *             if recorded[o.domain_ind] == 0:
7098  */
7099     }
7100 
7101     /* "yt/geometry/oct_container.pyx":277
7102  *             if o == NULL:
7103  *                 raise RuntimeError
7104  *             if recorded[o.domain_ind] == 0:             # <<<<<<<<<<<<<<
7105  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()
7106  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()
7107  */
7108     __pyx_t_14 = __pyx_v_o->domain_ind;
7109     __pyx_t_6 = -1;
7110     if (__pyx_t_14 < 0) {
7111       __pyx_t_14 += __pyx_pybuffernd_recorded.diminfo[0].shape;
7112       if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
7113     } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_recorded.diminfo[0].shape)) __pyx_t_6 = 0;
7114     if (unlikely(__pyx_t_6 != -1)) {
7115       __Pyx_RaiseBufferIndexError(__pyx_t_6);
7116       __PYX_ERR(0, 277, __pyx_L1_error)
7117     }
7118     __pyx_t_19 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_recorded.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_recorded.diminfo[0].strides)) == 0) != 0);
7119     if (__pyx_t_19) {
7120 
7121       /* "yt/geometry/oct_container.pyx":278
7122  *                 raise RuntimeError
7123  *             if recorded[o.domain_ind] == 0:
7124  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()             # <<<<<<<<<<<<<<
7125  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()
7126  *                 right_edge = left_edge + dds*factor
7127  */
7128       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
7129       __Pyx_GOTREF(__pyx_t_3);
7130       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
7131       __Pyx_GOTREF(__pyx_t_4);
7132       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7133       __pyx_t_20 = __pyx_v_oi.left_edge;
7134       if (!__pyx_t_20) {
7135         PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
7136         __PYX_ERR(0, 278, __pyx_L1_error)
7137       }
7138       __pyx_t_22 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t);
7139       __pyx_t_3 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)3));
7140       if (unlikely(!__pyx_t_22 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_22))) __PYX_ERR(0, 278, __pyx_L1_error)
7141       __Pyx_GOTREF(__pyx_t_22);
7142       __Pyx_GOTREF(__pyx_t_3);
7143       __pyx_t_21 = __pyx_array_new(__pyx_t_3, sizeof(__pyx_t_5numpy_float64_t), PyBytes_AS_STRING(__pyx_t_22), (char *) "c", (char *) __pyx_t_20);
7144       if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 278, __pyx_L1_error)
7145       __Pyx_GOTREF(__pyx_t_21);
7146       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7147       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7148       __pyx_t_22 = NULL;
7149       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7150         __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_4);
7151         if (likely(__pyx_t_22)) {
7152           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7153           __Pyx_INCREF(__pyx_t_22);
7154           __Pyx_INCREF(function);
7155           __Pyx_DECREF_SET(__pyx_t_4, function);
7156         }
7157       }
7158       __pyx_t_1 = (__pyx_t_22) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_22, ((PyObject *)__pyx_t_21)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_21));
7159       __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7160       __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
7161       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
7162       __Pyx_GOTREF(__pyx_t_1);
7163       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7164       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
7165       __Pyx_GOTREF(__pyx_t_4);
7166       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7167       __pyx_t_1 = NULL;
7168       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
7169         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
7170         if (likely(__pyx_t_1)) {
7171           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7172           __Pyx_INCREF(__pyx_t_1);
7173           __Pyx_INCREF(function);
7174           __Pyx_DECREF_SET(__pyx_t_4, function);
7175         }
7176       }
7177       __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
7178       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7179       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
7180       __Pyx_GOTREF(__pyx_t_2);
7181       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7182       __Pyx_XDECREF_SET(__pyx_v_left_edge, __pyx_t_2);
7183       __pyx_t_2 = 0;
7184 
7185       /* "yt/geometry/oct_container.pyx":279
7186  *             if recorded[o.domain_ind] == 0:
7187  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()
7188  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()             # <<<<<<<<<<<<<<
7189  *                 right_edge = left_edge + dds*factor
7190  *                 all_octs[o.domain_ind] = dict(
7191  */
7192       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7193       __Pyx_GOTREF(__pyx_t_1);
7194       __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 279, __pyx_L1_error)
7195       __Pyx_GOTREF(__pyx_t_22);
7196       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7197       __pyx_t_20 = __pyx_v_oi.dds;
7198       if (!__pyx_t_20) {
7199         PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
7200         __PYX_ERR(0, 279, __pyx_L1_error)
7201       }
7202       __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t);
7203       __pyx_t_1 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)3));
7204       if (unlikely(!__pyx_t_3 || !__pyx_t_1 || !PyBytes_AsString(__pyx_t_3))) __PYX_ERR(0, 279, __pyx_L1_error)
7205       __Pyx_GOTREF(__pyx_t_3);
7206       __Pyx_GOTREF(__pyx_t_1);
7207       __pyx_t_21 = __pyx_array_new(__pyx_t_1, sizeof(__pyx_t_5numpy_float64_t), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_20);
7208       if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 279, __pyx_L1_error)
7209       __Pyx_GOTREF(__pyx_t_21);
7210       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7211       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7212       __pyx_t_3 = NULL;
7213       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) {
7214         __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_22);
7215         if (likely(__pyx_t_3)) {
7216           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
7217           __Pyx_INCREF(__pyx_t_3);
7218           __Pyx_INCREF(function);
7219           __Pyx_DECREF_SET(__pyx_t_22, function);
7220         }
7221       }
7222       __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_22, __pyx_t_3, ((PyObject *)__pyx_t_21)) : __Pyx_PyObject_CallOneArg(__pyx_t_22, ((PyObject *)__pyx_t_21));
7223       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7224       __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
7225       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
7226       __Pyx_GOTREF(__pyx_t_4);
7227       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7228       __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 279, __pyx_L1_error)
7229       __Pyx_GOTREF(__pyx_t_22);
7230       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7231       __pyx_t_4 = NULL;
7232       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_22))) {
7233         __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_22);
7234         if (likely(__pyx_t_4)) {
7235           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
7236           __Pyx_INCREF(__pyx_t_4);
7237           __Pyx_INCREF(function);
7238           __Pyx_DECREF_SET(__pyx_t_22, function);
7239         }
7240       }
7241       __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_22);
7242       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7243       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error)
7244       __Pyx_GOTREF(__pyx_t_2);
7245       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7246       __Pyx_XDECREF_SET(__pyx_v_dds, __pyx_t_2);
7247       __pyx_t_2 = 0;
7248 
7249       /* "yt/geometry/oct_container.pyx":280
7250  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()
7251  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()
7252  *                 right_edge = left_edge + dds*factor             # <<<<<<<<<<<<<<
7253  *                 all_octs[o.domain_ind] = dict(
7254  *                     left_edge = left_edge,
7255  */
7256       __pyx_t_2 = PyFloat_FromDouble(__pyx_v_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
7257       __Pyx_GOTREF(__pyx_t_2);
7258       __pyx_t_22 = PyNumber_Multiply(__pyx_v_dds, __pyx_t_2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 280, __pyx_L1_error)
7259       __Pyx_GOTREF(__pyx_t_22);
7260       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7261       __pyx_t_2 = PyNumber_Add(__pyx_v_left_edge, __pyx_t_22); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
7262       __Pyx_GOTREF(__pyx_t_2);
7263       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7264       __Pyx_XDECREF_SET(__pyx_v_right_edge, __pyx_t_2);
7265       __pyx_t_2 = 0;
7266 
7267       /* "yt/geometry/oct_container.pyx":282
7268  *                 right_edge = left_edge + dds*factor
7269  *                 all_octs[o.domain_ind] = dict(
7270  *                     left_edge = left_edge,             # <<<<<<<<<<<<<<
7271  *                     right_edge = right_edge,
7272  *                     level = oi.level
7273  */
7274       __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
7275       __Pyx_GOTREF(__pyx_t_2);
7276       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_left_edge, __pyx_v_left_edge) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
7277 
7278       /* "yt/geometry/oct_container.pyx":283
7279  *                 all_octs[o.domain_ind] = dict(
7280  *                     left_edge = left_edge,
7281  *                     right_edge = right_edge,             # <<<<<<<<<<<<<<
7282  *                     level = oi.level
7283  *                 )
7284  */
7285       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_right_edge, __pyx_v_right_edge) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
7286 
7287       /* "yt/geometry/oct_container.pyx":284
7288  *                     left_edge = left_edge,
7289  *                     right_edge = right_edge,
7290  *                     level = oi.level             # <<<<<<<<<<<<<<
7291  *                 )
7292  *                 recorded[o.domain_ind] = 1
7293  */
7294       __pyx_t_22 = __Pyx_PyInt_From_npy_int32(__pyx_v_oi.level); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 284, __pyx_L1_error)
7295       __Pyx_GOTREF(__pyx_t_22);
7296       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_t_22) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
7297       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7298 
7299       /* "yt/geometry/oct_container.pyx":281
7300  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()
7301  *                 right_edge = left_edge + dds*factor
7302  *                 all_octs[o.domain_ind] = dict(             # <<<<<<<<<<<<<<
7303  *                     left_edge = left_edge,
7304  *                     right_edge = right_edge,
7305  */
7306       __pyx_t_22 = __Pyx_PyInt_From_npy_int64(__pyx_v_o->domain_ind); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 281, __pyx_L1_error)
7307       __Pyx_GOTREF(__pyx_t_22);
7308       if (unlikely(PyDict_SetItem(__pyx_v_all_octs, __pyx_t_22, __pyx_t_2) < 0)) __PYX_ERR(0, 281, __pyx_L1_error)
7309       __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7310       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7311 
7312       /* "yt/geometry/oct_container.pyx":286
7313  *                     level = oi.level
7314  *                 )
7315  *                 recorded[o.domain_ind] = 1             # <<<<<<<<<<<<<<
7316  *             oct_id[i] = o.domain_ind
7317  *         return oct_id, all_octs
7318  */
7319       __pyx_t_23 = __pyx_v_o->domain_ind;
7320       __pyx_t_6 = -1;
7321       if (__pyx_t_23 < 0) {
7322         __pyx_t_23 += __pyx_pybuffernd_recorded.diminfo[0].shape;
7323         if (unlikely(__pyx_t_23 < 0)) __pyx_t_6 = 0;
7324       } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_recorded.diminfo[0].shape)) __pyx_t_6 = 0;
7325       if (unlikely(__pyx_t_6 != -1)) {
7326         __Pyx_RaiseBufferIndexError(__pyx_t_6);
7327         __PYX_ERR(0, 286, __pyx_L1_error)
7328       }
7329       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_recorded.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_recorded.diminfo[0].strides) = 1;
7330 
7331       /* "yt/geometry/oct_container.pyx":277
7332  *             if o == NULL:
7333  *                 raise RuntimeError
7334  *             if recorded[o.domain_ind] == 0:             # <<<<<<<<<<<<<<
7335  *                 left_edge = np.asarray(<np.float64_t[:3]>oi.left_edge).copy()
7336  *                 dds = np.asarray(<np.float64_t[:3]>oi.dds).copy()
7337  */
7338     }
7339 
7340     /* "yt/geometry/oct_container.pyx":287
7341  *                 )
7342  *                 recorded[o.domain_ind] = 1
7343  *             oct_id[i] = o.domain_ind             # <<<<<<<<<<<<<<
7344  *         return oct_id, all_octs
7345  *
7346  */
7347     __pyx_t_24 = __pyx_v_o->domain_ind;
7348     __pyx_t_25 = __pyx_v_i;
7349     __pyx_t_6 = -1;
7350     if (__pyx_t_25 < 0) {
7351       __pyx_t_25 += __pyx_pybuffernd_oct_id.diminfo[0].shape;
7352       if (unlikely(__pyx_t_25 < 0)) __pyx_t_6 = 0;
7353     } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_oct_id.diminfo[0].shape)) __pyx_t_6 = 0;
7354     if (unlikely(__pyx_t_6 != -1)) {
7355       __Pyx_RaiseBufferIndexError(__pyx_t_6);
7356       __PYX_ERR(0, 287, __pyx_L1_error)
7357     }
7358     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_oct_id.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_oct_id.diminfo[0].strides) = __pyx_t_24;
7359   }
7360 
7361   /* "yt/geometry/oct_container.pyx":288
7362  *                 recorded[o.domain_ind] = 1
7363  *             oct_id[i] = o.domain_ind
7364  *         return oct_id, all_octs             # <<<<<<<<<<<<<<
7365  *
7366  *     def domain_identify(self, SelectorObject selector):
7367  */
7368   __Pyx_XDECREF(__pyx_r);
7369   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
7370   __Pyx_GOTREF(__pyx_t_2);
7371   __Pyx_INCREF(((PyObject *)__pyx_v_oct_id));
7372   __Pyx_GIVEREF(((PyObject *)__pyx_v_oct_id));
7373   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_oct_id));
7374   __Pyx_INCREF(__pyx_v_all_octs);
7375   __Pyx_GIVEREF(__pyx_v_all_octs);
7376   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_all_octs);
7377   __pyx_r = __pyx_t_2;
7378   __pyx_t_2 = 0;
7379   goto __pyx_L0;
7380 
7381   /* "yt/geometry/oct_container.pyx":255
7382  *         return cur
7383  *
7384  *     def locate_positions(self, np.float64_t[:,:] positions):             # <<<<<<<<<<<<<<
7385  *         """
7386  *         This routine, meant to be called by other internal routines, returns a
7387  */
7388 
7389   /* function exit code */
7390   __pyx_L1_error:;
7391   __Pyx_XDECREF(__pyx_t_1);
7392   __Pyx_XDECREF(__pyx_t_2);
7393   __Pyx_XDECREF(__pyx_t_3);
7394   __Pyx_XDECREF(__pyx_t_4);
7395   __Pyx_XDECREF(((PyObject *)__pyx_t_21));
7396   __Pyx_XDECREF(__pyx_t_22);
7397   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7398     __Pyx_PyThreadState_declare
7399     __Pyx_PyThreadState_assign
7400     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7401     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_id.rcbuffer->pybuffer);
7402     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_recorded.rcbuffer->pybuffer);
7403   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7404   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.locate_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
7405   __pyx_r = NULL;
7406   goto __pyx_L2;
7407   __pyx_L0:;
7408   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_oct_id.rcbuffer->pybuffer);
7409   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_recorded.rcbuffer->pybuffer);
7410   __pyx_L2:;
7411   __PYX_XDEC_MEMVIEW(&__pyx_v_positions, 1);
7412   __Pyx_XDECREF(__pyx_v_all_octs);
7413   __Pyx_XDECREF((PyObject *)__pyx_v_recorded);
7414   __Pyx_XDECREF((PyObject *)__pyx_v_oct_id);
7415   __Pyx_XDECREF(__pyx_v_left_edge);
7416   __Pyx_XDECREF(__pyx_v_dds);
7417   __Pyx_XDECREF(__pyx_v_right_edge);
7418   __Pyx_XGIVEREF(__pyx_r);
7419   __Pyx_RefNannyFinishContext();
7420   return __pyx_r;
7421 }
7422 
7423 /* "yt/geometry/oct_container.pyx":290
7424  *         return oct_id, all_octs
7425  *
7426  *     def domain_identify(self, SelectorObject selector):             # <<<<<<<<<<<<<<
7427  *         cdef np.ndarray[np.uint8_t, ndim=1] domain_mask
7428  *         domain_mask = np.zeros(self.num_domains, dtype="uint8")
7429  */
7430 
7431 /* Python wrapper */
7432 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify(PyObject * __pyx_v_self,PyObject * __pyx_v_selector)7433 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) {
7434   PyObject *__pyx_r = 0;
7435   __Pyx_RefNannyDeclarations
7436   __Pyx_RefNannySetupContext("domain_identify (wrapper)", 0);
7437   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 290, __pyx_L1_error)
7438   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector));
7439 
7440   /* function exit code */
7441   goto __pyx_L0;
7442   __pyx_L1_error:;
7443   __pyx_r = NULL;
7444   __pyx_L0:;
7445   __Pyx_RefNannyFinishContext();
7446   return __pyx_r;
7447 }
7448 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector)7449 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10domain_identify(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
7450   PyArrayObject *__pyx_v_domain_mask = 0;
7451   struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_v_visitor = 0;
7452   int __pyx_v_i;
7453   PyObject *__pyx_v_domain_ids = NULL;
7454   __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_mask;
7455   __Pyx_Buffer __pyx_pybuffer_domain_mask;
7456   PyObject *__pyx_r = NULL;
7457   __Pyx_RefNannyDeclarations
7458   PyObject *__pyx_t_1 = NULL;
7459   PyObject *__pyx_t_2 = NULL;
7460   PyObject *__pyx_t_3 = NULL;
7461   PyObject *__pyx_t_4 = NULL;
7462   PyArrayObject *__pyx_t_5 = NULL;
7463   int __pyx_t_6;
7464   PyObject *__pyx_t_7 = NULL;
7465   PyObject *__pyx_t_8 = NULL;
7466   PyObject *__pyx_t_9 = NULL;
7467   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
7468   int __pyx_t_11;
7469   int __pyx_t_12;
7470   Py_ssize_t __pyx_t_13;
7471   int __pyx_t_14;
7472   int __pyx_t_15;
7473   int __pyx_t_16;
7474   __Pyx_RefNannySetupContext("domain_identify", 0);
7475   __pyx_pybuffer_domain_mask.pybuffer.buf = NULL;
7476   __pyx_pybuffer_domain_mask.refcount = 0;
7477   __pyx_pybuffernd_domain_mask.data = NULL;
7478   __pyx_pybuffernd_domain_mask.rcbuffer = &__pyx_pybuffer_domain_mask;
7479 
7480   /* "yt/geometry/oct_container.pyx":292
7481  *     def domain_identify(self, SelectorObject selector):
7482  *         cdef np.ndarray[np.uint8_t, ndim=1] domain_mask
7483  *         domain_mask = np.zeros(self.num_domains, dtype="uint8")             # <<<<<<<<<<<<<<
7484  *         cdef oct_visitors.IdentifyOcts visitor
7485  *         visitor = oct_visitors.IdentifyOcts(self)
7486  */
7487   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
7488   __Pyx_GOTREF(__pyx_t_1);
7489   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
7490   __Pyx_GOTREF(__pyx_t_2);
7491   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7492   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
7493   __Pyx_GOTREF(__pyx_t_1);
7494   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
7495   __Pyx_GOTREF(__pyx_t_3);
7496   __Pyx_GIVEREF(__pyx_t_1);
7497   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
7498   __pyx_t_1 = 0;
7499   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
7500   __Pyx_GOTREF(__pyx_t_1);
7501   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
7502   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
7503   __Pyx_GOTREF(__pyx_t_4);
7504   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7505   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7506   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7507   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 292, __pyx_L1_error)
7508   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
7509   {
7510     __Pyx_BufFmt_StackElem __pyx_stack[1];
7511     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_mask.rcbuffer->pybuffer);
7512     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7513     if (unlikely(__pyx_t_6 < 0)) {
7514       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
7515       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7516         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
7517         __Pyx_RaiseBufferFallbackError();
7518       } else {
7519         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7520       }
7521       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
7522     }
7523     __pyx_pybuffernd_domain_mask.diminfo[0].strides = __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_mask.diminfo[0].shape = __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.shape[0];
7524     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
7525   }
7526   __pyx_t_5 = 0;
7527   __pyx_v_domain_mask = ((PyArrayObject *)__pyx_t_4);
7528   __pyx_t_4 = 0;
7529 
7530   /* "yt/geometry/oct_container.pyx":294
7531  *         domain_mask = np.zeros(self.num_domains, dtype="uint8")
7532  *         cdef oct_visitors.IdentifyOcts visitor
7533  *         visitor = oct_visitors.IdentifyOcts(self)             # <<<<<<<<<<<<<<
7534  *         visitor.domain_mask = domain_mask
7535  *         self.visit_all_octs(selector, visitor)
7536  */
7537   __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
7538   __Pyx_GOTREF(__pyx_t_4);
7539   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts *)__pyx_t_4);
7540   __pyx_t_4 = 0;
7541 
7542   /* "yt/geometry/oct_container.pyx":295
7543  *         cdef oct_visitors.IdentifyOcts visitor
7544  *         visitor = oct_visitors.IdentifyOcts(self)
7545  *         visitor.domain_mask = domain_mask             # <<<<<<<<<<<<<<
7546  *         self.visit_all_octs(selector, visitor)
7547  *         cdef int i
7548  */
7549   __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_domain_mask), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 295, __pyx_L1_error)
7550   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domain_mask, 0);
7551   __pyx_v_visitor->domain_mask = __pyx_t_10;
7552   __pyx_t_10.memview = NULL;
7553   __pyx_t_10.data = NULL;
7554 
7555   /* "yt/geometry/oct_container.pyx":296
7556  *         visitor = oct_visitors.IdentifyOcts(self)
7557  *         visitor.domain_mask = domain_mask
7558  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
7559  *         cdef int i
7560  *         domain_ids = []
7561  */
7562   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
7563 
7564   /* "yt/geometry/oct_container.pyx":298
7565  *         self.visit_all_octs(selector, visitor)
7566  *         cdef int i
7567  *         domain_ids = []             # <<<<<<<<<<<<<<
7568  *         for i in range(self.num_domains):
7569  *             if domain_mask[i] == 1:
7570  */
7571   __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
7572   __Pyx_GOTREF(__pyx_t_4);
7573   __pyx_v_domain_ids = ((PyObject*)__pyx_t_4);
7574   __pyx_t_4 = 0;
7575 
7576   /* "yt/geometry/oct_container.pyx":299
7577  *         cdef int i
7578  *         domain_ids = []
7579  *         for i in range(self.num_domains):             # <<<<<<<<<<<<<<
7580  *             if domain_mask[i] == 1:
7581  *                 domain_ids.append(i+1)
7582  */
7583   __pyx_t_6 = __pyx_v_self->num_domains;
7584   __pyx_t_11 = __pyx_t_6;
7585   for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
7586     __pyx_v_i = __pyx_t_12;
7587 
7588     /* "yt/geometry/oct_container.pyx":300
7589  *         domain_ids = []
7590  *         for i in range(self.num_domains):
7591  *             if domain_mask[i] == 1:             # <<<<<<<<<<<<<<
7592  *                 domain_ids.append(i+1)
7593  *         return domain_ids
7594  */
7595     __pyx_t_13 = __pyx_v_i;
7596     __pyx_t_14 = -1;
7597     if (__pyx_t_13 < 0) {
7598       __pyx_t_13 += __pyx_pybuffernd_domain_mask.diminfo[0].shape;
7599       if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
7600     } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_domain_mask.diminfo[0].shape)) __pyx_t_14 = 0;
7601     if (unlikely(__pyx_t_14 != -1)) {
7602       __Pyx_RaiseBufferIndexError(__pyx_t_14);
7603       __PYX_ERR(0, 300, __pyx_L1_error)
7604     }
7605     __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_domain_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_domain_mask.diminfo[0].strides)) == 1) != 0);
7606     if (__pyx_t_15) {
7607 
7608       /* "yt/geometry/oct_container.pyx":301
7609  *         for i in range(self.num_domains):
7610  *             if domain_mask[i] == 1:
7611  *                 domain_ids.append(i+1)             # <<<<<<<<<<<<<<
7612  *         return domain_ids
7613  *
7614  */
7615       __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
7616       __Pyx_GOTREF(__pyx_t_4);
7617       __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_domain_ids, __pyx_t_4); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 301, __pyx_L1_error)
7618       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7619 
7620       /* "yt/geometry/oct_container.pyx":300
7621  *         domain_ids = []
7622  *         for i in range(self.num_domains):
7623  *             if domain_mask[i] == 1:             # <<<<<<<<<<<<<<
7624  *                 domain_ids.append(i+1)
7625  *         return domain_ids
7626  */
7627     }
7628   }
7629 
7630   /* "yt/geometry/oct_container.pyx":302
7631  *             if domain_mask[i] == 1:
7632  *                 domain_ids.append(i+1)
7633  *         return domain_ids             # <<<<<<<<<<<<<<
7634  *
7635  *     @cython.boundscheck(False)
7636  */
7637   __Pyx_XDECREF(__pyx_r);
7638   __Pyx_INCREF(__pyx_v_domain_ids);
7639   __pyx_r = __pyx_v_domain_ids;
7640   goto __pyx_L0;
7641 
7642   /* "yt/geometry/oct_container.pyx":290
7643  *         return oct_id, all_octs
7644  *
7645  *     def domain_identify(self, SelectorObject selector):             # <<<<<<<<<<<<<<
7646  *         cdef np.ndarray[np.uint8_t, ndim=1] domain_mask
7647  *         domain_mask = np.zeros(self.num_domains, dtype="uint8")
7648  */
7649 
7650   /* function exit code */
7651   __pyx_L1_error:;
7652   __Pyx_XDECREF(__pyx_t_1);
7653   __Pyx_XDECREF(__pyx_t_2);
7654   __Pyx_XDECREF(__pyx_t_3);
7655   __Pyx_XDECREF(__pyx_t_4);
7656   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
7657   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7658     __Pyx_PyThreadState_declare
7659     __Pyx_PyThreadState_assign
7660     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7661     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_mask.rcbuffer->pybuffer);
7662   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7663   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domain_identify", __pyx_clineno, __pyx_lineno, __pyx_filename);
7664   __pyx_r = NULL;
7665   goto __pyx_L2;
7666   __pyx_L0:;
7667   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_mask.rcbuffer->pybuffer);
7668   __pyx_L2:;
7669   __Pyx_XDECREF((PyObject *)__pyx_v_domain_mask);
7670   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
7671   __Pyx_XDECREF(__pyx_v_domain_ids);
7672   __Pyx_XGIVEREF(__pyx_r);
7673   __Pyx_RefNannyFinishContext();
7674   return __pyx_r;
7675 }
7676 
7677 /* "yt/geometry/oct_container.pyx":307
7678  *     @cython.wraparound(False)
7679  *     @cython.cdivision(True)
7680  *     cdef Oct** neighbors(self, OctInfo *oi, np.int64_t *nneighbors, Oct *o,             # <<<<<<<<<<<<<<
7681  *                          bint periodicity[3]):
7682  *         # We are going to do a brute-force search here.
7683  */
7684 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_neighbors(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo * __pyx_v_oi,__pyx_t_5numpy_int64_t * __pyx_v_nneighbors,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct * __pyx_v_o,int * __pyx_v_periodicity)7685 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_neighbors(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *__pyx_v_oi, __pyx_t_5numpy_int64_t *__pyx_v_nneighbors, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o, int *__pyx_v_periodicity) {
7686   __pyx_t_5numpy_int64_t __pyx_v_i;
7687   __pyx_t_5numpy_int64_t __pyx_v_j;
7688   __pyx_t_5numpy_int64_t __pyx_v_k;
7689   __pyx_t_5numpy_int64_t __pyx_v_n;
7690   __pyx_t_5numpy_int64_t __pyx_v_level;
7691   __pyx_t_5numpy_int64_t __pyx_v_ii;
7692   __pyx_t_5numpy_int64_t __pyx_v_dlevel;
7693   int __pyx_v_ind[3];
7694   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist;
7695   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_my_list;
7696   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_cand;
7697   __pyx_t_5numpy_int64_t __pyx_v_npos[3];
7698   __pyx_t_5numpy_int64_t __pyx_v_ndim[3];
7699   int __pyx_v_noct;
7700   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_neighbors;
7701   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_r;
7702   __Pyx_RefNannyDeclarations
7703   __pyx_t_5numpy_int64_t __pyx_t_1;
7704   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2;
7705   int __pyx_t_3;
7706   int __pyx_t_4;
7707   int __pyx_t_5;
7708   long __pyx_t_6;
7709   __pyx_t_5numpy_int64_t __pyx_t_7;
7710   __pyx_t_5numpy_int64_t __pyx_t_8;
7711   __pyx_t_5numpy_int64_t __pyx_t_9;
7712   long __pyx_t_10;
7713   __pyx_t_5numpy_int64_t __pyx_t_11;
7714   int __pyx_t_12;
7715   int __pyx_t_13;
7716   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_14;
7717   __Pyx_RefNannySetupContext("neighbors", 0);
7718 
7719   /* "yt/geometry/oct_container.pyx":319
7720  *         cdef OctList *olist
7721  *         cdef OctList *my_list
7722  *         my_list = olist = NULL             # <<<<<<<<<<<<<<
7723  *         cdef Oct *cand
7724  *         cdef np.int64_t npos[3]
7725  */
7726   __pyx_v_my_list = NULL;
7727   __pyx_v_olist = NULL;
7728 
7729   /* "yt/geometry/oct_container.pyx":326
7730  *         # if need be.
7731  *         # ndim is the oct dimensions of the level, not the cell dimensions.
7732  *         for i in range(3):             # <<<<<<<<<<<<<<
7733  *             ndim[i] = <np.int64_t> ((self.DRE[i] - self.DLE[i]) / oi.dds[i])
7734  *             # Here we adjust for oi.dds meaning *cell* width.
7735  */
7736   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
7737     __pyx_v_i = __pyx_t_1;
7738 
7739     /* "yt/geometry/oct_container.pyx":327
7740  *         # ndim is the oct dimensions of the level, not the cell dimensions.
7741  *         for i in range(3):
7742  *             ndim[i] = <np.int64_t> ((self.DRE[i] - self.DLE[i]) / oi.dds[i])             # <<<<<<<<<<<<<<
7743  *             # Here we adjust for oi.dds meaning *cell* width.
7744  *             ndim[i] = (ndim[i] >> self.oref)
7745  */
7746     (__pyx_v_ndim[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_oi->dds[__pyx_v_i])));
7747 
7748     /* "yt/geometry/oct_container.pyx":329
7749  *             ndim[i] = <np.int64_t> ((self.DRE[i] - self.DLE[i]) / oi.dds[i])
7750  *             # Here we adjust for oi.dds meaning *cell* width.
7751  *             ndim[i] = (ndim[i] >> self.oref)             # <<<<<<<<<<<<<<
7752  *         my_list = olist = OctList_append(NULL, o)
7753  *         for i in range(3):
7754  */
7755     (__pyx_v_ndim[__pyx_v_i]) = ((__pyx_v_ndim[__pyx_v_i]) >> __pyx_v_self->oref);
7756   }
7757 
7758   /* "yt/geometry/oct_container.pyx":330
7759  *             # Here we adjust for oi.dds meaning *cell* width.
7760  *             ndim[i] = (ndim[i] >> self.oref)
7761  *         my_list = olist = OctList_append(NULL, o)             # <<<<<<<<<<<<<<
7762  *         for i in range(3):
7763  *             npos[0] = (oi.ipos[0] + (1 - i))
7764  */
7765   __pyx_t_2 = __pyx_f_2yt_8geometry_13oct_container_OctList_append(NULL, __pyx_v_o);
7766   __pyx_v_my_list = __pyx_t_2;
7767   __pyx_v_olist = __pyx_t_2;
7768 
7769   /* "yt/geometry/oct_container.pyx":331
7770  *             ndim[i] = (ndim[i] >> self.oref)
7771  *         my_list = olist = OctList_append(NULL, o)
7772  *         for i in range(3):             # <<<<<<<<<<<<<<
7773  *             npos[0] = (oi.ipos[0] + (1 - i))
7774  *             if not periodicity[0] and not \
7775  */
7776   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
7777     __pyx_v_i = __pyx_t_1;
7778 
7779     /* "yt/geometry/oct_container.pyx":332
7780  *         my_list = olist = OctList_append(NULL, o)
7781  *         for i in range(3):
7782  *             npos[0] = (oi.ipos[0] + (1 - i))             # <<<<<<<<<<<<<<
7783  *             if not periodicity[0] and not \
7784  *                (0 <= npos[0] < ndim[0]):
7785  */
7786     (__pyx_v_npos[0]) = ((__pyx_v_oi->ipos[0]) + (1 - __pyx_v_i));
7787 
7788     /* "yt/geometry/oct_container.pyx":333
7789  *         for i in range(3):
7790  *             npos[0] = (oi.ipos[0] + (1 - i))
7791  *             if not periodicity[0] and not \             # <<<<<<<<<<<<<<
7792  *                (0 <= npos[0] < ndim[0]):
7793  *                 continue
7794  */
7795     __pyx_t_4 = ((!((__pyx_v_periodicity[0]) != 0)) != 0);
7796     if (__pyx_t_4) {
7797     } else {
7798       __pyx_t_3 = __pyx_t_4;
7799       goto __pyx_L8_bool_binop_done;
7800     }
7801 
7802     /* "yt/geometry/oct_container.pyx":334
7803  *             npos[0] = (oi.ipos[0] + (1 - i))
7804  *             if not periodicity[0] and not \
7805  *                (0 <= npos[0] < ndim[0]):             # <<<<<<<<<<<<<<
7806  *                 continue
7807  *             elif npos[0] < 0: npos[0] += ndim[0]
7808  */
7809     __pyx_t_4 = (0 <= (__pyx_v_npos[0]));
7810     if (__pyx_t_4) {
7811       __pyx_t_4 = ((__pyx_v_npos[0]) < (__pyx_v_ndim[0]));
7812     }
7813 
7814     /* "yt/geometry/oct_container.pyx":333
7815  *         for i in range(3):
7816  *             npos[0] = (oi.ipos[0] + (1 - i))
7817  *             if not periodicity[0] and not \             # <<<<<<<<<<<<<<
7818  *                (0 <= npos[0] < ndim[0]):
7819  *                 continue
7820  */
7821     __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
7822     __pyx_t_3 = __pyx_t_5;
7823     __pyx_L8_bool_binop_done:;
7824     if (__pyx_t_3) {
7825 
7826       /* "yt/geometry/oct_container.pyx":335
7827  *             if not periodicity[0] and not \
7828  *                (0 <= npos[0] < ndim[0]):
7829  *                 continue             # <<<<<<<<<<<<<<
7830  *             elif npos[0] < 0: npos[0] += ndim[0]
7831  *             elif npos[0] >= ndim[0]: npos[0] -= ndim[0]
7832  */
7833       goto __pyx_L5_continue;
7834 
7835       /* "yt/geometry/oct_container.pyx":333
7836  *         for i in range(3):
7837  *             npos[0] = (oi.ipos[0] + (1 - i))
7838  *             if not periodicity[0] and not \             # <<<<<<<<<<<<<<
7839  *                (0 <= npos[0] < ndim[0]):
7840  *                 continue
7841  */
7842     }
7843 
7844     /* "yt/geometry/oct_container.pyx":336
7845  *                (0 <= npos[0] < ndim[0]):
7846  *                 continue
7847  *             elif npos[0] < 0: npos[0] += ndim[0]             # <<<<<<<<<<<<<<
7848  *             elif npos[0] >= ndim[0]: npos[0] -= ndim[0]
7849  *             for j in range(3):
7850  */
7851     __pyx_t_3 = (((__pyx_v_npos[0]) < 0) != 0);
7852     if (__pyx_t_3) {
7853       __pyx_t_6 = 0;
7854       (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) + (__pyx_v_ndim[0]));
7855       goto __pyx_L7;
7856     }
7857 
7858     /* "yt/geometry/oct_container.pyx":337
7859  *                 continue
7860  *             elif npos[0] < 0: npos[0] += ndim[0]
7861  *             elif npos[0] >= ndim[0]: npos[0] -= ndim[0]             # <<<<<<<<<<<<<<
7862  *             for j in range(3):
7863  *                 npos[1] = (oi.ipos[1] + (1 - j))
7864  */
7865     __pyx_t_3 = (((__pyx_v_npos[0]) >= (__pyx_v_ndim[0])) != 0);
7866     if (__pyx_t_3) {
7867       __pyx_t_6 = 0;
7868       (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) - (__pyx_v_ndim[0]));
7869     }
7870     __pyx_L7:;
7871 
7872     /* "yt/geometry/oct_container.pyx":338
7873  *             elif npos[0] < 0: npos[0] += ndim[0]
7874  *             elif npos[0] >= ndim[0]: npos[0] -= ndim[0]
7875  *             for j in range(3):             # <<<<<<<<<<<<<<
7876  *                 npos[1] = (oi.ipos[1] + (1 - j))
7877  *                 if not periodicity[1] and not \
7878  */
7879     for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
7880       __pyx_v_j = __pyx_t_7;
7881 
7882       /* "yt/geometry/oct_container.pyx":339
7883  *             elif npos[0] >= ndim[0]: npos[0] -= ndim[0]
7884  *             for j in range(3):
7885  *                 npos[1] = (oi.ipos[1] + (1 - j))             # <<<<<<<<<<<<<<
7886  *                 if not periodicity[1] and not \
7887  *                    (0 <= npos[1] < ndim[1]):
7888  */
7889       (__pyx_v_npos[1]) = ((__pyx_v_oi->ipos[1]) + (1 - __pyx_v_j));
7890 
7891       /* "yt/geometry/oct_container.pyx":340
7892  *             for j in range(3):
7893  *                 npos[1] = (oi.ipos[1] + (1 - j))
7894  *                 if not periodicity[1] and not \             # <<<<<<<<<<<<<<
7895  *                    (0 <= npos[1] < ndim[1]):
7896  *                     continue
7897  */
7898       __pyx_t_5 = ((!((__pyx_v_periodicity[1]) != 0)) != 0);
7899       if (__pyx_t_5) {
7900       } else {
7901         __pyx_t_3 = __pyx_t_5;
7902         goto __pyx_L13_bool_binop_done;
7903       }
7904 
7905       /* "yt/geometry/oct_container.pyx":341
7906  *                 npos[1] = (oi.ipos[1] + (1 - j))
7907  *                 if not periodicity[1] and not \
7908  *                    (0 <= npos[1] < ndim[1]):             # <<<<<<<<<<<<<<
7909  *                     continue
7910  *                 elif npos[1] < 0: npos[1] += ndim[1]
7911  */
7912       __pyx_t_5 = (0 <= (__pyx_v_npos[1]));
7913       if (__pyx_t_5) {
7914         __pyx_t_5 = ((__pyx_v_npos[1]) < (__pyx_v_ndim[1]));
7915       }
7916 
7917       /* "yt/geometry/oct_container.pyx":340
7918  *             for j in range(3):
7919  *                 npos[1] = (oi.ipos[1] + (1 - j))
7920  *                 if not periodicity[1] and not \             # <<<<<<<<<<<<<<
7921  *                    (0 <= npos[1] < ndim[1]):
7922  *                     continue
7923  */
7924       __pyx_t_4 = ((!(__pyx_t_5 != 0)) != 0);
7925       __pyx_t_3 = __pyx_t_4;
7926       __pyx_L13_bool_binop_done:;
7927       if (__pyx_t_3) {
7928 
7929         /* "yt/geometry/oct_container.pyx":342
7930  *                 if not periodicity[1] and not \
7931  *                    (0 <= npos[1] < ndim[1]):
7932  *                     continue             # <<<<<<<<<<<<<<
7933  *                 elif npos[1] < 0: npos[1] += ndim[1]
7934  *                 elif npos[1] >= ndim[1]: npos[1] -= ndim[1]
7935  */
7936         goto __pyx_L10_continue;
7937 
7938         /* "yt/geometry/oct_container.pyx":340
7939  *             for j in range(3):
7940  *                 npos[1] = (oi.ipos[1] + (1 - j))
7941  *                 if not periodicity[1] and not \             # <<<<<<<<<<<<<<
7942  *                    (0 <= npos[1] < ndim[1]):
7943  *                     continue
7944  */
7945       }
7946 
7947       /* "yt/geometry/oct_container.pyx":343
7948  *                    (0 <= npos[1] < ndim[1]):
7949  *                     continue
7950  *                 elif npos[1] < 0: npos[1] += ndim[1]             # <<<<<<<<<<<<<<
7951  *                 elif npos[1] >= ndim[1]: npos[1] -= ndim[1]
7952  *                 for k in range(3):
7953  */
7954       __pyx_t_3 = (((__pyx_v_npos[1]) < 0) != 0);
7955       if (__pyx_t_3) {
7956         __pyx_t_6 = 1;
7957         (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) + (__pyx_v_ndim[1]));
7958         goto __pyx_L12;
7959       }
7960 
7961       /* "yt/geometry/oct_container.pyx":344
7962  *                     continue
7963  *                 elif npos[1] < 0: npos[1] += ndim[1]
7964  *                 elif npos[1] >= ndim[1]: npos[1] -= ndim[1]             # <<<<<<<<<<<<<<
7965  *                 for k in range(3):
7966  *                     npos[2] = (oi.ipos[2] + (1 - k))
7967  */
7968       __pyx_t_3 = (((__pyx_v_npos[1]) >= (__pyx_v_ndim[1])) != 0);
7969       if (__pyx_t_3) {
7970         __pyx_t_6 = 1;
7971         (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) - (__pyx_v_ndim[1]));
7972       }
7973       __pyx_L12:;
7974 
7975       /* "yt/geometry/oct_container.pyx":345
7976  *                 elif npos[1] < 0: npos[1] += ndim[1]
7977  *                 elif npos[1] >= ndim[1]: npos[1] -= ndim[1]
7978  *                 for k in range(3):             # <<<<<<<<<<<<<<
7979  *                     npos[2] = (oi.ipos[2] + (1 - k))
7980  *                     if not periodicity[2] and not \
7981  */
7982       for (__pyx_t_8 = 0; __pyx_t_8 < 3; __pyx_t_8+=1) {
7983         __pyx_v_k = __pyx_t_8;
7984 
7985         /* "yt/geometry/oct_container.pyx":346
7986  *                 elif npos[1] >= ndim[1]: npos[1] -= ndim[1]
7987  *                 for k in range(3):
7988  *                     npos[2] = (oi.ipos[2] + (1 - k))             # <<<<<<<<<<<<<<
7989  *                     if not periodicity[2] and not \
7990  *                        (0 <= npos[2] < ndim[2]):
7991  */
7992         (__pyx_v_npos[2]) = ((__pyx_v_oi->ipos[2]) + (1 - __pyx_v_k));
7993 
7994         /* "yt/geometry/oct_container.pyx":347
7995  *                 for k in range(3):
7996  *                     npos[2] = (oi.ipos[2] + (1 - k))
7997  *                     if not periodicity[2] and not \             # <<<<<<<<<<<<<<
7998  *                        (0 <= npos[2] < ndim[2]):
7999  *                         continue
8000  */
8001         __pyx_t_4 = ((!((__pyx_v_periodicity[2]) != 0)) != 0);
8002         if (__pyx_t_4) {
8003         } else {
8004           __pyx_t_3 = __pyx_t_4;
8005           goto __pyx_L18_bool_binop_done;
8006         }
8007 
8008         /* "yt/geometry/oct_container.pyx":348
8009  *                     npos[2] = (oi.ipos[2] + (1 - k))
8010  *                     if not periodicity[2] and not \
8011  *                        (0 <= npos[2] < ndim[2]):             # <<<<<<<<<<<<<<
8012  *                         continue
8013  *                     if npos[2] < 0: npos[2] += ndim[2]
8014  */
8015         __pyx_t_4 = (0 <= (__pyx_v_npos[2]));
8016         if (__pyx_t_4) {
8017           __pyx_t_4 = ((__pyx_v_npos[2]) < (__pyx_v_ndim[2]));
8018         }
8019 
8020         /* "yt/geometry/oct_container.pyx":347
8021  *                 for k in range(3):
8022  *                     npos[2] = (oi.ipos[2] + (1 - k))
8023  *                     if not periodicity[2] and not \             # <<<<<<<<<<<<<<
8024  *                        (0 <= npos[2] < ndim[2]):
8025  *                         continue
8026  */
8027         __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
8028         __pyx_t_3 = __pyx_t_5;
8029         __pyx_L18_bool_binop_done:;
8030         if (__pyx_t_3) {
8031 
8032           /* "yt/geometry/oct_container.pyx":349
8033  *                     if not periodicity[2] and not \
8034  *                        (0 <= npos[2] < ndim[2]):
8035  *                         continue             # <<<<<<<<<<<<<<
8036  *                     if npos[2] < 0: npos[2] += ndim[2]
8037  *                     if npos[2] >= ndim[2]: npos[2] -= ndim[2]
8038  */
8039           goto __pyx_L15_continue;
8040 
8041           /* "yt/geometry/oct_container.pyx":347
8042  *                 for k in range(3):
8043  *                     npos[2] = (oi.ipos[2] + (1 - k))
8044  *                     if not periodicity[2] and not \             # <<<<<<<<<<<<<<
8045  *                        (0 <= npos[2] < ndim[2]):
8046  *                         continue
8047  */
8048         }
8049 
8050         /* "yt/geometry/oct_container.pyx":350
8051  *                        (0 <= npos[2] < ndim[2]):
8052  *                         continue
8053  *                     if npos[2] < 0: npos[2] += ndim[2]             # <<<<<<<<<<<<<<
8054  *                     if npos[2] >= ndim[2]: npos[2] -= ndim[2]
8055  *                     # Now we have our npos, which we just need to find.
8056  */
8057         __pyx_t_3 = (((__pyx_v_npos[2]) < 0) != 0);
8058         if (__pyx_t_3) {
8059           __pyx_t_6 = 2;
8060           (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) + (__pyx_v_ndim[2]));
8061         }
8062 
8063         /* "yt/geometry/oct_container.pyx":351
8064  *                         continue
8065  *                     if npos[2] < 0: npos[2] += ndim[2]
8066  *                     if npos[2] >= ndim[2]: npos[2] -= ndim[2]             # <<<<<<<<<<<<<<
8067  *                     # Now we have our npos, which we just need to find.
8068  *                     # Level 0 gets bootstrapped
8069  */
8070         __pyx_t_3 = (((__pyx_v_npos[2]) >= (__pyx_v_ndim[2])) != 0);
8071         if (__pyx_t_3) {
8072           __pyx_t_6 = 2;
8073           (__pyx_v_npos[__pyx_t_6]) = ((__pyx_v_npos[__pyx_t_6]) - (__pyx_v_ndim[2]));
8074         }
8075 
8076         /* "yt/geometry/oct_container.pyx":354
8077  *                     # Now we have our npos, which we just need to find.
8078  *                     # Level 0 gets bootstrapped
8079  *                     for n in range(3):             # <<<<<<<<<<<<<<
8080  *                         ind[n] = ((npos[n] >> (oi.level)) & 1)
8081  *                     cand = NULL
8082  */
8083         for (__pyx_t_9 = 0; __pyx_t_9 < 3; __pyx_t_9+=1) {
8084           __pyx_v_n = __pyx_t_9;
8085 
8086           /* "yt/geometry/oct_container.pyx":355
8087  *                     # Level 0 gets bootstrapped
8088  *                     for n in range(3):
8089  *                         ind[n] = ((npos[n] >> (oi.level)) & 1)             # <<<<<<<<<<<<<<
8090  *                     cand = NULL
8091  *                     self.get_root(ind, &cand)
8092  */
8093           (__pyx_v_ind[__pyx_v_n]) = (((__pyx_v_npos[__pyx_v_n]) >> __pyx_v_oi->level) & 1);
8094         }
8095 
8096         /* "yt/geometry/oct_container.pyx":356
8097  *                     for n in range(3):
8098  *                         ind[n] = ((npos[n] >> (oi.level)) & 1)
8099  *                     cand = NULL             # <<<<<<<<<<<<<<
8100  *                     self.get_root(ind, &cand)
8101  *                     # We should not get a NULL if we handle periodicity
8102  */
8103         __pyx_v_cand = NULL;
8104 
8105         /* "yt/geometry/oct_container.pyx":357
8106  *                         ind[n] = ((npos[n] >> (oi.level)) & 1)
8107  *                     cand = NULL
8108  *                     self.get_root(ind, &cand)             # <<<<<<<<<<<<<<
8109  *                     # We should not get a NULL if we handle periodicity
8110  *                     # correctly, but we might.
8111  */
8112         (void)(((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->get_root(__pyx_v_self, __pyx_v_ind, (&__pyx_v_cand)));
8113 
8114         /* "yt/geometry/oct_container.pyx":360
8115  *                     # We should not get a NULL if we handle periodicity
8116  *                     # correctly, but we might.
8117  *                     if cand == NULL: continue             # <<<<<<<<<<<<<<
8118  *                     for level in range(1, oi.level+1):
8119  *                         dlevel = oi.level - level
8120  */
8121         __pyx_t_3 = ((__pyx_v_cand == NULL) != 0);
8122         if (__pyx_t_3) {
8123           goto __pyx_L15_continue;
8124         }
8125 
8126         /* "yt/geometry/oct_container.pyx":361
8127  *                     # correctly, but we might.
8128  *                     if cand == NULL: continue
8129  *                     for level in range(1, oi.level+1):             # <<<<<<<<<<<<<<
8130  *                         dlevel = oi.level - level
8131  *                         if cand.children == NULL: break
8132  */
8133         __pyx_t_6 = (__pyx_v_oi->level + 1);
8134         __pyx_t_10 = __pyx_t_6;
8135         for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_10; __pyx_t_9+=1) {
8136           __pyx_v_level = __pyx_t_9;
8137 
8138           /* "yt/geometry/oct_container.pyx":362
8139  *                     if cand == NULL: continue
8140  *                     for level in range(1, oi.level+1):
8141  *                         dlevel = oi.level - level             # <<<<<<<<<<<<<<
8142  *                         if cand.children == NULL: break
8143  *                         for n in range(3):
8144  */
8145           __pyx_v_dlevel = (__pyx_v_oi->level - __pyx_v_level);
8146 
8147           /* "yt/geometry/oct_container.pyx":363
8148  *                     for level in range(1, oi.level+1):
8149  *                         dlevel = oi.level - level
8150  *                         if cand.children == NULL: break             # <<<<<<<<<<<<<<
8151  *                         for n in range(3):
8152  *                             ind[n] = (npos[n] >> dlevel) & 1
8153  */
8154           __pyx_t_3 = ((__pyx_v_cand->children == NULL) != 0);
8155           if (__pyx_t_3) {
8156             goto __pyx_L26_break;
8157           }
8158 
8159           /* "yt/geometry/oct_container.pyx":364
8160  *                         dlevel = oi.level - level
8161  *                         if cand.children == NULL: break
8162  *                         for n in range(3):             # <<<<<<<<<<<<<<
8163  *                             ind[n] = (npos[n] >> dlevel) & 1
8164  *                         ii = cind(ind[0],ind[1],ind[2])
8165  */
8166           for (__pyx_t_11 = 0; __pyx_t_11 < 3; __pyx_t_11+=1) {
8167             __pyx_v_n = __pyx_t_11;
8168 
8169             /* "yt/geometry/oct_container.pyx":365
8170  *                         if cand.children == NULL: break
8171  *                         for n in range(3):
8172  *                             ind[n] = (npos[n] >> dlevel) & 1             # <<<<<<<<<<<<<<
8173  *                         ii = cind(ind[0],ind[1],ind[2])
8174  *                         if cand.children[ii] == NULL: break
8175  */
8176             (__pyx_v_ind[__pyx_v_n]) = (((__pyx_v_npos[__pyx_v_n]) >> __pyx_v_dlevel) & 1);
8177           }
8178 
8179           /* "yt/geometry/oct_container.pyx":366
8180  *                         for n in range(3):
8181  *                             ind[n] = (npos[n] >> dlevel) & 1
8182  *                         ii = cind(ind[0],ind[1],ind[2])             # <<<<<<<<<<<<<<
8183  *                         if cand.children[ii] == NULL: break
8184  *                         cand = cand.children[ii]
8185  */
8186           __pyx_v_ii = __pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]));
8187 
8188           /* "yt/geometry/oct_container.pyx":367
8189  *                             ind[n] = (npos[n] >> dlevel) & 1
8190  *                         ii = cind(ind[0],ind[1],ind[2])
8191  *                         if cand.children[ii] == NULL: break             # <<<<<<<<<<<<<<
8192  *                         cand = cand.children[ii]
8193  *                     if cand.children != NULL:
8194  */
8195           __pyx_t_3 = (((__pyx_v_cand->children[__pyx_v_ii]) == NULL) != 0);
8196           if (__pyx_t_3) {
8197             goto __pyx_L26_break;
8198           }
8199 
8200           /* "yt/geometry/oct_container.pyx":368
8201  *                         ii = cind(ind[0],ind[1],ind[2])
8202  *                         if cand.children[ii] == NULL: break
8203  *                         cand = cand.children[ii]             # <<<<<<<<<<<<<<
8204  *                     if cand.children != NULL:
8205  *                         olist = OctList_subneighbor_find(
8206  */
8207           __pyx_v_cand = (__pyx_v_cand->children[__pyx_v_ii]);
8208         }
8209         __pyx_L26_break:;
8210 
8211         /* "yt/geometry/oct_container.pyx":369
8212  *                         if cand.children[ii] == NULL: break
8213  *                         cand = cand.children[ii]
8214  *                     if cand.children != NULL:             # <<<<<<<<<<<<<<
8215  *                         olist = OctList_subneighbor_find(
8216  *                             olist, cand, i, j, k)
8217  */
8218         __pyx_t_3 = ((__pyx_v_cand->children != NULL) != 0);
8219         if (__pyx_t_3) {
8220 
8221           /* "yt/geometry/oct_container.pyx":370
8222  *                         cand = cand.children[ii]
8223  *                     if cand.children != NULL:
8224  *                         olist = OctList_subneighbor_find(             # <<<<<<<<<<<<<<
8225  *                             olist, cand, i, j, k)
8226  *                     else:
8227  */
8228           __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(__pyx_v_olist, __pyx_v_cand, __pyx_v_i, __pyx_v_j, __pyx_v_k);
8229 
8230           /* "yt/geometry/oct_container.pyx":369
8231  *                         if cand.children[ii] == NULL: break
8232  *                         cand = cand.children[ii]
8233  *                     if cand.children != NULL:             # <<<<<<<<<<<<<<
8234  *                         olist = OctList_subneighbor_find(
8235  *                             olist, cand, i, j, k)
8236  */
8237           goto __pyx_L31;
8238         }
8239 
8240         /* "yt/geometry/oct_container.pyx":373
8241  *                             olist, cand, i, j, k)
8242  *                     else:
8243  *                         olist = OctList_append(olist, cand)             # <<<<<<<<<<<<<<
8244  *         olist = my_list
8245  *         cdef int noct = OctList_count(olist)
8246  */
8247         /*else*/ {
8248           __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_append(__pyx_v_olist, __pyx_v_cand);
8249         }
8250         __pyx_L31:;
8251         __pyx_L15_continue:;
8252       }
8253       __pyx_L10_continue:;
8254     }
8255     __pyx_L5_continue:;
8256   }
8257 
8258   /* "yt/geometry/oct_container.pyx":374
8259  *                     else:
8260  *                         olist = OctList_append(olist, cand)
8261  *         olist = my_list             # <<<<<<<<<<<<<<
8262  *         cdef int noct = OctList_count(olist)
8263  *         cdef Oct **neighbors
8264  */
8265   __pyx_v_olist = __pyx_v_my_list;
8266 
8267   /* "yt/geometry/oct_container.pyx":375
8268  *                         olist = OctList_append(olist, cand)
8269  *         olist = my_list
8270  *         cdef int noct = OctList_count(olist)             # <<<<<<<<<<<<<<
8271  *         cdef Oct **neighbors
8272  *         neighbors = <Oct **> malloc(sizeof(Oct*)*noct)
8273  */
8274   __pyx_v_noct = __pyx_f_2yt_8geometry_13oct_container_OctList_count(__pyx_v_olist);
8275 
8276   /* "yt/geometry/oct_container.pyx":377
8277  *         cdef int noct = OctList_count(olist)
8278  *         cdef Oct **neighbors
8279  *         neighbors = <Oct **> malloc(sizeof(Oct*)*noct)             # <<<<<<<<<<<<<<
8280  *         for i in range(noct):
8281  *             neighbors[i] = olist.o
8282  */
8283   __pyx_v_neighbors = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * __pyx_v_noct)));
8284 
8285   /* "yt/geometry/oct_container.pyx":378
8286  *         cdef Oct **neighbors
8287  *         neighbors = <Oct **> malloc(sizeof(Oct*)*noct)
8288  *         for i in range(noct):             # <<<<<<<<<<<<<<
8289  *             neighbors[i] = olist.o
8290  *             olist = olist.next
8291  */
8292   __pyx_t_12 = __pyx_v_noct;
8293   __pyx_t_13 = __pyx_t_12;
8294   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_13; __pyx_t_1+=1) {
8295     __pyx_v_i = __pyx_t_1;
8296 
8297     /* "yt/geometry/oct_container.pyx":379
8298  *         neighbors = <Oct **> malloc(sizeof(Oct*)*noct)
8299  *         for i in range(noct):
8300  *             neighbors[i] = olist.o             # <<<<<<<<<<<<<<
8301  *             olist = olist.next
8302  *         OctList_delete(my_list)
8303  */
8304     __pyx_t_14 = __pyx_v_olist->o;
8305     (__pyx_v_neighbors[__pyx_v_i]) = __pyx_t_14;
8306 
8307     /* "yt/geometry/oct_container.pyx":380
8308  *         for i in range(noct):
8309  *             neighbors[i] = olist.o
8310  *             olist = olist.next             # <<<<<<<<<<<<<<
8311  *         OctList_delete(my_list)
8312  *         nneighbors[0] = noct
8313  */
8314     __pyx_t_2 = __pyx_v_olist->next;
8315     __pyx_v_olist = __pyx_t_2;
8316   }
8317 
8318   /* "yt/geometry/oct_container.pyx":381
8319  *             neighbors[i] = olist.o
8320  *             olist = olist.next
8321  *         OctList_delete(my_list)             # <<<<<<<<<<<<<<
8322  *         nneighbors[0] = noct
8323  *         return neighbors
8324  */
8325   __pyx_f_2yt_8geometry_13oct_container_OctList_delete(__pyx_v_my_list);
8326 
8327   /* "yt/geometry/oct_container.pyx":382
8328  *             olist = olist.next
8329  *         OctList_delete(my_list)
8330  *         nneighbors[0] = noct             # <<<<<<<<<<<<<<
8331  *         return neighbors
8332  *
8333  */
8334   (__pyx_v_nneighbors[0]) = __pyx_v_noct;
8335 
8336   /* "yt/geometry/oct_container.pyx":383
8337  *         OctList_delete(my_list)
8338  *         nneighbors[0] = noct
8339  *         return neighbors             # <<<<<<<<<<<<<<
8340  *
8341  *     @cython.boundscheck(False)
8342  */
8343   __pyx_r = __pyx_v_neighbors;
8344   goto __pyx_L0;
8345 
8346   /* "yt/geometry/oct_container.pyx":307
8347  *     @cython.wraparound(False)
8348  *     @cython.cdivision(True)
8349  *     cdef Oct** neighbors(self, OctInfo *oi, np.int64_t *nneighbors, Oct *o,             # <<<<<<<<<<<<<<
8350  *                          bint periodicity[3]):
8351  *         # We are going to do a brute-force search here.
8352  */
8353 
8354   /* function exit code */
8355   __pyx_L0:;
8356   __Pyx_RefNannyFinishContext();
8357   return __pyx_r;
8358 }
8359 
8360 /* "yt/geometry/oct_container.pyx":388
8361  *     @cython.wraparound(False)
8362  *     @cython.cdivision(True)
8363  *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
8364  *              int domain_id = -1):
8365  *         if num_cells == -1:
8366  */
8367 
8368 /* Python wrapper */
8369 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8370 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8371   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
8372   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
8373   int __pyx_v_domain_id;
8374   PyObject *__pyx_r = 0;
8375   __Pyx_RefNannyDeclarations
8376   __Pyx_RefNannySetupContext("mask (wrapper)", 0);
8377   {
8378     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
8379     PyObject* values[3] = {0,0,0};
8380     if (unlikely(__pyx_kwds)) {
8381       Py_ssize_t kw_args;
8382       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8383       switch (pos_args) {
8384         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8385         CYTHON_FALLTHROUGH;
8386         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8387         CYTHON_FALLTHROUGH;
8388         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8389         CYTHON_FALLTHROUGH;
8390         case  0: break;
8391         default: goto __pyx_L5_argtuple_error;
8392       }
8393       kw_args = PyDict_Size(__pyx_kwds);
8394       switch (pos_args) {
8395         case  0:
8396         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
8397         else goto __pyx_L5_argtuple_error;
8398         CYTHON_FALLTHROUGH;
8399         case  1:
8400         if (kw_args > 0) {
8401           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
8402           if (value) { values[1] = value; kw_args--; }
8403         }
8404         CYTHON_FALLTHROUGH;
8405         case  2:
8406         if (kw_args > 0) {
8407           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
8408           if (value) { values[2] = value; kw_args--; }
8409         }
8410       }
8411       if (unlikely(kw_args > 0)) {
8412         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mask") < 0)) __PYX_ERR(0, 388, __pyx_L3_error)
8413       }
8414     } else {
8415       switch (PyTuple_GET_SIZE(__pyx_args)) {
8416         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8417         CYTHON_FALLTHROUGH;
8418         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8419         CYTHON_FALLTHROUGH;
8420         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8421         break;
8422         default: goto __pyx_L5_argtuple_error;
8423       }
8424     }
8425     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
8426     if (values[1]) {
8427       __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error)
8428     } else {
8429       __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL);
8430     }
8431     if (values[2]) {
8432       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L3_error)
8433     } else {
8434       __pyx_v_domain_id = ((int)-1);
8435     }
8436   }
8437   goto __pyx_L4_argument_unpacking_done;
8438   __pyx_L5_argtuple_error:;
8439   __Pyx_RaiseArgtupleInvalid("mask", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 388, __pyx_L3_error)
8440   __pyx_L3_error:;
8441   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
8442   __Pyx_RefNannyFinishContext();
8443   return NULL;
8444   __pyx_L4_argument_unpacking_done:;
8445   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 388, __pyx_L1_error)
8446   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);
8447 
8448   /* function exit code */
8449   goto __pyx_L0;
8450   __pyx_L1_error:;
8451   __pyx_r = NULL;
8452   __pyx_L0:;
8453   __Pyx_RefNannyFinishContext();
8454   return __pyx_r;
8455 }
8456 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_int64_t __pyx_v_num_cells,int __pyx_v_domain_id)8457 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_12mask(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) {
8458   PyArrayObject *__pyx_v_mask = 0;
8459   struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_v_visitor = 0;
8460   int __pyx_v_ns;
8461   __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
8462   __Pyx_Buffer __pyx_pybuffer_mask;
8463   PyObject *__pyx_r = NULL;
8464   __Pyx_RefNannyDeclarations
8465   int __pyx_t_1;
8466   PyObject *__pyx_t_2 = NULL;
8467   PyObject *__pyx_t_3 = NULL;
8468   PyObject *__pyx_t_4 = NULL;
8469   PyObject *__pyx_t_5 = NULL;
8470   int __pyx_t_6;
8471   PyObject *__pyx_t_7 = NULL;
8472   __pyx_t_5numpy_int64_t __pyx_t_8;
8473   PyObject *__pyx_t_9 = NULL;
8474   PyArrayObject *__pyx_t_10 = NULL;
8475   PyObject *__pyx_t_11 = NULL;
8476   PyObject *__pyx_t_12 = NULL;
8477   PyObject *__pyx_t_13 = NULL;
8478   __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
8479   __Pyx_RefNannySetupContext("mask", 0);
8480   __pyx_pybuffer_mask.pybuffer.buf = NULL;
8481   __pyx_pybuffer_mask.refcount = 0;
8482   __pyx_pybuffernd_mask.data = NULL;
8483   __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
8484 
8485   /* "yt/geometry/oct_container.pyx":390
8486  *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,
8487  *              int domain_id = -1):
8488  *         if num_cells == -1:             # <<<<<<<<<<<<<<
8489  *             num_cells = selector.count_octs(self, domain_id)
8490  *         cdef np.ndarray[np.uint8_t, ndim=4] mask
8491  */
8492   __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0);
8493   if (__pyx_t_1) {
8494 
8495     /* "yt/geometry/oct_container.pyx":391
8496  *              int domain_id = -1):
8497  *         if num_cells == -1:
8498  *             num_cells = selector.count_octs(self, domain_id)             # <<<<<<<<<<<<<<
8499  *         cdef np.ndarray[np.uint8_t, ndim=4] mask
8500  *         cdef oct_visitors.MaskOcts visitor
8501  */
8502     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_octs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
8503     __Pyx_GOTREF(__pyx_t_3);
8504     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
8505     __Pyx_GOTREF(__pyx_t_4);
8506     __pyx_t_5 = NULL;
8507     __pyx_t_6 = 0;
8508     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8509       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8510       if (likely(__pyx_t_5)) {
8511         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8512         __Pyx_INCREF(__pyx_t_5);
8513         __Pyx_INCREF(function);
8514         __Pyx_DECREF_SET(__pyx_t_3, function);
8515         __pyx_t_6 = 1;
8516       }
8517     }
8518     #if CYTHON_FAST_PYCALL
8519     if (PyFunction_Check(__pyx_t_3)) {
8520       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
8521       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
8522       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8523       __Pyx_GOTREF(__pyx_t_2);
8524       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8525     } else
8526     #endif
8527     #if CYTHON_FAST_PYCCALL
8528     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8529       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
8530       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
8531       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8532       __Pyx_GOTREF(__pyx_t_2);
8533       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8534     } else
8535     #endif
8536     {
8537       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error)
8538       __Pyx_GOTREF(__pyx_t_7);
8539       if (__pyx_t_5) {
8540         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8541       }
8542       __Pyx_INCREF(((PyObject *)__pyx_v_self));
8543       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8544       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
8545       __Pyx_GIVEREF(__pyx_t_4);
8546       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
8547       __pyx_t_4 = 0;
8548       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
8549       __Pyx_GOTREF(__pyx_t_2);
8550       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8551     }
8552     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8553     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error)
8554     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8555     __pyx_v_num_cells = __pyx_t_8;
8556 
8557     /* "yt/geometry/oct_container.pyx":390
8558  *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,
8559  *              int domain_id = -1):
8560  *         if num_cells == -1:             # <<<<<<<<<<<<<<
8561  *             num_cells = selector.count_octs(self, domain_id)
8562  *         cdef np.ndarray[np.uint8_t, ndim=4] mask
8563  */
8564   }
8565 
8566   /* "yt/geometry/oct_container.pyx":394
8567  *         cdef np.ndarray[np.uint8_t, ndim=4] mask
8568  *         cdef oct_visitors.MaskOcts visitor
8569  *         visitor = oct_visitors.MaskOcts(self, domain_id)             # <<<<<<<<<<<<<<
8570  *         cdef int ns = 1 << self.oref
8571  *         mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8")
8572  */
8573   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
8574   __Pyx_GOTREF(__pyx_t_2);
8575   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
8576   __Pyx_GOTREF(__pyx_t_3);
8577   __Pyx_INCREF(((PyObject *)__pyx_v_self));
8578   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8579   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8580   __Pyx_GIVEREF(__pyx_t_2);
8581   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
8582   __pyx_t_2 = 0;
8583   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
8584   __Pyx_GOTREF(__pyx_t_2);
8585   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8586   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts *)__pyx_t_2);
8587   __pyx_t_2 = 0;
8588 
8589   /* "yt/geometry/oct_container.pyx":395
8590  *         cdef oct_visitors.MaskOcts visitor
8591  *         visitor = oct_visitors.MaskOcts(self, domain_id)
8592  *         cdef int ns = 1 << self.oref             # <<<<<<<<<<<<<<
8593  *         mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8")
8594  *         visitor.mask = mask
8595  */
8596   __pyx_v_ns = (1 << __pyx_v_self->oref);
8597 
8598   /* "yt/geometry/oct_container.pyx":396
8599  *         visitor = oct_visitors.MaskOcts(self, domain_id)
8600  *         cdef int ns = 1 << self.oref
8601  *         mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8")             # <<<<<<<<<<<<<<
8602  *         visitor.mask = mask
8603  *         self.visit_all_octs(selector, visitor)
8604  */
8605   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
8606   __Pyx_GOTREF(__pyx_t_2);
8607   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
8608   __Pyx_GOTREF(__pyx_t_3);
8609   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8610   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
8611   __Pyx_GOTREF(__pyx_t_2);
8612   __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
8613   __Pyx_GOTREF(__pyx_t_7);
8614   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
8615   __Pyx_GOTREF(__pyx_t_4);
8616   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
8617   __Pyx_GOTREF(__pyx_t_5);
8618   __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 396, __pyx_L1_error)
8619   __Pyx_GOTREF(__pyx_t_9);
8620   __Pyx_GIVEREF(__pyx_t_2);
8621   PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
8622   __Pyx_GIVEREF(__pyx_t_7);
8623   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
8624   __Pyx_GIVEREF(__pyx_t_4);
8625   PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4);
8626   __Pyx_GIVEREF(__pyx_t_5);
8627   PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_5);
8628   __pyx_t_2 = 0;
8629   __pyx_t_7 = 0;
8630   __pyx_t_4 = 0;
8631   __pyx_t_5 = 0;
8632   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
8633   __Pyx_GOTREF(__pyx_t_5);
8634   __Pyx_GIVEREF(__pyx_t_9);
8635   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
8636   __pyx_t_9 = 0;
8637   __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 396, __pyx_L1_error)
8638   __Pyx_GOTREF(__pyx_t_9);
8639   if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
8640   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
8641   __Pyx_GOTREF(__pyx_t_4);
8642   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8643   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8644   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8645   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 396, __pyx_L1_error)
8646   __pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
8647   {
8648     __Pyx_BufFmt_StackElem __pyx_stack[1];
8649     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
8650     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack);
8651     if (unlikely(__pyx_t_6 < 0)) {
8652       PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
8653       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {
8654         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
8655         __Pyx_RaiseBufferFallbackError();
8656       } else {
8657         PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
8658       }
8659       __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
8660     }
8661     __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mask.diminfo[1].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mask.diminfo[1].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_mask.diminfo[2].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_mask.diminfo[2].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_mask.diminfo[3].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_mask.diminfo[3].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[3];
8662     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
8663   }
8664   __pyx_t_10 = 0;
8665   __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
8666   __pyx_t_4 = 0;
8667 
8668   /* "yt/geometry/oct_container.pyx":397
8669  *         cdef int ns = 1 << self.oref
8670  *         mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8")
8671  *         visitor.mask = mask             # <<<<<<<<<<<<<<
8672  *         self.visit_all_octs(selector, visitor)
8673  *         return mask.astype("bool")
8674  */
8675   __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_mask), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 397, __pyx_L1_error)
8676   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->mask, 0);
8677   __pyx_v_visitor->mask = __pyx_t_14;
8678   __pyx_t_14.memview = NULL;
8679   __pyx_t_14.data = NULL;
8680 
8681   /* "yt/geometry/oct_container.pyx":398
8682  *         mask = np.zeros((num_cells, ns, ns, ns), dtype="uint8")
8683  *         visitor.mask = mask
8684  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
8685  *         return mask.astype("bool")
8686  *
8687  */
8688   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
8689 
8690   /* "yt/geometry/oct_container.pyx":399
8691  *         visitor.mask = mask
8692  *         self.visit_all_octs(selector, visitor)
8693  *         return mask.astype("bool")             # <<<<<<<<<<<<<<
8694  *
8695  *     @cython.boundscheck(False)
8696  */
8697   __Pyx_XDECREF(__pyx_r);
8698   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mask), __pyx_n_s_astype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 399, __pyx_L1_error)
8699   __Pyx_GOTREF(__pyx_t_9);
8700   __pyx_t_5 = NULL;
8701   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
8702     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
8703     if (likely(__pyx_t_5)) {
8704       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8705       __Pyx_INCREF(__pyx_t_5);
8706       __Pyx_INCREF(function);
8707       __Pyx_DECREF_SET(__pyx_t_9, function);
8708     }
8709   }
8710   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_n_s_bool) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_n_s_bool);
8711   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8712   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
8713   __Pyx_GOTREF(__pyx_t_4);
8714   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8715   __pyx_r = __pyx_t_4;
8716   __pyx_t_4 = 0;
8717   goto __pyx_L0;
8718 
8719   /* "yt/geometry/oct_container.pyx":388
8720  *     @cython.wraparound(False)
8721  *     @cython.cdivision(True)
8722  *     def mask(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
8723  *              int domain_id = -1):
8724  *         if num_cells == -1:
8725  */
8726 
8727   /* function exit code */
8728   __pyx_L1_error:;
8729   __Pyx_XDECREF(__pyx_t_2);
8730   __Pyx_XDECREF(__pyx_t_3);
8731   __Pyx_XDECREF(__pyx_t_4);
8732   __Pyx_XDECREF(__pyx_t_5);
8733   __Pyx_XDECREF(__pyx_t_7);
8734   __Pyx_XDECREF(__pyx_t_9);
8735   __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
8736   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8737     __Pyx_PyThreadState_declare
8738     __Pyx_PyThreadState_assign
8739     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8740     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
8741   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8742   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
8743   __pyx_r = NULL;
8744   goto __pyx_L2;
8745   __pyx_L0:;
8746   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
8747   __pyx_L2:;
8748   __Pyx_XDECREF((PyObject *)__pyx_v_mask);
8749   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
8750   __Pyx_XGIVEREF(__pyx_r);
8751   __Pyx_RefNannyFinishContext();
8752   return __pyx_r;
8753 }
8754 
8755 /* "yt/geometry/oct_container.pyx":404
8756  *     @cython.wraparound(False)
8757  *     @cython.cdivision(True)
8758  *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
8759  *                 int domain_id = -1):
8760  *         if num_cells == -1:
8761  */
8762 
8763 /* Python wrapper */
8764 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8765 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8766   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
8767   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
8768   int __pyx_v_domain_id;
8769   PyObject *__pyx_r = 0;
8770   __Pyx_RefNannyDeclarations
8771   __Pyx_RefNannySetupContext("icoords (wrapper)", 0);
8772   {
8773     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
8774     PyObject* values[3] = {0,0,0};
8775     if (unlikely(__pyx_kwds)) {
8776       Py_ssize_t kw_args;
8777       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8778       switch (pos_args) {
8779         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8780         CYTHON_FALLTHROUGH;
8781         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8782         CYTHON_FALLTHROUGH;
8783         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8784         CYTHON_FALLTHROUGH;
8785         case  0: break;
8786         default: goto __pyx_L5_argtuple_error;
8787       }
8788       kw_args = PyDict_Size(__pyx_kwds);
8789       switch (pos_args) {
8790         case  0:
8791         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
8792         else goto __pyx_L5_argtuple_error;
8793         CYTHON_FALLTHROUGH;
8794         case  1:
8795         if (kw_args > 0) {
8796           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
8797           if (value) { values[1] = value; kw_args--; }
8798         }
8799         CYTHON_FALLTHROUGH;
8800         case  2:
8801         if (kw_args > 0) {
8802           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
8803           if (value) { values[2] = value; kw_args--; }
8804         }
8805       }
8806       if (unlikely(kw_args > 0)) {
8807         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "icoords") < 0)) __PYX_ERR(0, 404, __pyx_L3_error)
8808       }
8809     } else {
8810       switch (PyTuple_GET_SIZE(__pyx_args)) {
8811         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8812         CYTHON_FALLTHROUGH;
8813         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8814         CYTHON_FALLTHROUGH;
8815         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8816         break;
8817         default: goto __pyx_L5_argtuple_error;
8818       }
8819     }
8820     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
8821     if (values[1]) {
8822       __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L3_error)
8823     } else {
8824       __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL);
8825     }
8826     if (values[2]) {
8827       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L3_error)
8828     } else {
8829       __pyx_v_domain_id = ((int)-1);
8830     }
8831   }
8832   goto __pyx_L4_argument_unpacking_done;
8833   __pyx_L5_argtuple_error:;
8834   __Pyx_RaiseArgtupleInvalid("icoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 404, __pyx_L3_error)
8835   __pyx_L3_error:;
8836   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
8837   __Pyx_RefNannyFinishContext();
8838   return NULL;
8839   __pyx_L4_argument_unpacking_done:;
8840   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 404, __pyx_L1_error)
8841   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);
8842 
8843   /* function exit code */
8844   goto __pyx_L0;
8845   __pyx_L1_error:;
8846   __pyx_r = NULL;
8847   __pyx_L0:;
8848   __Pyx_RefNannyFinishContext();
8849   return __pyx_r;
8850 }
8851 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_int64_t __pyx_v_num_cells,int __pyx_v_domain_id)8852 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_14icoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) {
8853   struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_v_visitor = 0;
8854   PyArrayObject *__pyx_v_coords = 0;
8855   __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
8856   __Pyx_Buffer __pyx_pybuffer_coords;
8857   PyObject *__pyx_r = NULL;
8858   __Pyx_RefNannyDeclarations
8859   int __pyx_t_1;
8860   PyObject *__pyx_t_2 = NULL;
8861   PyObject *__pyx_t_3 = NULL;
8862   PyObject *__pyx_t_4 = NULL;
8863   PyObject *__pyx_t_5 = NULL;
8864   int __pyx_t_6;
8865   PyObject *__pyx_t_7 = NULL;
8866   __pyx_t_5numpy_int64_t __pyx_t_8;
8867   PyArrayObject *__pyx_t_9 = NULL;
8868   PyObject *__pyx_t_10 = NULL;
8869   PyObject *__pyx_t_11 = NULL;
8870   PyObject *__pyx_t_12 = NULL;
8871   __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
8872   __Pyx_RefNannySetupContext("icoords", 0);
8873   __pyx_pybuffer_coords.pybuffer.buf = NULL;
8874   __pyx_pybuffer_coords.refcount = 0;
8875   __pyx_pybuffernd_coords.data = NULL;
8876   __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
8877 
8878   /* "yt/geometry/oct_container.pyx":406
8879  *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,
8880  *                 int domain_id = -1):
8881  *         if num_cells == -1:             # <<<<<<<<<<<<<<
8882  *             num_cells = selector.count_oct_cells(self, domain_id)
8883  *         cdef oct_visitors.ICoordsOcts visitor
8884  */
8885   __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0);
8886   if (__pyx_t_1) {
8887 
8888     /* "yt/geometry/oct_container.pyx":407
8889  *                 int domain_id = -1):
8890  *         if num_cells == -1:
8891  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
8892  *         cdef oct_visitors.ICoordsOcts visitor
8893  *         visitor = oct_visitors.ICoordsOcts(self, domain_id)
8894  */
8895     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
8896     __Pyx_GOTREF(__pyx_t_3);
8897     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
8898     __Pyx_GOTREF(__pyx_t_4);
8899     __pyx_t_5 = NULL;
8900     __pyx_t_6 = 0;
8901     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8902       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8903       if (likely(__pyx_t_5)) {
8904         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8905         __Pyx_INCREF(__pyx_t_5);
8906         __Pyx_INCREF(function);
8907         __Pyx_DECREF_SET(__pyx_t_3, function);
8908         __pyx_t_6 = 1;
8909       }
8910     }
8911     #if CYTHON_FAST_PYCALL
8912     if (PyFunction_Check(__pyx_t_3)) {
8913       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
8914       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
8915       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8916       __Pyx_GOTREF(__pyx_t_2);
8917       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8918     } else
8919     #endif
8920     #if CYTHON_FAST_PYCCALL
8921     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8922       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
8923       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
8924       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8925       __Pyx_GOTREF(__pyx_t_2);
8926       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8927     } else
8928     #endif
8929     {
8930       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error)
8931       __Pyx_GOTREF(__pyx_t_7);
8932       if (__pyx_t_5) {
8933         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8934       }
8935       __Pyx_INCREF(((PyObject *)__pyx_v_self));
8936       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8937       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
8938       __Pyx_GIVEREF(__pyx_t_4);
8939       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
8940       __pyx_t_4 = 0;
8941       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
8942       __Pyx_GOTREF(__pyx_t_2);
8943       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8944     }
8945     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8946     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error)
8947     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8948     __pyx_v_num_cells = __pyx_t_8;
8949 
8950     /* "yt/geometry/oct_container.pyx":406
8951  *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,
8952  *                 int domain_id = -1):
8953  *         if num_cells == -1:             # <<<<<<<<<<<<<<
8954  *             num_cells = selector.count_oct_cells(self, domain_id)
8955  *         cdef oct_visitors.ICoordsOcts visitor
8956  */
8957   }
8958 
8959   /* "yt/geometry/oct_container.pyx":409
8960  *             num_cells = selector.count_oct_cells(self, domain_id)
8961  *         cdef oct_visitors.ICoordsOcts visitor
8962  *         visitor = oct_visitors.ICoordsOcts(self, domain_id)             # <<<<<<<<<<<<<<
8963  *         cdef np.ndarray[np.int64_t, ndim=2] coords
8964  *         coords = np.empty((num_cells, 3), dtype="int64")
8965  */
8966   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
8967   __Pyx_GOTREF(__pyx_t_2);
8968   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
8969   __Pyx_GOTREF(__pyx_t_3);
8970   __Pyx_INCREF(((PyObject *)__pyx_v_self));
8971   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8972   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8973   __Pyx_GIVEREF(__pyx_t_2);
8974   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
8975   __pyx_t_2 = 0;
8976   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
8977   __Pyx_GOTREF(__pyx_t_2);
8978   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8979   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts *)__pyx_t_2);
8980   __pyx_t_2 = 0;
8981 
8982   /* "yt/geometry/oct_container.pyx":411
8983  *         visitor = oct_visitors.ICoordsOcts(self, domain_id)
8984  *         cdef np.ndarray[np.int64_t, ndim=2] coords
8985  *         coords = np.empty((num_cells, 3), dtype="int64")             # <<<<<<<<<<<<<<
8986  *         visitor.icoords = coords
8987  *         self.visit_all_octs(selector, visitor)
8988  */
8989   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
8990   __Pyx_GOTREF(__pyx_t_2);
8991   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
8992   __Pyx_GOTREF(__pyx_t_3);
8993   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8994   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
8995   __Pyx_GOTREF(__pyx_t_2);
8996   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
8997   __Pyx_GOTREF(__pyx_t_7);
8998   __Pyx_GIVEREF(__pyx_t_2);
8999   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
9000   __Pyx_INCREF(__pyx_int_3);
9001   __Pyx_GIVEREF(__pyx_int_3);
9002   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3);
9003   __pyx_t_2 = 0;
9004   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
9005   __Pyx_GOTREF(__pyx_t_2);
9006   __Pyx_GIVEREF(__pyx_t_7);
9007   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
9008   __pyx_t_7 = 0;
9009   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
9010   __Pyx_GOTREF(__pyx_t_7);
9011   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
9012   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error)
9013   __Pyx_GOTREF(__pyx_t_4);
9014   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9015   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9016   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9017   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 411, __pyx_L1_error)
9018   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
9019   {
9020     __Pyx_BufFmt_StackElem __pyx_stack[1];
9021     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
9022     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
9023     if (unlikely(__pyx_t_6 < 0)) {
9024       PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9025       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
9026         Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
9027         __Pyx_RaiseBufferFallbackError();
9028       } else {
9029         PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9030       }
9031       __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
9032     }
9033     __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1];
9034     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
9035   }
9036   __pyx_t_9 = 0;
9037   __pyx_v_coords = ((PyArrayObject *)__pyx_t_4);
9038   __pyx_t_4 = 0;
9039 
9040   /* "yt/geometry/oct_container.pyx":412
9041  *         cdef np.ndarray[np.int64_t, ndim=2] coords
9042  *         coords = np.empty((num_cells, 3), dtype="int64")
9043  *         visitor.icoords = coords             # <<<<<<<<<<<<<<
9044  *         self.visit_all_octs(selector, visitor)
9045  *         return coords
9046  */
9047   __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_coords), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 412, __pyx_L1_error)
9048   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->icoords, 0);
9049   __pyx_v_visitor->icoords = __pyx_t_13;
9050   __pyx_t_13.memview = NULL;
9051   __pyx_t_13.data = NULL;
9052 
9053   /* "yt/geometry/oct_container.pyx":413
9054  *         coords = np.empty((num_cells, 3), dtype="int64")
9055  *         visitor.icoords = coords
9056  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
9057  *         return coords
9058  *
9059  */
9060   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
9061 
9062   /* "yt/geometry/oct_container.pyx":414
9063  *         visitor.icoords = coords
9064  *         self.visit_all_octs(selector, visitor)
9065  *         return coords             # <<<<<<<<<<<<<<
9066  *
9067  *     @cython.boundscheck(False)
9068  */
9069   __Pyx_XDECREF(__pyx_r);
9070   __Pyx_INCREF(((PyObject *)__pyx_v_coords));
9071   __pyx_r = ((PyObject *)__pyx_v_coords);
9072   goto __pyx_L0;
9073 
9074   /* "yt/geometry/oct_container.pyx":404
9075  *     @cython.wraparound(False)
9076  *     @cython.cdivision(True)
9077  *     def icoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9078  *                 int domain_id = -1):
9079  *         if num_cells == -1:
9080  */
9081 
9082   /* function exit code */
9083   __pyx_L1_error:;
9084   __Pyx_XDECREF(__pyx_t_2);
9085   __Pyx_XDECREF(__pyx_t_3);
9086   __Pyx_XDECREF(__pyx_t_4);
9087   __Pyx_XDECREF(__pyx_t_5);
9088   __Pyx_XDECREF(__pyx_t_7);
9089   __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
9090   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9091     __Pyx_PyThreadState_declare
9092     __Pyx_PyThreadState_assign
9093     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9094     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
9095   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9096   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
9097   __pyx_r = NULL;
9098   goto __pyx_L2;
9099   __pyx_L0:;
9100   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
9101   __pyx_L2:;
9102   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
9103   __Pyx_XDECREF((PyObject *)__pyx_v_coords);
9104   __Pyx_XGIVEREF(__pyx_r);
9105   __Pyx_RefNannyFinishContext();
9106   return __pyx_r;
9107 }
9108 
9109 /* "yt/geometry/oct_container.pyx":419
9110  *     @cython.wraparound(False)
9111  *     @cython.cdivision(True)
9112  *     def ires(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9113  *                 int domain_id = -1):
9114  *         cdef int i
9115  */
9116 
9117 /* Python wrapper */
9118 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9119 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9120   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
9121   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
9122   int __pyx_v_domain_id;
9123   PyObject *__pyx_r = 0;
9124   __Pyx_RefNannyDeclarations
9125   __Pyx_RefNannySetupContext("ires (wrapper)", 0);
9126   {
9127     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
9128     PyObject* values[3] = {0,0,0};
9129     if (unlikely(__pyx_kwds)) {
9130       Py_ssize_t kw_args;
9131       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9132       switch (pos_args) {
9133         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9134         CYTHON_FALLTHROUGH;
9135         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9136         CYTHON_FALLTHROUGH;
9137         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9138         CYTHON_FALLTHROUGH;
9139         case  0: break;
9140         default: goto __pyx_L5_argtuple_error;
9141       }
9142       kw_args = PyDict_Size(__pyx_kwds);
9143       switch (pos_args) {
9144         case  0:
9145         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
9146         else goto __pyx_L5_argtuple_error;
9147         CYTHON_FALLTHROUGH;
9148         case  1:
9149         if (kw_args > 0) {
9150           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
9151           if (value) { values[1] = value; kw_args--; }
9152         }
9153         CYTHON_FALLTHROUGH;
9154         case  2:
9155         if (kw_args > 0) {
9156           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
9157           if (value) { values[2] = value; kw_args--; }
9158         }
9159       }
9160       if (unlikely(kw_args > 0)) {
9161         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ires") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
9162       }
9163     } else {
9164       switch (PyTuple_GET_SIZE(__pyx_args)) {
9165         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9166         CYTHON_FALLTHROUGH;
9167         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9168         CYTHON_FALLTHROUGH;
9169         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9170         break;
9171         default: goto __pyx_L5_argtuple_error;
9172       }
9173     }
9174     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
9175     if (values[1]) {
9176       __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L3_error)
9177     } else {
9178       __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL);
9179     }
9180     if (values[2]) {
9181       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error)
9182     } else {
9183       __pyx_v_domain_id = ((int)-1);
9184     }
9185   }
9186   goto __pyx_L4_argument_unpacking_done;
9187   __pyx_L5_argtuple_error:;
9188   __Pyx_RaiseArgtupleInvalid("ires", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
9189   __pyx_L3_error:;
9190   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
9191   __Pyx_RefNannyFinishContext();
9192   return NULL;
9193   __pyx_L4_argument_unpacking_done:;
9194   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 419, __pyx_L1_error)
9195   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);
9196 
9197   /* function exit code */
9198   goto __pyx_L0;
9199   __pyx_L1_error:;
9200   __pyx_r = NULL;
9201   __pyx_L0:;
9202   __Pyx_RefNannyFinishContext();
9203   return __pyx_r;
9204 }
9205 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_int64_t __pyx_v_num_cells,int __pyx_v_domain_id)9206 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_16ires(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) {
9207   int __pyx_v_i;
9208   struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *__pyx_v_visitor = 0;
9209   PyArrayObject *__pyx_v_res = 0;
9210   __Pyx_LocalBuf_ND __pyx_pybuffernd_res;
9211   __Pyx_Buffer __pyx_pybuffer_res;
9212   PyObject *__pyx_r = NULL;
9213   __Pyx_RefNannyDeclarations
9214   int __pyx_t_1;
9215   PyObject *__pyx_t_2 = NULL;
9216   PyObject *__pyx_t_3 = NULL;
9217   PyObject *__pyx_t_4 = NULL;
9218   PyObject *__pyx_t_5 = NULL;
9219   int __pyx_t_6;
9220   PyObject *__pyx_t_7 = NULL;
9221   __pyx_t_5numpy_int64_t __pyx_t_8;
9222   PyArrayObject *__pyx_t_9 = NULL;
9223   PyObject *__pyx_t_10 = NULL;
9224   PyObject *__pyx_t_11 = NULL;
9225   PyObject *__pyx_t_12 = NULL;
9226   __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
9227   __pyx_t_5numpy_int64_t __pyx_t_14;
9228   Py_ssize_t __pyx_t_15;
9229   __Pyx_RefNannySetupContext("ires", 0);
9230   __pyx_pybuffer_res.pybuffer.buf = NULL;
9231   __pyx_pybuffer_res.refcount = 0;
9232   __pyx_pybuffernd_res.data = NULL;
9233   __pyx_pybuffernd_res.rcbuffer = &__pyx_pybuffer_res;
9234 
9235   /* "yt/geometry/oct_container.pyx":422
9236  *                 int domain_id = -1):
9237  *         cdef int i
9238  *         if num_cells == -1:             # <<<<<<<<<<<<<<
9239  *             num_cells = selector.count_oct_cells(self, domain_id)
9240  *         cdef oct_visitors.IResOcts visitor
9241  */
9242   __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0);
9243   if (__pyx_t_1) {
9244 
9245     /* "yt/geometry/oct_container.pyx":423
9246  *         cdef int i
9247  *         if num_cells == -1:
9248  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
9249  *         cdef oct_visitors.IResOcts visitor
9250  *         visitor = oct_visitors.IResOcts(self, domain_id)
9251  */
9252     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
9253     __Pyx_GOTREF(__pyx_t_3);
9254     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
9255     __Pyx_GOTREF(__pyx_t_4);
9256     __pyx_t_5 = NULL;
9257     __pyx_t_6 = 0;
9258     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9259       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
9260       if (likely(__pyx_t_5)) {
9261         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9262         __Pyx_INCREF(__pyx_t_5);
9263         __Pyx_INCREF(function);
9264         __Pyx_DECREF_SET(__pyx_t_3, function);
9265         __pyx_t_6 = 1;
9266       }
9267     }
9268     #if CYTHON_FAST_PYCALL
9269     if (PyFunction_Check(__pyx_t_3)) {
9270       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
9271       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9272       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9273       __Pyx_GOTREF(__pyx_t_2);
9274       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9275     } else
9276     #endif
9277     #if CYTHON_FAST_PYCCALL
9278     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9279       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
9280       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9281       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9282       __Pyx_GOTREF(__pyx_t_2);
9283       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9284     } else
9285     #endif
9286     {
9287       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error)
9288       __Pyx_GOTREF(__pyx_t_7);
9289       if (__pyx_t_5) {
9290         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
9291       }
9292       __Pyx_INCREF(((PyObject *)__pyx_v_self));
9293       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9294       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
9295       __Pyx_GIVEREF(__pyx_t_4);
9296       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
9297       __pyx_t_4 = 0;
9298       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9299       __Pyx_GOTREF(__pyx_t_2);
9300       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9301     }
9302     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9303     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error)
9304     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9305     __pyx_v_num_cells = __pyx_t_8;
9306 
9307     /* "yt/geometry/oct_container.pyx":422
9308  *                 int domain_id = -1):
9309  *         cdef int i
9310  *         if num_cells == -1:             # <<<<<<<<<<<<<<
9311  *             num_cells = selector.count_oct_cells(self, domain_id)
9312  *         cdef oct_visitors.IResOcts visitor
9313  */
9314   }
9315 
9316   /* "yt/geometry/oct_container.pyx":425
9317  *             num_cells = selector.count_oct_cells(self, domain_id)
9318  *         cdef oct_visitors.IResOcts visitor
9319  *         visitor = oct_visitors.IResOcts(self, domain_id)             # <<<<<<<<<<<<<<
9320  *         #Return the 'resolution' of each cell; ie the level
9321  *         cdef np.ndarray[np.int64_t, ndim=1] res
9322  */
9323   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
9324   __Pyx_GOTREF(__pyx_t_2);
9325   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
9326   __Pyx_GOTREF(__pyx_t_3);
9327   __Pyx_INCREF(((PyObject *)__pyx_v_self));
9328   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9329   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9330   __Pyx_GIVEREF(__pyx_t_2);
9331   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
9332   __pyx_t_2 = 0;
9333   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
9334   __Pyx_GOTREF(__pyx_t_2);
9335   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9336   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts *)__pyx_t_2);
9337   __pyx_t_2 = 0;
9338 
9339   /* "yt/geometry/oct_container.pyx":428
9340  *         #Return the 'resolution' of each cell; ie the level
9341  *         cdef np.ndarray[np.int64_t, ndim=1] res
9342  *         res = np.empty(num_cells, dtype="int64")             # <<<<<<<<<<<<<<
9343  *         visitor.ires = res
9344  *         self.visit_all_octs(selector, visitor)
9345  */
9346   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
9347   __Pyx_GOTREF(__pyx_t_2);
9348   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
9349   __Pyx_GOTREF(__pyx_t_3);
9350   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9351   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
9352   __Pyx_GOTREF(__pyx_t_2);
9353   __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
9354   __Pyx_GOTREF(__pyx_t_7);
9355   __Pyx_GIVEREF(__pyx_t_2);
9356   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
9357   __pyx_t_2 = 0;
9358   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
9359   __Pyx_GOTREF(__pyx_t_2);
9360   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
9361   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
9362   __Pyx_GOTREF(__pyx_t_4);
9363   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9364   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9365   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9366   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 428, __pyx_L1_error)
9367   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
9368   {
9369     __Pyx_BufFmt_StackElem __pyx_stack[1];
9370     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
9371     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
9372     if (unlikely(__pyx_t_6 < 0)) {
9373       PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9374       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_res.rcbuffer->pybuffer, (PyObject*)__pyx_v_res, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9375         Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
9376         __Pyx_RaiseBufferFallbackError();
9377       } else {
9378         PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9379       }
9380       __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
9381     }
9382     __pyx_pybuffernd_res.diminfo[0].strides = __pyx_pybuffernd_res.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_res.diminfo[0].shape = __pyx_pybuffernd_res.rcbuffer->pybuffer.shape[0];
9383     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
9384   }
9385   __pyx_t_9 = 0;
9386   __pyx_v_res = ((PyArrayObject *)__pyx_t_4);
9387   __pyx_t_4 = 0;
9388 
9389   /* "yt/geometry/oct_container.pyx":429
9390  *         cdef np.ndarray[np.int64_t, ndim=1] res
9391  *         res = np.empty(num_cells, dtype="int64")
9392  *         visitor.ires = res             # <<<<<<<<<<<<<<
9393  *         self.visit_all_octs(selector, visitor)
9394  *         if self.level_offset > 0:
9395  */
9396   __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_res), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 429, __pyx_L1_error)
9397   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ires, 0);
9398   __pyx_v_visitor->ires = __pyx_t_13;
9399   __pyx_t_13.memview = NULL;
9400   __pyx_t_13.data = NULL;
9401 
9402   /* "yt/geometry/oct_container.pyx":430
9403  *         res = np.empty(num_cells, dtype="int64")
9404  *         visitor.ires = res
9405  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
9406  *         if self.level_offset > 0:
9407  *             for i in range(num_cells):
9408  */
9409   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
9410 
9411   /* "yt/geometry/oct_container.pyx":431
9412  *         visitor.ires = res
9413  *         self.visit_all_octs(selector, visitor)
9414  *         if self.level_offset > 0:             # <<<<<<<<<<<<<<
9415  *             for i in range(num_cells):
9416  *                 res[i] += self.level_offset
9417  */
9418   __pyx_t_1 = ((__pyx_v_self->level_offset > 0) != 0);
9419   if (__pyx_t_1) {
9420 
9421     /* "yt/geometry/oct_container.pyx":432
9422  *         self.visit_all_octs(selector, visitor)
9423  *         if self.level_offset > 0:
9424  *             for i in range(num_cells):             # <<<<<<<<<<<<<<
9425  *                 res[i] += self.level_offset
9426  *         return res
9427  */
9428     __pyx_t_8 = __pyx_v_num_cells;
9429     __pyx_t_14 = __pyx_t_8;
9430     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_14; __pyx_t_6+=1) {
9431       __pyx_v_i = __pyx_t_6;
9432 
9433       /* "yt/geometry/oct_container.pyx":433
9434  *         if self.level_offset > 0:
9435  *             for i in range(num_cells):
9436  *                 res[i] += self.level_offset             # <<<<<<<<<<<<<<
9437  *         return res
9438  *
9439  */
9440       __pyx_t_15 = __pyx_v_i;
9441       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_res.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_res.diminfo[0].strides) += __pyx_v_self->level_offset;
9442     }
9443 
9444     /* "yt/geometry/oct_container.pyx":431
9445  *         visitor.ires = res
9446  *         self.visit_all_octs(selector, visitor)
9447  *         if self.level_offset > 0:             # <<<<<<<<<<<<<<
9448  *             for i in range(num_cells):
9449  *                 res[i] += self.level_offset
9450  */
9451   }
9452 
9453   /* "yt/geometry/oct_container.pyx":434
9454  *             for i in range(num_cells):
9455  *                 res[i] += self.level_offset
9456  *         return res             # <<<<<<<<<<<<<<
9457  *
9458  *     @cython.boundscheck(False)
9459  */
9460   __Pyx_XDECREF(__pyx_r);
9461   __Pyx_INCREF(((PyObject *)__pyx_v_res));
9462   __pyx_r = ((PyObject *)__pyx_v_res);
9463   goto __pyx_L0;
9464 
9465   /* "yt/geometry/oct_container.pyx":419
9466  *     @cython.wraparound(False)
9467  *     @cython.cdivision(True)
9468  *     def ires(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9469  *                 int domain_id = -1):
9470  *         cdef int i
9471  */
9472 
9473   /* function exit code */
9474   __pyx_L1_error:;
9475   __Pyx_XDECREF(__pyx_t_2);
9476   __Pyx_XDECREF(__pyx_t_3);
9477   __Pyx_XDECREF(__pyx_t_4);
9478   __Pyx_XDECREF(__pyx_t_5);
9479   __Pyx_XDECREF(__pyx_t_7);
9480   __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
9481   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9482     __Pyx_PyThreadState_declare
9483     __Pyx_PyThreadState_assign
9484     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9485     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
9486   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9487   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
9488   __pyx_r = NULL;
9489   goto __pyx_L2;
9490   __pyx_L0:;
9491   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_res.rcbuffer->pybuffer);
9492   __pyx_L2:;
9493   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
9494   __Pyx_XDECREF((PyObject *)__pyx_v_res);
9495   __Pyx_XGIVEREF(__pyx_r);
9496   __Pyx_RefNannyFinishContext();
9497   return __pyx_r;
9498 }
9499 
9500 /* "yt/geometry/oct_container.pyx":439
9501  *     @cython.wraparound(False)
9502  *     @cython.cdivision(True)
9503  *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9504  *                 int domain_id = -1):
9505  *         if num_cells == -1:
9506  */
9507 
9508 /* Python wrapper */
9509 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9510 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9511   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
9512   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
9513   int __pyx_v_domain_id;
9514   PyObject *__pyx_r = 0;
9515   __Pyx_RefNannyDeclarations
9516   __Pyx_RefNannySetupContext("fwidth (wrapper)", 0);
9517   {
9518     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
9519     PyObject* values[3] = {0,0,0};
9520     if (unlikely(__pyx_kwds)) {
9521       Py_ssize_t kw_args;
9522       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9523       switch (pos_args) {
9524         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9525         CYTHON_FALLTHROUGH;
9526         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9527         CYTHON_FALLTHROUGH;
9528         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9529         CYTHON_FALLTHROUGH;
9530         case  0: break;
9531         default: goto __pyx_L5_argtuple_error;
9532       }
9533       kw_args = PyDict_Size(__pyx_kwds);
9534       switch (pos_args) {
9535         case  0:
9536         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
9537         else goto __pyx_L5_argtuple_error;
9538         CYTHON_FALLTHROUGH;
9539         case  1:
9540         if (kw_args > 0) {
9541           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
9542           if (value) { values[1] = value; kw_args--; }
9543         }
9544         CYTHON_FALLTHROUGH;
9545         case  2:
9546         if (kw_args > 0) {
9547           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
9548           if (value) { values[2] = value; kw_args--; }
9549         }
9550       }
9551       if (unlikely(kw_args > 0)) {
9552         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fwidth") < 0)) __PYX_ERR(0, 439, __pyx_L3_error)
9553       }
9554     } else {
9555       switch (PyTuple_GET_SIZE(__pyx_args)) {
9556         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9557         CYTHON_FALLTHROUGH;
9558         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9559         CYTHON_FALLTHROUGH;
9560         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9561         break;
9562         default: goto __pyx_L5_argtuple_error;
9563       }
9564     }
9565     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
9566     if (values[1]) {
9567       __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L3_error)
9568     } else {
9569       __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL);
9570     }
9571     if (values[2]) {
9572       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error)
9573     } else {
9574       __pyx_v_domain_id = ((int)-1);
9575     }
9576   }
9577   goto __pyx_L4_argument_unpacking_done;
9578   __pyx_L5_argtuple_error:;
9579   __Pyx_RaiseArgtupleInvalid("fwidth", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 439, __pyx_L3_error)
9580   __pyx_L3_error:;
9581   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
9582   __Pyx_RefNannyFinishContext();
9583   return NULL;
9584   __pyx_L4_argument_unpacking_done:;
9585   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 439, __pyx_L1_error)
9586   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);
9587 
9588   /* function exit code */
9589   goto __pyx_L0;
9590   __pyx_L1_error:;
9591   __pyx_r = NULL;
9592   __pyx_L0:;
9593   __Pyx_RefNannyFinishContext();
9594   return __pyx_r;
9595 }
9596 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_int64_t __pyx_v_num_cells,int __pyx_v_domain_id)9597 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_18fwidth(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) {
9598   struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_v_visitor = 0;
9599   PyArrayObject *__pyx_v_fwidth = 0;
9600   __pyx_t_5numpy_float64_t __pyx_v_base_dx;
9601   long __pyx_v_i;
9602   __Pyx_LocalBuf_ND __pyx_pybuffernd_fwidth;
9603   __Pyx_Buffer __pyx_pybuffer_fwidth;
9604   PyObject *__pyx_r = NULL;
9605   __Pyx_RefNannyDeclarations
9606   int __pyx_t_1;
9607   PyObject *__pyx_t_2 = NULL;
9608   PyObject *__pyx_t_3 = NULL;
9609   PyObject *__pyx_t_4 = NULL;
9610   PyObject *__pyx_t_5 = NULL;
9611   int __pyx_t_6;
9612   PyObject *__pyx_t_7 = NULL;
9613   __pyx_t_5numpy_int64_t __pyx_t_8;
9614   PyArrayObject *__pyx_t_9 = NULL;
9615   PyObject *__pyx_t_10 = NULL;
9616   PyObject *__pyx_t_11 = NULL;
9617   PyObject *__pyx_t_12 = NULL;
9618   __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
9619   long __pyx_t_14;
9620   __Pyx_RefNannySetupContext("fwidth", 0);
9621   __pyx_pybuffer_fwidth.pybuffer.buf = NULL;
9622   __pyx_pybuffer_fwidth.refcount = 0;
9623   __pyx_pybuffernd_fwidth.data = NULL;
9624   __pyx_pybuffernd_fwidth.rcbuffer = &__pyx_pybuffer_fwidth;
9625 
9626   /* "yt/geometry/oct_container.pyx":441
9627  *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,
9628  *                 int domain_id = -1):
9629  *         if num_cells == -1:             # <<<<<<<<<<<<<<
9630  *             num_cells = selector.count_oct_cells(self, domain_id)
9631  *         cdef oct_visitors.FWidthOcts visitor
9632  */
9633   __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0);
9634   if (__pyx_t_1) {
9635 
9636     /* "yt/geometry/oct_container.pyx":442
9637  *                 int domain_id = -1):
9638  *         if num_cells == -1:
9639  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
9640  *         cdef oct_visitors.FWidthOcts visitor
9641  *         visitor = oct_visitors.FWidthOcts(self, domain_id)
9642  */
9643     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
9644     __Pyx_GOTREF(__pyx_t_3);
9645     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
9646     __Pyx_GOTREF(__pyx_t_4);
9647     __pyx_t_5 = NULL;
9648     __pyx_t_6 = 0;
9649     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9650       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
9651       if (likely(__pyx_t_5)) {
9652         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9653         __Pyx_INCREF(__pyx_t_5);
9654         __Pyx_INCREF(function);
9655         __Pyx_DECREF_SET(__pyx_t_3, function);
9656         __pyx_t_6 = 1;
9657       }
9658     }
9659     #if CYTHON_FAST_PYCALL
9660     if (PyFunction_Check(__pyx_t_3)) {
9661       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
9662       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
9663       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9664       __Pyx_GOTREF(__pyx_t_2);
9665       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9666     } else
9667     #endif
9668     #if CYTHON_FAST_PYCCALL
9669     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9670       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
9671       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
9672       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9673       __Pyx_GOTREF(__pyx_t_2);
9674       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9675     } else
9676     #endif
9677     {
9678       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
9679       __Pyx_GOTREF(__pyx_t_7);
9680       if (__pyx_t_5) {
9681         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
9682       }
9683       __Pyx_INCREF(((PyObject *)__pyx_v_self));
9684       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9685       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
9686       __Pyx_GIVEREF(__pyx_t_4);
9687       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
9688       __pyx_t_4 = 0;
9689       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
9690       __Pyx_GOTREF(__pyx_t_2);
9691       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9692     }
9693     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9694     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
9695     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9696     __pyx_v_num_cells = __pyx_t_8;
9697 
9698     /* "yt/geometry/oct_container.pyx":441
9699  *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,
9700  *                 int domain_id = -1):
9701  *         if num_cells == -1:             # <<<<<<<<<<<<<<
9702  *             num_cells = selector.count_oct_cells(self, domain_id)
9703  *         cdef oct_visitors.FWidthOcts visitor
9704  */
9705   }
9706 
9707   /* "yt/geometry/oct_container.pyx":444
9708  *             num_cells = selector.count_oct_cells(self, domain_id)
9709  *         cdef oct_visitors.FWidthOcts visitor
9710  *         visitor = oct_visitors.FWidthOcts(self, domain_id)             # <<<<<<<<<<<<<<
9711  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
9712  *         fwidth = np.empty((num_cells, 3), dtype="float64")
9713  */
9714   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
9715   __Pyx_GOTREF(__pyx_t_2);
9716   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
9717   __Pyx_GOTREF(__pyx_t_3);
9718   __Pyx_INCREF(((PyObject *)__pyx_v_self));
9719   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9720   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9721   __Pyx_GIVEREF(__pyx_t_2);
9722   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
9723   __pyx_t_2 = 0;
9724   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
9725   __Pyx_GOTREF(__pyx_t_2);
9726   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9727   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts *)__pyx_t_2);
9728   __pyx_t_2 = 0;
9729 
9730   /* "yt/geometry/oct_container.pyx":446
9731  *         visitor = oct_visitors.FWidthOcts(self, domain_id)
9732  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
9733  *         fwidth = np.empty((num_cells, 3), dtype="float64")             # <<<<<<<<<<<<<<
9734  *         visitor.fwidth = fwidth
9735  *         self.visit_all_octs(selector, visitor)
9736  */
9737   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
9738   __Pyx_GOTREF(__pyx_t_2);
9739   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
9740   __Pyx_GOTREF(__pyx_t_3);
9741   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9742   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
9743   __Pyx_GOTREF(__pyx_t_2);
9744   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
9745   __Pyx_GOTREF(__pyx_t_7);
9746   __Pyx_GIVEREF(__pyx_t_2);
9747   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
9748   __Pyx_INCREF(__pyx_int_3);
9749   __Pyx_GIVEREF(__pyx_int_3);
9750   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3);
9751   __pyx_t_2 = 0;
9752   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
9753   __Pyx_GOTREF(__pyx_t_2);
9754   __Pyx_GIVEREF(__pyx_t_7);
9755   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
9756   __pyx_t_7 = 0;
9757   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
9758   __Pyx_GOTREF(__pyx_t_7);
9759   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
9760   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
9761   __Pyx_GOTREF(__pyx_t_4);
9762   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9763   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9764   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9765   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 446, __pyx_L1_error)
9766   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
9767   {
9768     __Pyx_BufFmt_StackElem __pyx_stack[1];
9769     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
9770     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
9771     if (unlikely(__pyx_t_6 < 0)) {
9772       PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9773       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_v_fwidth, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
9774         Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
9775         __Pyx_RaiseBufferFallbackError();
9776       } else {
9777         PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9778       }
9779       __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
9780     }
9781     __pyx_pybuffernd_fwidth.diminfo[0].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidth.diminfo[0].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidth.diminfo[1].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidth.diminfo[1].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[1];
9782     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 446, __pyx_L1_error)
9783   }
9784   __pyx_t_9 = 0;
9785   __pyx_v_fwidth = ((PyArrayObject *)__pyx_t_4);
9786   __pyx_t_4 = 0;
9787 
9788   /* "yt/geometry/oct_container.pyx":447
9789  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
9790  *         fwidth = np.empty((num_cells, 3), dtype="float64")
9791  *         visitor.fwidth = fwidth             # <<<<<<<<<<<<<<
9792  *         self.visit_all_octs(selector, visitor)
9793  *         cdef np.float64_t base_dx
9794  */
9795   __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_fwidth), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 447, __pyx_L1_error)
9796   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->fwidth, 0);
9797   __pyx_v_visitor->fwidth = __pyx_t_13;
9798   __pyx_t_13.memview = NULL;
9799   __pyx_t_13.data = NULL;
9800 
9801   /* "yt/geometry/oct_container.pyx":448
9802  *         fwidth = np.empty((num_cells, 3), dtype="float64")
9803  *         visitor.fwidth = fwidth
9804  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
9805  *         cdef np.float64_t base_dx
9806  *         for i in range(3):
9807  */
9808   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
9809 
9810   /* "yt/geometry/oct_container.pyx":450
9811  *         self.visit_all_octs(selector, visitor)
9812  *         cdef np.float64_t base_dx
9813  *         for i in range(3):             # <<<<<<<<<<<<<<
9814  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
9815  *             fwidth[:,i] *= base_dx
9816  */
9817   for (__pyx_t_14 = 0; __pyx_t_14 < 3; __pyx_t_14+=1) {
9818     __pyx_v_i = __pyx_t_14;
9819 
9820     /* "yt/geometry/oct_container.pyx":451
9821  *         cdef np.float64_t base_dx
9822  *         for i in range(3):
9823  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]             # <<<<<<<<<<<<<<
9824  *             fwidth[:,i] *= base_dx
9825  *         return fwidth
9826  */
9827     __pyx_v_base_dx = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i]));
9828 
9829     /* "yt/geometry/oct_container.pyx":452
9830  *         for i in range(3):
9831  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
9832  *             fwidth[:,i] *= base_dx             # <<<<<<<<<<<<<<
9833  *         return fwidth
9834  *
9835  */
9836     __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
9837     __Pyx_GOTREF(__pyx_t_4);
9838     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
9839     __Pyx_GOTREF(__pyx_t_7);
9840     __Pyx_INCREF(__pyx_slice__2);
9841     __Pyx_GIVEREF(__pyx_slice__2);
9842     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__2);
9843     __Pyx_GIVEREF(__pyx_t_4);
9844     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
9845     __pyx_t_4 = 0;
9846     __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
9847     __Pyx_GOTREF(__pyx_t_4);
9848     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
9849     __Pyx_GOTREF(__pyx_t_2);
9850     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
9851     __Pyx_GOTREF(__pyx_t_3);
9852     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9853     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9854     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_fwidth), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
9855     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9856     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9857   }
9858 
9859   /* "yt/geometry/oct_container.pyx":453
9860  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
9861  *             fwidth[:,i] *= base_dx
9862  *         return fwidth             # <<<<<<<<<<<<<<
9863  *
9864  *     @cython.boundscheck(False)
9865  */
9866   __Pyx_XDECREF(__pyx_r);
9867   __Pyx_INCREF(((PyObject *)__pyx_v_fwidth));
9868   __pyx_r = ((PyObject *)__pyx_v_fwidth);
9869   goto __pyx_L0;
9870 
9871   /* "yt/geometry/oct_container.pyx":439
9872  *     @cython.wraparound(False)
9873  *     @cython.cdivision(True)
9874  *     def fwidth(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9875  *                 int domain_id = -1):
9876  *         if num_cells == -1:
9877  */
9878 
9879   /* function exit code */
9880   __pyx_L1_error:;
9881   __Pyx_XDECREF(__pyx_t_2);
9882   __Pyx_XDECREF(__pyx_t_3);
9883   __Pyx_XDECREF(__pyx_t_4);
9884   __Pyx_XDECREF(__pyx_t_5);
9885   __Pyx_XDECREF(__pyx_t_7);
9886   __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
9887   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9888     __Pyx_PyThreadState_declare
9889     __Pyx_PyThreadState_assign
9890     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9891     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
9892   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9893   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
9894   __pyx_r = NULL;
9895   goto __pyx_L2;
9896   __pyx_L0:;
9897   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
9898   __pyx_L2:;
9899   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
9900   __Pyx_XDECREF((PyObject *)__pyx_v_fwidth);
9901   __Pyx_XGIVEREF(__pyx_r);
9902   __Pyx_RefNannyFinishContext();
9903   return __pyx_r;
9904 }
9905 
9906 /* "yt/geometry/oct_container.pyx":458
9907  *     @cython.wraparound(False)
9908  *     @cython.cdivision(True)
9909  *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
9910  *                 int domain_id = -1):
9911  *         if num_cells == -1:
9912  */
9913 
9914 /* Python wrapper */
9915 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9916 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9917   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
9918   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
9919   int __pyx_v_domain_id;
9920   PyObject *__pyx_r = 0;
9921   __Pyx_RefNannyDeclarations
9922   __Pyx_RefNannySetupContext("fcoords (wrapper)", 0);
9923   {
9924     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_cells,&__pyx_n_s_domain_id,0};
9925     PyObject* values[3] = {0,0,0};
9926     if (unlikely(__pyx_kwds)) {
9927       Py_ssize_t kw_args;
9928       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9929       switch (pos_args) {
9930         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9931         CYTHON_FALLTHROUGH;
9932         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9933         CYTHON_FALLTHROUGH;
9934         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9935         CYTHON_FALLTHROUGH;
9936         case  0: break;
9937         default: goto __pyx_L5_argtuple_error;
9938       }
9939       kw_args = PyDict_Size(__pyx_kwds);
9940       switch (pos_args) {
9941         case  0:
9942         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
9943         else goto __pyx_L5_argtuple_error;
9944         CYTHON_FALLTHROUGH;
9945         case  1:
9946         if (kw_args > 0) {
9947           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
9948           if (value) { values[1] = value; kw_args--; }
9949         }
9950         CYTHON_FALLTHROUGH;
9951         case  2:
9952         if (kw_args > 0) {
9953           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
9954           if (value) { values[2] = value; kw_args--; }
9955         }
9956       }
9957       if (unlikely(kw_args > 0)) {
9958         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fcoords") < 0)) __PYX_ERR(0, 458, __pyx_L3_error)
9959       }
9960     } else {
9961       switch (PyTuple_GET_SIZE(__pyx_args)) {
9962         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9963         CYTHON_FALLTHROUGH;
9964         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9965         CYTHON_FALLTHROUGH;
9966         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9967         break;
9968         default: goto __pyx_L5_argtuple_error;
9969       }
9970     }
9971     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
9972     if (values[1]) {
9973       __pyx_v_num_cells = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_num_cells == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error)
9974     } else {
9975       __pyx_v_num_cells = ((__pyx_t_5numpy_int64_t)-1LL);
9976     }
9977     if (values[2]) {
9978       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 459, __pyx_L3_error)
9979     } else {
9980       __pyx_v_domain_id = ((int)-1);
9981     }
9982   }
9983   goto __pyx_L4_argument_unpacking_done;
9984   __pyx_L5_argtuple_error:;
9985   __Pyx_RaiseArgtupleInvalid("fcoords", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error)
9986   __pyx_L3_error:;
9987   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
9988   __Pyx_RefNannyFinishContext();
9989   return NULL;
9990   __pyx_L4_argument_unpacking_done:;
9991   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 458, __pyx_L1_error)
9992   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_cells, __pyx_v_domain_id);
9993 
9994   /* function exit code */
9995   goto __pyx_L0;
9996   __pyx_L1_error:;
9997   __pyx_r = NULL;
9998   __pyx_L0:;
9999   __Pyx_RefNannyFinishContext();
10000   return __pyx_r;
10001 }
10002 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_int64_t __pyx_v_num_cells,int __pyx_v_domain_id)10003 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_20fcoords(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_int64_t __pyx_v_num_cells, int __pyx_v_domain_id) {
10004   struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_v_visitor = 0;
10005   PyArrayObject *__pyx_v_coords = 0;
10006   int __pyx_v_i;
10007   __pyx_t_5numpy_float64_t __pyx_v_base_dx;
10008   __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
10009   __Pyx_Buffer __pyx_pybuffer_coords;
10010   PyObject *__pyx_r = NULL;
10011   __Pyx_RefNannyDeclarations
10012   int __pyx_t_1;
10013   PyObject *__pyx_t_2 = NULL;
10014   PyObject *__pyx_t_3 = NULL;
10015   PyObject *__pyx_t_4 = NULL;
10016   PyObject *__pyx_t_5 = NULL;
10017   int __pyx_t_6;
10018   PyObject *__pyx_t_7 = NULL;
10019   __pyx_t_5numpy_int64_t __pyx_t_8;
10020   PyArrayObject *__pyx_t_9 = NULL;
10021   PyObject *__pyx_t_10 = NULL;
10022   PyObject *__pyx_t_11 = NULL;
10023   PyObject *__pyx_t_12 = NULL;
10024   __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
10025   __Pyx_RefNannySetupContext("fcoords", 0);
10026   __pyx_pybuffer_coords.pybuffer.buf = NULL;
10027   __pyx_pybuffer_coords.refcount = 0;
10028   __pyx_pybuffernd_coords.data = NULL;
10029   __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
10030 
10031   /* "yt/geometry/oct_container.pyx":460
10032  *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,
10033  *                 int domain_id = -1):
10034  *         if num_cells == -1:             # <<<<<<<<<<<<<<
10035  *             num_cells = selector.count_oct_cells(self, domain_id)
10036  *         cdef oct_visitors.FCoordsOcts visitor
10037  */
10038   __pyx_t_1 = ((__pyx_v_num_cells == -1LL) != 0);
10039   if (__pyx_t_1) {
10040 
10041     /* "yt/geometry/oct_container.pyx":461
10042  *                 int domain_id = -1):
10043  *         if num_cells == -1:
10044  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
10045  *         cdef oct_visitors.FCoordsOcts visitor
10046  *         visitor = oct_visitors.FCoordsOcts(self, domain_id)
10047  */
10048     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
10049     __Pyx_GOTREF(__pyx_t_3);
10050     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __pyx_L1_error)
10051     __Pyx_GOTREF(__pyx_t_4);
10052     __pyx_t_5 = NULL;
10053     __pyx_t_6 = 0;
10054     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10055       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10056       if (likely(__pyx_t_5)) {
10057         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10058         __Pyx_INCREF(__pyx_t_5);
10059         __Pyx_INCREF(function);
10060         __Pyx_DECREF_SET(__pyx_t_3, function);
10061         __pyx_t_6 = 1;
10062       }
10063     }
10064     #if CYTHON_FAST_PYCALL
10065     if (PyFunction_Check(__pyx_t_3)) {
10066       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
10067       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
10068       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10069       __Pyx_GOTREF(__pyx_t_2);
10070       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10071     } else
10072     #endif
10073     #if CYTHON_FAST_PYCCALL
10074     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
10075       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
10076       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
10077       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10078       __Pyx_GOTREF(__pyx_t_2);
10079       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10080     } else
10081     #endif
10082     {
10083       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __pyx_L1_error)
10084       __Pyx_GOTREF(__pyx_t_7);
10085       if (__pyx_t_5) {
10086         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
10087       }
10088       __Pyx_INCREF(((PyObject *)__pyx_v_self));
10089       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10090       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
10091       __Pyx_GIVEREF(__pyx_t_4);
10092       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
10093       __pyx_t_4 = 0;
10094       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
10095       __Pyx_GOTREF(__pyx_t_2);
10096       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10097     }
10098     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10099     __pyx_t_8 = __Pyx_PyInt_As_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_8 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L1_error)
10100     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10101     __pyx_v_num_cells = __pyx_t_8;
10102 
10103     /* "yt/geometry/oct_container.pyx":460
10104  *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,
10105  *                 int domain_id = -1):
10106  *         if num_cells == -1:             # <<<<<<<<<<<<<<
10107  *             num_cells = selector.count_oct_cells(self, domain_id)
10108  *         cdef oct_visitors.FCoordsOcts visitor
10109  */
10110   }
10111 
10112   /* "yt/geometry/oct_container.pyx":463
10113  *             num_cells = selector.count_oct_cells(self, domain_id)
10114  *         cdef oct_visitors.FCoordsOcts visitor
10115  *         visitor = oct_visitors.FCoordsOcts(self, domain_id)             # <<<<<<<<<<<<<<
10116  *         #Return the floating point unitary position of every cell
10117  *         cdef np.ndarray[np.float64_t, ndim=2] coords
10118  */
10119   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
10120   __Pyx_GOTREF(__pyx_t_2);
10121   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
10122   __Pyx_GOTREF(__pyx_t_3);
10123   __Pyx_INCREF(((PyObject *)__pyx_v_self));
10124   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10125   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
10126   __Pyx_GIVEREF(__pyx_t_2);
10127   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
10128   __pyx_t_2 = 0;
10129   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
10130   __Pyx_GOTREF(__pyx_t_2);
10131   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10132   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts *)__pyx_t_2);
10133   __pyx_t_2 = 0;
10134 
10135   /* "yt/geometry/oct_container.pyx":466
10136  *         #Return the floating point unitary position of every cell
10137  *         cdef np.ndarray[np.float64_t, ndim=2] coords
10138  *         coords = np.empty((num_cells, 3), dtype="float64")             # <<<<<<<<<<<<<<
10139  *         visitor.fcoords = coords
10140  *         self.visit_all_octs(selector, visitor)
10141  */
10142   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
10143   __Pyx_GOTREF(__pyx_t_2);
10144   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
10145   __Pyx_GOTREF(__pyx_t_3);
10146   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10147   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
10148   __Pyx_GOTREF(__pyx_t_2);
10149   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
10150   __Pyx_GOTREF(__pyx_t_7);
10151   __Pyx_GIVEREF(__pyx_t_2);
10152   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
10153   __Pyx_INCREF(__pyx_int_3);
10154   __Pyx_GIVEREF(__pyx_int_3);
10155   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3);
10156   __pyx_t_2 = 0;
10157   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
10158   __Pyx_GOTREF(__pyx_t_2);
10159   __Pyx_GIVEREF(__pyx_t_7);
10160   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
10161   __pyx_t_7 = 0;
10162   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
10163   __Pyx_GOTREF(__pyx_t_7);
10164   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 466, __pyx_L1_error)
10165   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
10166   __Pyx_GOTREF(__pyx_t_4);
10167   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10168   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10169   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10170   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 466, __pyx_L1_error)
10171   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
10172   {
10173     __Pyx_BufFmt_StackElem __pyx_stack[1];
10174     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
10175     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
10176     if (unlikely(__pyx_t_6 < 0)) {
10177       PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10178       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
10179         Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
10180         __Pyx_RaiseBufferFallbackError();
10181       } else {
10182         PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10183       }
10184       __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
10185     }
10186     __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1];
10187     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
10188   }
10189   __pyx_t_9 = 0;
10190   __pyx_v_coords = ((PyArrayObject *)__pyx_t_4);
10191   __pyx_t_4 = 0;
10192 
10193   /* "yt/geometry/oct_container.pyx":467
10194  *         cdef np.ndarray[np.float64_t, ndim=2] coords
10195  *         coords = np.empty((num_cells, 3), dtype="float64")
10196  *         visitor.fcoords = coords             # <<<<<<<<<<<<<<
10197  *         self.visit_all_octs(selector, visitor)
10198  *         cdef int i
10199  */
10200   __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_coords), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 467, __pyx_L1_error)
10201   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->fcoords, 0);
10202   __pyx_v_visitor->fcoords = __pyx_t_13;
10203   __pyx_t_13.memview = NULL;
10204   __pyx_t_13.data = NULL;
10205 
10206   /* "yt/geometry/oct_container.pyx":468
10207  *         coords = np.empty((num_cells, 3), dtype="float64")
10208  *         visitor.fcoords = coords
10209  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
10210  *         cdef int i
10211  *         cdef np.float64_t base_dx
10212  */
10213   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
10214 
10215   /* "yt/geometry/oct_container.pyx":471
10216  *         cdef int i
10217  *         cdef np.float64_t base_dx
10218  *         for i in range(3):             # <<<<<<<<<<<<<<
10219  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
10220  *             coords[:,i] *= base_dx
10221  */
10222   for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
10223     __pyx_v_i = __pyx_t_6;
10224 
10225     /* "yt/geometry/oct_container.pyx":472
10226  *         cdef np.float64_t base_dx
10227  *         for i in range(3):
10228  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]             # <<<<<<<<<<<<<<
10229  *             coords[:,i] *= base_dx
10230  *             coords[:,i] += self.DLE[i]
10231  */
10232     __pyx_v_base_dx = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i]));
10233 
10234     /* "yt/geometry/oct_container.pyx":473
10235  *         for i in range(3):
10236  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
10237  *             coords[:,i] *= base_dx             # <<<<<<<<<<<<<<
10238  *             coords[:,i] += self.DLE[i]
10239  *         return coords
10240  */
10241     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
10242     __Pyx_GOTREF(__pyx_t_4);
10243     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
10244     __Pyx_GOTREF(__pyx_t_7);
10245     __Pyx_INCREF(__pyx_slice__2);
10246     __Pyx_GIVEREF(__pyx_slice__2);
10247     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__2);
10248     __Pyx_GIVEREF(__pyx_t_4);
10249     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
10250     __pyx_t_4 = 0;
10251     __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 473, __pyx_L1_error)
10252     __Pyx_GOTREF(__pyx_t_4);
10253     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_base_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
10254     __Pyx_GOTREF(__pyx_t_2);
10255     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
10256     __Pyx_GOTREF(__pyx_t_3);
10257     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10258     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10259     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_7, __pyx_t_3) < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
10260     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10261     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10262 
10263     /* "yt/geometry/oct_container.pyx":474
10264  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
10265  *             coords[:,i] *= base_dx
10266  *             coords[:,i] += self.DLE[i]             # <<<<<<<<<<<<<<
10267  *         return coords
10268  *
10269  */
10270     __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
10271     __Pyx_GOTREF(__pyx_t_7);
10272     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
10273     __Pyx_GOTREF(__pyx_t_3);
10274     __Pyx_INCREF(__pyx_slice__2);
10275     __Pyx_GIVEREF(__pyx_slice__2);
10276     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__2);
10277     __Pyx_GIVEREF(__pyx_t_7);
10278     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
10279     __pyx_t_7 = 0;
10280     __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
10281     __Pyx_GOTREF(__pyx_t_7);
10282     __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DLE[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
10283     __Pyx_GOTREF(__pyx_t_2);
10284     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
10285     __Pyx_GOTREF(__pyx_t_4);
10286     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10287     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10288     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_coords), __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 474, __pyx_L1_error)
10289     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10290     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10291   }
10292 
10293   /* "yt/geometry/oct_container.pyx":475
10294  *             coords[:,i] *= base_dx
10295  *             coords[:,i] += self.DLE[i]
10296  *         return coords             # <<<<<<<<<<<<<<
10297  *
10298  *     def save_octree(self):
10299  */
10300   __Pyx_XDECREF(__pyx_r);
10301   __Pyx_INCREF(((PyObject *)__pyx_v_coords));
10302   __pyx_r = ((PyObject *)__pyx_v_coords);
10303   goto __pyx_L0;
10304 
10305   /* "yt/geometry/oct_container.pyx":458
10306  *     @cython.wraparound(False)
10307  *     @cython.cdivision(True)
10308  *     def fcoords(self, SelectorObject selector, np.int64_t num_cells = -1,             # <<<<<<<<<<<<<<
10309  *                 int domain_id = -1):
10310  *         if num_cells == -1:
10311  */
10312 
10313   /* function exit code */
10314   __pyx_L1_error:;
10315   __Pyx_XDECREF(__pyx_t_2);
10316   __Pyx_XDECREF(__pyx_t_3);
10317   __Pyx_XDECREF(__pyx_t_4);
10318   __Pyx_XDECREF(__pyx_t_5);
10319   __Pyx_XDECREF(__pyx_t_7);
10320   __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
10321   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10322     __Pyx_PyThreadState_declare
10323     __Pyx_PyThreadState_assign
10324     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10325     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
10326   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10327   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
10328   __pyx_r = NULL;
10329   goto __pyx_L2;
10330   __pyx_L0:;
10331   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
10332   __pyx_L2:;
10333   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
10334   __Pyx_XDECREF((PyObject *)__pyx_v_coords);
10335   __Pyx_XGIVEREF(__pyx_r);
10336   __Pyx_RefNannyFinishContext();
10337   return __pyx_r;
10338 }
10339 
10340 /* "yt/geometry/oct_container.pyx":477
10341  *         return coords
10342  *
10343  *     def save_octree(self):             # <<<<<<<<<<<<<<
10344  *         # Get the header
10345  *         header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
10346  */
10347 
10348 /* Python wrapper */
10349 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)10350 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10351   PyObject *__pyx_r = 0;
10352   __Pyx_RefNannyDeclarations
10353   __Pyx_RefNannySetupContext("save_octree (wrapper)", 0);
10354   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
10355 
10356   /* function exit code */
10357   __Pyx_RefNannyFinishContext();
10358   return __pyx_r;
10359 }
10360 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)10361 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_22save_octree(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
10362   PyObject *__pyx_v_header = NULL;
10363   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
10364   struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_v_visitor = 0;
10365   PyArrayObject *__pyx_v_ref_mask = 0;
10366   __Pyx_LocalBuf_ND __pyx_pybuffernd_ref_mask;
10367   __Pyx_Buffer __pyx_pybuffer_ref_mask;
10368   PyObject *__pyx_r = NULL;
10369   __Pyx_RefNannyDeclarations
10370   PyObject *__pyx_t_1 = NULL;
10371   PyObject *__pyx_t_2 = NULL;
10372   PyObject *__pyx_t_3 = NULL;
10373   PyObject *__pyx_t_4 = NULL;
10374   PyObject *__pyx_t_5 = NULL;
10375   PyArrayObject *__pyx_t_6 = NULL;
10376   int __pyx_t_7;
10377   PyObject *__pyx_t_8 = NULL;
10378   PyObject *__pyx_t_9 = NULL;
10379   PyObject *__pyx_t_10 = NULL;
10380   __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
10381   struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs __pyx_t_12;
10382   __Pyx_RefNannySetupContext("save_octree", 0);
10383   __pyx_pybuffer_ref_mask.pybuffer.buf = NULL;
10384   __pyx_pybuffer_ref_mask.refcount = 0;
10385   __pyx_pybuffernd_ref_mask.data = NULL;
10386   __pyx_pybuffernd_ref_mask.rcbuffer = &__pyx_pybuffer_ref_mask;
10387 
10388   /* "yt/geometry/oct_container.pyx":479
10389  *     def save_octree(self):
10390  *         # Get the header
10391  *         header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),             # <<<<<<<<<<<<<<
10392  *                       left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),
10393  *                       right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]),
10394  */
10395   __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
10396   __Pyx_GOTREF(__pyx_t_1);
10397   __pyx_t_2 = __Pyx_PyInt_From_int((__pyx_v_self->nn[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
10398   __Pyx_GOTREF(__pyx_t_2);
10399   __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_self->nn[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error)
10400   __Pyx_GOTREF(__pyx_t_3);
10401   __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_self->nn[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L1_error)
10402   __Pyx_GOTREF(__pyx_t_4);
10403   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error)
10404   __Pyx_GOTREF(__pyx_t_5);
10405   __Pyx_GIVEREF(__pyx_t_2);
10406   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
10407   __Pyx_GIVEREF(__pyx_t_3);
10408   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
10409   __Pyx_GIVEREF(__pyx_t_4);
10410   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
10411   __pyx_t_2 = 0;
10412   __pyx_t_3 = 0;
10413   __pyx_t_4 = 0;
10414   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dims, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
10415   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10416 
10417   /* "yt/geometry/oct_container.pyx":480
10418  *         # Get the header
10419  *         header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
10420  *                       left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),             # <<<<<<<<<<<<<<
10421  *                       right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]),
10422  *                       over_refine = self.oref,
10423  */
10424   __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->DLE[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error)
10425   __Pyx_GOTREF(__pyx_t_5);
10426   __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DLE[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 480, __pyx_L1_error)
10427   __Pyx_GOTREF(__pyx_t_4);
10428   __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DLE[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error)
10429   __Pyx_GOTREF(__pyx_t_3);
10430   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
10431   __Pyx_GOTREF(__pyx_t_2);
10432   __Pyx_GIVEREF(__pyx_t_5);
10433   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
10434   __Pyx_GIVEREF(__pyx_t_4);
10435   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10436   __Pyx_GIVEREF(__pyx_t_3);
10437   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
10438   __pyx_t_5 = 0;
10439   __pyx_t_4 = 0;
10440   __pyx_t_3 = 0;
10441   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_left_edge, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
10442   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10443 
10444   /* "yt/geometry/oct_container.pyx":481
10445  *         header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
10446  *                       left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),
10447  *                       right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]),             # <<<<<<<<<<<<<<
10448  *                       over_refine = self.oref,
10449  *                       partial_coverage = self.partial_coverage)
10450  */
10451   __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->DRE[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
10452   __Pyx_GOTREF(__pyx_t_2);
10453   __pyx_t_3 = PyFloat_FromDouble((__pyx_v_self->DRE[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error)
10454   __Pyx_GOTREF(__pyx_t_3);
10455   __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->DRE[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
10456   __Pyx_GOTREF(__pyx_t_4);
10457   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error)
10458   __Pyx_GOTREF(__pyx_t_5);
10459   __Pyx_GIVEREF(__pyx_t_2);
10460   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
10461   __Pyx_GIVEREF(__pyx_t_3);
10462   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
10463   __Pyx_GIVEREF(__pyx_t_4);
10464   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
10465   __pyx_t_2 = 0;
10466   __pyx_t_3 = 0;
10467   __pyx_t_4 = 0;
10468   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_right_edge, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
10469   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10470 
10471   /* "yt/geometry/oct_container.pyx":482
10472  *                       left_edge = (self.DLE[0], self.DLE[1], self.DLE[2]),
10473  *                       right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]),
10474  *                       over_refine = self.oref,             # <<<<<<<<<<<<<<
10475  *                       partial_coverage = self.partial_coverage)
10476  *         cdef SelectorObject selector = AlwaysSelector(None)
10477  */
10478   __pyx_t_5 = __Pyx_PyInt_From_npy_uint8(__pyx_v_self->oref); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 482, __pyx_L1_error)
10479   __Pyx_GOTREF(__pyx_t_5);
10480   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_over_refine, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
10481   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10482 
10483   /* "yt/geometry/oct_container.pyx":483
10484  *                       right_edge = (self.DRE[0], self.DRE[1], self.DRE[2]),
10485  *                       over_refine = self.oref,
10486  *                       partial_coverage = self.partial_coverage)             # <<<<<<<<<<<<<<
10487  *         cdef SelectorObject selector = AlwaysSelector(None)
10488  *         # domain_id = -1 here, because we want *every* oct
10489  */
10490   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->partial_coverage); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
10491   __Pyx_GOTREF(__pyx_t_5);
10492   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_partial_coverage, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
10493   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10494   __pyx_v_header = ((PyObject*)__pyx_t_1);
10495   __pyx_t_1 = 0;
10496 
10497   /* "yt/geometry/oct_container.pyx":484
10498  *                       over_refine = self.oref,
10499  *                       partial_coverage = self.partial_coverage)
10500  *         cdef SelectorObject selector = AlwaysSelector(None)             # <<<<<<<<<<<<<<
10501  *         # domain_id = -1 here, because we want *every* oct
10502  *         cdef oct_visitors.StoreOctree visitor
10503  */
10504   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
10505   __Pyx_GOTREF(__pyx_t_1);
10506   __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1);
10507   __pyx_t_1 = 0;
10508 
10509   /* "yt/geometry/oct_container.pyx":487
10510  *         # domain_id = -1 here, because we want *every* oct
10511  *         cdef oct_visitors.StoreOctree visitor
10512  *         visitor = oct_visitors.StoreOctree(self, -1)             # <<<<<<<<<<<<<<
10513  *         visitor.oref = 0
10514  *         visitor.nz = 1
10515  */
10516   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
10517   __Pyx_GOTREF(__pyx_t_1);
10518   __Pyx_INCREF(((PyObject *)__pyx_v_self));
10519   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10520   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
10521   __Pyx_INCREF(__pyx_int_neg_1);
10522   __Pyx_GIVEREF(__pyx_int_neg_1);
10523   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1);
10524   __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error)
10525   __Pyx_GOTREF(__pyx_t_5);
10526   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10527   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree *)__pyx_t_5);
10528   __pyx_t_5 = 0;
10529 
10530   /* "yt/geometry/oct_container.pyx":488
10531  *         cdef oct_visitors.StoreOctree visitor
10532  *         visitor = oct_visitors.StoreOctree(self, -1)
10533  *         visitor.oref = 0             # <<<<<<<<<<<<<<
10534  *         visitor.nz = 1
10535  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
10536  */
10537   __pyx_v_visitor->__pyx_base.oref = 0;
10538 
10539   /* "yt/geometry/oct_container.pyx":489
10540  *         visitor = oct_visitors.StoreOctree(self, -1)
10541  *         visitor.oref = 0
10542  *         visitor.nz = 1             # <<<<<<<<<<<<<<
10543  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
10544  *         ref_mask = np.zeros(self.nocts * visitor.nz, dtype="uint8") - 1
10545  */
10546   __pyx_v_visitor->__pyx_base.nz = 1;
10547 
10548   /* "yt/geometry/oct_container.pyx":491
10549  *         visitor.nz = 1
10550  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
10551  *         ref_mask = np.zeros(self.nocts * visitor.nz, dtype="uint8") - 1             # <<<<<<<<<<<<<<
10552  *         visitor.ref_mask = ref_mask
10553  *         # Enforce partial_coverage here
10554  */
10555   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
10556   __Pyx_GOTREF(__pyx_t_5);
10557   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10558   __Pyx_GOTREF(__pyx_t_1);
10559   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10560   __pyx_t_5 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->nocts * __pyx_v_visitor->__pyx_base.nz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
10561   __Pyx_GOTREF(__pyx_t_5);
10562   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
10563   __Pyx_GOTREF(__pyx_t_4);
10564   __Pyx_GIVEREF(__pyx_t_5);
10565   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10566   __pyx_t_5 = 0;
10567   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
10568   __Pyx_GOTREF(__pyx_t_5);
10569   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
10570   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
10571   __Pyx_GOTREF(__pyx_t_3);
10572   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10573   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10574   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10575   __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
10576   __Pyx_GOTREF(__pyx_t_5);
10577   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10578   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 491, __pyx_L1_error)
10579   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
10580   {
10581     __Pyx_BufFmt_StackElem __pyx_stack[1];
10582     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
10583     __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
10584     if (unlikely(__pyx_t_7 < 0)) {
10585       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
10586       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_ref_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
10587         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
10588         __Pyx_RaiseBufferFallbackError();
10589       } else {
10590         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
10591       }
10592       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
10593     }
10594     __pyx_pybuffernd_ref_mask.diminfo[0].strides = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ref_mask.diminfo[0].shape = __pyx_pybuffernd_ref_mask.rcbuffer->pybuffer.shape[0];
10595     if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
10596   }
10597   __pyx_t_6 = 0;
10598   __pyx_v_ref_mask = ((PyArrayObject *)__pyx_t_5);
10599   __pyx_t_5 = 0;
10600 
10601   /* "yt/geometry/oct_container.pyx":492
10602  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
10603  *         ref_mask = np.zeros(self.nocts * visitor.nz, dtype="uint8") - 1
10604  *         visitor.ref_mask = ref_mask             # <<<<<<<<<<<<<<
10605  *         # Enforce partial_coverage here
10606  *         self.visit_all_octs(selector, visitor, 1)
10607  */
10608   __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_ref_mask), PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 492, __pyx_L1_error)
10609   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->ref_mask, 0);
10610   __pyx_v_visitor->ref_mask = __pyx_t_11;
10611   __pyx_t_11.memview = NULL;
10612   __pyx_t_11.data = NULL;
10613 
10614   /* "yt/geometry/oct_container.pyx":494
10615  *         visitor.ref_mask = ref_mask
10616  *         # Enforce partial_coverage here
10617  *         self.visit_all_octs(selector, visitor, 1)             # <<<<<<<<<<<<<<
10618  *         header['octree'] = ref_mask
10619  *         return header
10620  */
10621   __pyx_t_12.__pyx_n = 1;
10622   __pyx_t_12.vc = 1;
10623   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), &__pyx_t_12);
10624 
10625   /* "yt/geometry/oct_container.pyx":495
10626  *         # Enforce partial_coverage here
10627  *         self.visit_all_octs(selector, visitor, 1)
10628  *         header['octree'] = ref_mask             # <<<<<<<<<<<<<<
10629  *         return header
10630  *
10631  */
10632   if (unlikely(PyDict_SetItem(__pyx_v_header, __pyx_n_s_octree, ((PyObject *)__pyx_v_ref_mask)) < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
10633 
10634   /* "yt/geometry/oct_container.pyx":496
10635  *         self.visit_all_octs(selector, visitor, 1)
10636  *         header['octree'] = ref_mask
10637  *         return header             # <<<<<<<<<<<<<<
10638  *
10639  *     def selector_fill(self, SelectorObject selector,
10640  */
10641   __Pyx_XDECREF(__pyx_r);
10642   __Pyx_INCREF(__pyx_v_header);
10643   __pyx_r = __pyx_v_header;
10644   goto __pyx_L0;
10645 
10646   /* "yt/geometry/oct_container.pyx":477
10647  *         return coords
10648  *
10649  *     def save_octree(self):             # <<<<<<<<<<<<<<
10650  *         # Get the header
10651  *         header = dict(dims = (self.nn[0], self.nn[1], self.nn[2]),
10652  */
10653 
10654   /* function exit code */
10655   __pyx_L1_error:;
10656   __Pyx_XDECREF(__pyx_t_1);
10657   __Pyx_XDECREF(__pyx_t_2);
10658   __Pyx_XDECREF(__pyx_t_3);
10659   __Pyx_XDECREF(__pyx_t_4);
10660   __Pyx_XDECREF(__pyx_t_5);
10661   __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
10662   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10663     __Pyx_PyThreadState_declare
10664     __Pyx_PyThreadState_assign
10665     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10666     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
10667   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10668   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.save_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
10669   __pyx_r = NULL;
10670   goto __pyx_L2;
10671   __pyx_L0:;
10672   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ref_mask.rcbuffer->pybuffer);
10673   __pyx_L2:;
10674   __Pyx_XDECREF(__pyx_v_header);
10675   __Pyx_XDECREF((PyObject *)__pyx_v_selector);
10676   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
10677   __Pyx_XDECREF((PyObject *)__pyx_v_ref_mask);
10678   __Pyx_XGIVEREF(__pyx_r);
10679   __Pyx_RefNannyFinishContext();
10680   return __pyx_r;
10681 }
10682 
10683 /* "yt/geometry/oct_container.pyx":498
10684  *         return header
10685  *
10686  *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
10687  *                       np.ndarray source,
10688  *                       np.ndarray dest = None,
10689  */
10690 
10691 /* Python wrapper */
10692 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10693 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10694   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
10695   PyArrayObject *__pyx_v_source = 0;
10696   PyArrayObject *__pyx_v_dest = 0;
10697   __pyx_t_5numpy_int64_t __pyx_v_offset;
10698   int __pyx_v_dims;
10699   int __pyx_v_domain_id;
10700   PyObject *__pyx_r = 0;
10701   __Pyx_RefNannyDeclarations
10702   __Pyx_RefNannySetupContext("selector_fill (wrapper)", 0);
10703   {
10704     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_offset,&__pyx_n_s_dims,&__pyx_n_s_domain_id,0};
10705     PyObject* values[6] = {0,0,0,0,0,0};
10706 
10707     /* "yt/geometry/oct_container.pyx":500
10708  *     def selector_fill(self, SelectorObject selector,
10709  *                       np.ndarray source,
10710  *                       np.ndarray dest = None,             # <<<<<<<<<<<<<<
10711  *                       np.int64_t offset = 0, int dims = 1,
10712  *                       int domain_id = -1):
10713  */
10714     values[2] = (PyObject *)((PyArrayObject *)Py_None);
10715     if (unlikely(__pyx_kwds)) {
10716       Py_ssize_t kw_args;
10717       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10718       switch (pos_args) {
10719         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10720         CYTHON_FALLTHROUGH;
10721         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10722         CYTHON_FALLTHROUGH;
10723         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10724         CYTHON_FALLTHROUGH;
10725         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10726         CYTHON_FALLTHROUGH;
10727         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10728         CYTHON_FALLTHROUGH;
10729         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10730         CYTHON_FALLTHROUGH;
10731         case  0: break;
10732         default: goto __pyx_L5_argtuple_error;
10733       }
10734       kw_args = PyDict_Size(__pyx_kwds);
10735       switch (pos_args) {
10736         case  0:
10737         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
10738         else goto __pyx_L5_argtuple_error;
10739         CYTHON_FALLTHROUGH;
10740         case  1:
10741         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
10742         else {
10743           __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, 1); __PYX_ERR(0, 498, __pyx_L3_error)
10744         }
10745         CYTHON_FALLTHROUGH;
10746         case  2:
10747         if (kw_args > 0) {
10748           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest);
10749           if (value) { values[2] = value; kw_args--; }
10750         }
10751         CYTHON_FALLTHROUGH;
10752         case  3:
10753         if (kw_args > 0) {
10754           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
10755           if (value) { values[3] = value; kw_args--; }
10756         }
10757         CYTHON_FALLTHROUGH;
10758         case  4:
10759         if (kw_args > 0) {
10760           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims);
10761           if (value) { values[4] = value; kw_args--; }
10762         }
10763         CYTHON_FALLTHROUGH;
10764         case  5:
10765         if (kw_args > 0) {
10766           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
10767           if (value) { values[5] = value; kw_args--; }
10768         }
10769       }
10770       if (unlikely(kw_args > 0)) {
10771         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "selector_fill") < 0)) __PYX_ERR(0, 498, __pyx_L3_error)
10772       }
10773     } else {
10774       switch (PyTuple_GET_SIZE(__pyx_args)) {
10775         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10776         CYTHON_FALLTHROUGH;
10777         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10778         CYTHON_FALLTHROUGH;
10779         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10780         CYTHON_FALLTHROUGH;
10781         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10782         CYTHON_FALLTHROUGH;
10783         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10784         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10785         break;
10786         default: goto __pyx_L5_argtuple_error;
10787       }
10788     }
10789     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
10790     __pyx_v_source = ((PyArrayObject *)values[1]);
10791     __pyx_v_dest = ((PyArrayObject *)values[2]);
10792     if (values[3]) {
10793       __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error)
10794     } else {
10795       __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0);
10796     }
10797     if (values[4]) {
10798       __pyx_v_dims = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error)
10799     } else {
10800       __pyx_v_dims = ((int)1);
10801     }
10802     if (values[5]) {
10803       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 502, __pyx_L3_error)
10804     } else {
10805       __pyx_v_domain_id = ((int)-1);
10806     }
10807   }
10808   goto __pyx_L4_argument_unpacking_done;
10809   __pyx_L5_argtuple_error:;
10810   __Pyx_RaiseArgtupleInvalid("selector_fill", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 498, __pyx_L3_error)
10811   __pyx_L3_error:;
10812   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.selector_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
10813   __Pyx_RefNannyFinishContext();
10814   return NULL;
10815   __pyx_L4_argument_unpacking_done:;
10816   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
10817   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_5numpy_ndarray, 1, "source", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
10818   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_5numpy_ndarray, 1, "dest", 0))) __PYX_ERR(0, 500, __pyx_L1_error)
10819   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_source, __pyx_v_dest, __pyx_v_offset, __pyx_v_dims, __pyx_v_domain_id);
10820 
10821   /* "yt/geometry/oct_container.pyx":498
10822  *         return header
10823  *
10824  *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
10825  *                       np.ndarray source,
10826  *                       np.ndarray dest = None,
10827  */
10828 
10829   /* function exit code */
10830   goto __pyx_L0;
10831   __pyx_L1_error:;
10832   __pyx_r = NULL;
10833   __pyx_L0:;
10834   __Pyx_RefNannyFinishContext();
10835   return __pyx_r;
10836 }
10837 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,PyArrayObject * __pyx_v_source,PyArrayObject * __pyx_v_dest,__pyx_t_5numpy_int64_t __pyx_v_offset,int __pyx_v_dims,int __pyx_v_domain_id)10838 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_24selector_fill(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, PyArrayObject *__pyx_v_source, PyArrayObject *__pyx_v_dest, __pyx_t_5numpy_int64_t __pyx_v_offset, int __pyx_v_dims, int __pyx_v_domain_id) {
10839   __pyx_t_5numpy_int64_t __pyx_v_num_cells;
10840   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor = 0;
10841   struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_v_visitor_i64 = 0;
10842   struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_v_visitor_f64 = 0;
10843   PyObject *__pyx_r = NULL;
10844   __Pyx_RefNannyDeclarations
10845   int __pyx_t_1;
10846   int __pyx_t_2;
10847   PyObject *__pyx_t_3 = NULL;
10848   PyObject *__pyx_t_4 = NULL;
10849   PyObject *__pyx_t_5 = NULL;
10850   PyObject *__pyx_t_6 = NULL;
10851   int __pyx_t_7;
10852   PyObject *__pyx_t_8 = NULL;
10853   __pyx_t_5numpy_int64_t __pyx_t_9;
10854   PyObject *__pyx_t_10 = NULL;
10855   PyObject *__pyx_t_11 = NULL;
10856   PyObject *__pyx_t_12 = NULL;
10857   __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
10858   __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
10859   __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
10860   __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
10861   __Pyx_RefNannySetupContext("selector_fill", 0);
10862   __Pyx_INCREF((PyObject *)__pyx_v_source);
10863   __Pyx_INCREF((PyObject *)__pyx_v_dest);
10864 
10865   /* "yt/geometry/oct_container.pyx":506
10866  *         # iterate the same way visit_all_octs does, but we need to track the
10867  *         # number of octs total visited.
10868  *         cdef np.int64_t num_cells = -1             # <<<<<<<<<<<<<<
10869  *         if dest is None:
10870  *             # Note that RAMSES can have partial refinement inside an Oct.  This
10871  */
10872   __pyx_v_num_cells = -1LL;
10873 
10874   /* "yt/geometry/oct_container.pyx":507
10875  *         # number of octs total visited.
10876  *         cdef np.int64_t num_cells = -1
10877  *         if dest is None:             # <<<<<<<<<<<<<<
10878  *             # Note that RAMSES can have partial refinement inside an Oct.  This
10879  *             # means we actually do want the number of Octs, not the number of
10880  */
10881   __pyx_t_1 = (((PyObject *)__pyx_v_dest) == Py_None);
10882   __pyx_t_2 = (__pyx_t_1 != 0);
10883   if (__pyx_t_2) {
10884 
10885     /* "yt/geometry/oct_container.pyx":511
10886  *             # means we actually do want the number of Octs, not the number of
10887  *             # cells.
10888  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
10889  *             dest = np.zeros((num_cells, dims), dtype=source.dtype,
10890  *                             order='C')
10891  */
10892     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
10893     __Pyx_GOTREF(__pyx_t_4);
10894     __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
10895     __Pyx_GOTREF(__pyx_t_5);
10896     __pyx_t_6 = NULL;
10897     __pyx_t_7 = 0;
10898     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
10899       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
10900       if (likely(__pyx_t_6)) {
10901         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10902         __Pyx_INCREF(__pyx_t_6);
10903         __Pyx_INCREF(function);
10904         __Pyx_DECREF_SET(__pyx_t_4, function);
10905         __pyx_t_7 = 1;
10906       }
10907     }
10908     #if CYTHON_FAST_PYCALL
10909     if (PyFunction_Check(__pyx_t_4)) {
10910       PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_5};
10911       __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
10912       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10913       __Pyx_GOTREF(__pyx_t_3);
10914       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10915     } else
10916     #endif
10917     #if CYTHON_FAST_PYCCALL
10918     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10919       PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_5};
10920       __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
10921       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10922       __Pyx_GOTREF(__pyx_t_3);
10923       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10924     } else
10925     #endif
10926     {
10927       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 511, __pyx_L1_error)
10928       __Pyx_GOTREF(__pyx_t_8);
10929       if (__pyx_t_6) {
10930         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
10931       }
10932       __Pyx_INCREF(((PyObject *)__pyx_v_self));
10933       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10934       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
10935       __Pyx_GIVEREF(__pyx_t_5);
10936       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
10937       __pyx_t_5 = 0;
10938       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
10939       __Pyx_GOTREF(__pyx_t_3);
10940       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10941     }
10942     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10943     __pyx_t_9 = __Pyx_PyInt_As_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_9 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L1_error)
10944     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10945     __pyx_v_num_cells = __pyx_t_9;
10946 
10947     /* "yt/geometry/oct_container.pyx":512
10948  *             # cells.
10949  *             num_cells = selector.count_oct_cells(self, domain_id)
10950  *             dest = np.zeros((num_cells, dims), dtype=source.dtype,             # <<<<<<<<<<<<<<
10951  *                             order='C')
10952  *         if dims != 1:
10953  */
10954     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
10955     __Pyx_GOTREF(__pyx_t_3);
10956     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10957     __Pyx_GOTREF(__pyx_t_4);
10958     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10959     __pyx_t_3 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
10960     __Pyx_GOTREF(__pyx_t_3);
10961     __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
10962     __Pyx_GOTREF(__pyx_t_8);
10963     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
10964     __Pyx_GOTREF(__pyx_t_5);
10965     __Pyx_GIVEREF(__pyx_t_3);
10966     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
10967     __Pyx_GIVEREF(__pyx_t_8);
10968     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
10969     __pyx_t_3 = 0;
10970     __pyx_t_8 = 0;
10971     __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
10972     __Pyx_GOTREF(__pyx_t_8);
10973     __Pyx_GIVEREF(__pyx_t_5);
10974     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
10975     __pyx_t_5 = 0;
10976     __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
10977     __Pyx_GOTREF(__pyx_t_5);
10978     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
10979     __Pyx_GOTREF(__pyx_t_3);
10980     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
10981     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10982     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
10983     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
10984     __Pyx_GOTREF(__pyx_t_3);
10985     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10986     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10987     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10988     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 512, __pyx_L1_error)
10989     __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_3));
10990     __pyx_t_3 = 0;
10991 
10992     /* "yt/geometry/oct_container.pyx":507
10993  *         # number of octs total visited.
10994  *         cdef np.int64_t num_cells = -1
10995  *         if dest is None:             # <<<<<<<<<<<<<<
10996  *             # Note that RAMSES can have partial refinement inside an Oct.  This
10997  *             # means we actually do want the number of Octs, not the number of
10998  */
10999   }
11000 
11001   /* "yt/geometry/oct_container.pyx":514
11002  *             dest = np.zeros((num_cells, dims), dtype=source.dtype,
11003  *                             order='C')
11004  *         if dims != 1:             # <<<<<<<<<<<<<<
11005  *             raise RuntimeError
11006  *         # Just make sure that we're in the right shape.  Ideally this will not
11007  */
11008   __pyx_t_2 = ((__pyx_v_dims != 1) != 0);
11009   if (unlikely(__pyx_t_2)) {
11010 
11011     /* "yt/geometry/oct_container.pyx":515
11012  *                             order='C')
11013  *         if dims != 1:
11014  *             raise RuntimeError             # <<<<<<<<<<<<<<
11015  *         # Just make sure that we're in the right shape.  Ideally this will not
11016  *         # duplicate memory.  Since we're in Cython, we want to avoid modifying
11017  */
11018     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
11019     __PYX_ERR(0, 515, __pyx_L1_error)
11020 
11021     /* "yt/geometry/oct_container.pyx":514
11022  *             dest = np.zeros((num_cells, dims), dtype=source.dtype,
11023  *                             order='C')
11024  *         if dims != 1:             # <<<<<<<<<<<<<<
11025  *             raise RuntimeError
11026  *         # Just make sure that we're in the right shape.  Ideally this will not
11027  */
11028   }
11029 
11030   /* "yt/geometry/oct_container.pyx":519
11031  *         # duplicate memory.  Since we're in Cython, we want to avoid modifying
11032  *         # the .shape attributes directly.
11033  *         dest = dest.reshape((num_cells, 1))             # <<<<<<<<<<<<<<
11034  *         source = source.reshape((source.shape[0], source.shape[1],
11035  *                     source.shape[2], source.shape[3], dims))
11036  */
11037   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error)
11038   __Pyx_GOTREF(__pyx_t_5);
11039   __pyx_t_8 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 519, __pyx_L1_error)
11040   __Pyx_GOTREF(__pyx_t_8);
11041   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error)
11042   __Pyx_GOTREF(__pyx_t_4);
11043   __Pyx_GIVEREF(__pyx_t_8);
11044   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
11045   __Pyx_INCREF(__pyx_int_1);
11046   __Pyx_GIVEREF(__pyx_int_1);
11047   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
11048   __pyx_t_8 = 0;
11049   __pyx_t_8 = NULL;
11050   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11051     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
11052     if (likely(__pyx_t_8)) {
11053       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11054       __Pyx_INCREF(__pyx_t_8);
11055       __Pyx_INCREF(function);
11056       __Pyx_DECREF_SET(__pyx_t_5, function);
11057     }
11058   }
11059   __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
11060   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11061   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11062   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error)
11063   __Pyx_GOTREF(__pyx_t_3);
11064   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11065   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 519, __pyx_L1_error)
11066   __Pyx_DECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_3));
11067   __pyx_t_3 = 0;
11068 
11069   /* "yt/geometry/oct_container.pyx":520
11070  *         # the .shape attributes directly.
11071  *         dest = dest.reshape((num_cells, 1))
11072  *         source = source.reshape((source.shape[0], source.shape[1],             # <<<<<<<<<<<<<<
11073  *                     source.shape[2], source.shape[3], dims))
11074  *         cdef OctVisitor visitor
11075  */
11076   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error)
11077   __Pyx_GOTREF(__pyx_t_5);
11078   __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
11079   __Pyx_GOTREF(__pyx_t_4);
11080   __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[1])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 520, __pyx_L1_error)
11081   __Pyx_GOTREF(__pyx_t_8);
11082 
11083   /* "yt/geometry/oct_container.pyx":521
11084  *         dest = dest.reshape((num_cells, 1))
11085  *         source = source.reshape((source.shape[0], source.shape[1],
11086  *                     source.shape[2], source.shape[3], dims))             # <<<<<<<<<<<<<<
11087  *         cdef OctVisitor visitor
11088  *         cdef oct_visitors.CopyArrayI64 visitor_i64
11089  */
11090   __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error)
11091   __Pyx_GOTREF(__pyx_t_6);
11092   __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_source->dimensions[3])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 521, __pyx_L1_error)
11093   __Pyx_GOTREF(__pyx_t_10);
11094   __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_dims); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L1_error)
11095   __Pyx_GOTREF(__pyx_t_11);
11096 
11097   /* "yt/geometry/oct_container.pyx":520
11098  *         # the .shape attributes directly.
11099  *         dest = dest.reshape((num_cells, 1))
11100  *         source = source.reshape((source.shape[0], source.shape[1],             # <<<<<<<<<<<<<<
11101  *                     source.shape[2], source.shape[3], dims))
11102  *         cdef OctVisitor visitor
11103  */
11104   __pyx_t_12 = PyTuple_New(5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 520, __pyx_L1_error)
11105   __Pyx_GOTREF(__pyx_t_12);
11106   __Pyx_GIVEREF(__pyx_t_4);
11107   PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
11108   __Pyx_GIVEREF(__pyx_t_8);
11109   PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8);
11110   __Pyx_GIVEREF(__pyx_t_6);
11111   PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_6);
11112   __Pyx_GIVEREF(__pyx_t_10);
11113   PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_10);
11114   __Pyx_GIVEREF(__pyx_t_11);
11115   PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_11);
11116   __pyx_t_4 = 0;
11117   __pyx_t_8 = 0;
11118   __pyx_t_6 = 0;
11119   __pyx_t_10 = 0;
11120   __pyx_t_11 = 0;
11121   __pyx_t_11 = NULL;
11122   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11123     __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
11124     if (likely(__pyx_t_11)) {
11125       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11126       __Pyx_INCREF(__pyx_t_11);
11127       __Pyx_INCREF(function);
11128       __Pyx_DECREF_SET(__pyx_t_5, function);
11129     }
11130   }
11131   __pyx_t_3 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12);
11132   __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
11133   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11134   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
11135   __Pyx_GOTREF(__pyx_t_3);
11136   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11137   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 520, __pyx_L1_error)
11138   __Pyx_DECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_3));
11139   __pyx_t_3 = 0;
11140 
11141   /* "yt/geometry/oct_container.pyx":525
11142  *         cdef oct_visitors.CopyArrayI64 visitor_i64
11143  *         cdef oct_visitors.CopyArrayF64 visitor_f64
11144  *         if source.dtype != dest.dtype:             # <<<<<<<<<<<<<<
11145  *             raise RuntimeError
11146  *         if source.dtype == np.int64:
11147  */
11148   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
11149   __Pyx_GOTREF(__pyx_t_3);
11150   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
11151   __Pyx_GOTREF(__pyx_t_5);
11152   __pyx_t_12 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 525, __pyx_L1_error)
11153   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11154   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11155   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 525, __pyx_L1_error)
11156   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11157   if (unlikely(__pyx_t_2)) {
11158 
11159     /* "yt/geometry/oct_container.pyx":526
11160  *         cdef oct_visitors.CopyArrayF64 visitor_f64
11161  *         if source.dtype != dest.dtype:
11162  *             raise RuntimeError             # <<<<<<<<<<<<<<
11163  *         if source.dtype == np.int64:
11164  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)
11165  */
11166     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
11167     __PYX_ERR(0, 526, __pyx_L1_error)
11168 
11169     /* "yt/geometry/oct_container.pyx":525
11170  *         cdef oct_visitors.CopyArrayI64 visitor_i64
11171  *         cdef oct_visitors.CopyArrayF64 visitor_f64
11172  *         if source.dtype != dest.dtype:             # <<<<<<<<<<<<<<
11173  *             raise RuntimeError
11174  *         if source.dtype == np.int64:
11175  */
11176   }
11177 
11178   /* "yt/geometry/oct_container.pyx":527
11179  *         if source.dtype != dest.dtype:
11180  *             raise RuntimeError
11181  *         if source.dtype == np.int64:             # <<<<<<<<<<<<<<
11182  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)
11183  *             visitor_i64.source = source
11184  */
11185   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 527, __pyx_L1_error)
11186   __Pyx_GOTREF(__pyx_t_12);
11187   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
11188   __Pyx_GOTREF(__pyx_t_5);
11189   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
11190   __Pyx_GOTREF(__pyx_t_3);
11191   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11192   __pyx_t_5 = PyObject_RichCompare(__pyx_t_12, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
11193   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11194   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11195   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
11196   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11197   if (__pyx_t_2) {
11198 
11199     /* "yt/geometry/oct_container.pyx":528
11200  *             raise RuntimeError
11201  *         if source.dtype == np.int64:
11202  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)             # <<<<<<<<<<<<<<
11203  *             visitor_i64.source = source
11204  *             visitor_i64.dest = dest
11205  */
11206     __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error)
11207     __Pyx_GOTREF(__pyx_t_5);
11208     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
11209     __Pyx_GOTREF(__pyx_t_3);
11210     __Pyx_INCREF(((PyObject *)__pyx_v_self));
11211     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11212     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
11213     __Pyx_GIVEREF(__pyx_t_5);
11214     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
11215     __pyx_t_5 = 0;
11216     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error)
11217     __Pyx_GOTREF(__pyx_t_5);
11218     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11219     __pyx_v_visitor_i64 = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 *)__pyx_t_5);
11220     __pyx_t_5 = 0;
11221 
11222     /* "yt/geometry/oct_container.pyx":529
11223  *         if source.dtype == np.int64:
11224  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)
11225  *             visitor_i64.source = source             # <<<<<<<<<<<<<<
11226  *             visitor_i64.dest = dest
11227  *             visitor = visitor_i64
11228  */
11229     __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_source), PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 529, __pyx_L1_error)
11230     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_i64->source, 0);
11231     __pyx_v_visitor_i64->source = __pyx_t_13;
11232     __pyx_t_13.memview = NULL;
11233     __pyx_t_13.data = NULL;
11234 
11235     /* "yt/geometry/oct_container.pyx":530
11236  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)
11237  *             visitor_i64.source = source
11238  *             visitor_i64.dest = dest             # <<<<<<<<<<<<<<
11239  *             visitor = visitor_i64
11240  *         elif source.dtype == np.float64:
11241  */
11242     __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_dest), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 530, __pyx_L1_error)
11243     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_i64->dest, 0);
11244     __pyx_v_visitor_i64->dest = __pyx_t_14;
11245     __pyx_t_14.memview = NULL;
11246     __pyx_t_14.data = NULL;
11247 
11248     /* "yt/geometry/oct_container.pyx":531
11249  *             visitor_i64.source = source
11250  *             visitor_i64.dest = dest
11251  *             visitor = visitor_i64             # <<<<<<<<<<<<<<
11252  *         elif source.dtype == np.float64:
11253  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)
11254  */
11255     __Pyx_INCREF(((PyObject *)__pyx_v_visitor_i64));
11256     __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor_i64);
11257 
11258     /* "yt/geometry/oct_container.pyx":527
11259  *         if source.dtype != dest.dtype:
11260  *             raise RuntimeError
11261  *         if source.dtype == np.int64:             # <<<<<<<<<<<<<<
11262  *             visitor_i64 = oct_visitors.CopyArrayI64(self, domain_id)
11263  *             visitor_i64.source = source
11264  */
11265     goto __pyx_L6;
11266   }
11267 
11268   /* "yt/geometry/oct_container.pyx":532
11269  *             visitor_i64.dest = dest
11270  *             visitor = visitor_i64
11271  *         elif source.dtype == np.float64:             # <<<<<<<<<<<<<<
11272  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)
11273  *             visitor_f64.source = source
11274  */
11275   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
11276   __Pyx_GOTREF(__pyx_t_5);
11277   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
11278   __Pyx_GOTREF(__pyx_t_3);
11279   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 532, __pyx_L1_error)
11280   __Pyx_GOTREF(__pyx_t_12);
11281   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11282   __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
11283   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11284   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11285   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 532, __pyx_L1_error)
11286   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11287   if (likely(__pyx_t_2)) {
11288 
11289     /* "yt/geometry/oct_container.pyx":533
11290  *             visitor = visitor_i64
11291  *         elif source.dtype == np.float64:
11292  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)             # <<<<<<<<<<<<<<
11293  *             visitor_f64.source = source
11294  *             visitor_f64.dest = dest
11295  */
11296     __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
11297     __Pyx_GOTREF(__pyx_t_3);
11298     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
11299     __Pyx_GOTREF(__pyx_t_12);
11300     __Pyx_INCREF(((PyObject *)__pyx_v_self));
11301     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11302     PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self));
11303     __Pyx_GIVEREF(__pyx_t_3);
11304     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
11305     __pyx_t_3 = 0;
11306     __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64), __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
11307     __Pyx_GOTREF(__pyx_t_3);
11308     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11309     __pyx_v_visitor_f64 = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 *)__pyx_t_3);
11310     __pyx_t_3 = 0;
11311 
11312     /* "yt/geometry/oct_container.pyx":534
11313  *         elif source.dtype == np.float64:
11314  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)
11315  *             visitor_f64.source = source             # <<<<<<<<<<<<<<
11316  *             visitor_f64.dest = dest
11317  *             visitor = visitor_f64
11318  */
11319     __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_source), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 534, __pyx_L1_error)
11320     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_f64->source, 0);
11321     __pyx_v_visitor_f64->source = __pyx_t_15;
11322     __pyx_t_15.memview = NULL;
11323     __pyx_t_15.data = NULL;
11324 
11325     /* "yt/geometry/oct_container.pyx":535
11326  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)
11327  *             visitor_f64.source = source
11328  *             visitor_f64.dest = dest             # <<<<<<<<<<<<<<
11329  *             visitor = visitor_f64
11330  *         else:
11331  */
11332     __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(((PyObject *)__pyx_v_dest), PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 535, __pyx_L1_error)
11333     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_f64->dest, 0);
11334     __pyx_v_visitor_f64->dest = __pyx_t_16;
11335     __pyx_t_16.memview = NULL;
11336     __pyx_t_16.data = NULL;
11337 
11338     /* "yt/geometry/oct_container.pyx":536
11339  *             visitor_f64.source = source
11340  *             visitor_f64.dest = dest
11341  *             visitor = visitor_f64             # <<<<<<<<<<<<<<
11342  *         else:
11343  *             raise NotImplementedError
11344  */
11345     __Pyx_INCREF(((PyObject *)__pyx_v_visitor_f64));
11346     __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor_f64);
11347 
11348     /* "yt/geometry/oct_container.pyx":532
11349  *             visitor_i64.dest = dest
11350  *             visitor = visitor_i64
11351  *         elif source.dtype == np.float64:             # <<<<<<<<<<<<<<
11352  *             visitor_f64 = oct_visitors.CopyArrayF64(self, domain_id)
11353  *             visitor_f64.source = source
11354  */
11355     goto __pyx_L6;
11356   }
11357 
11358   /* "yt/geometry/oct_container.pyx":538
11359  *             visitor = visitor_f64
11360  *         else:
11361  *             raise NotImplementedError             # <<<<<<<<<<<<<<
11362  *         visitor.index = offset
11363  *         # We only need this so we can continue calculating the offset
11364  */
11365   /*else*/ {
11366     __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
11367     __PYX_ERR(0, 538, __pyx_L1_error)
11368   }
11369   __pyx_L6:;
11370 
11371   /* "yt/geometry/oct_container.pyx":539
11372  *         else:
11373  *             raise NotImplementedError
11374  *         visitor.index = offset             # <<<<<<<<<<<<<<
11375  *         # We only need this so we can continue calculating the offset
11376  *         visitor.dims = dims
11377  */
11378   __pyx_v_visitor->index = __pyx_v_offset;
11379 
11380   /* "yt/geometry/oct_container.pyx":541
11381  *         visitor.index = offset
11382  *         # We only need this so we can continue calculating the offset
11383  *         visitor.dims = dims             # <<<<<<<<<<<<<<
11384  *         self.visit_all_octs(selector, visitor)
11385  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:
11386  */
11387   __pyx_v_visitor->dims = __pyx_v_dims;
11388 
11389   /* "yt/geometry/oct_container.pyx":542
11390  *         # We only need this so we can continue calculating the offset
11391  *         visitor.dims = dims
11392  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
11393  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:
11394  *             print("GLOBAL INDEX RAN AHEAD.",)
11395  */
11396   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, __pyx_v_visitor, NULL);
11397 
11398   /* "yt/geometry/oct_container.pyx":543
11399  *         visitor.dims = dims
11400  *         self.visit_all_octs(selector, visitor)
11401  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:             # <<<<<<<<<<<<<<
11402  *             print("GLOBAL INDEX RAN AHEAD.",)
11403  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
11404  */
11405   __pyx_t_3 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
11406   __Pyx_GOTREF(__pyx_t_3);
11407   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L1_error)
11408   __Pyx_GOTREF(__pyx_t_12);
11409   __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_12, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
11410   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11411   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11412   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 543, __pyx_L1_error)
11413   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11414   if (__pyx_t_2) {
11415 
11416     /* "yt/geometry/oct_container.pyx":544
11417  *         self.visit_all_octs(selector, visitor)
11418  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:
11419  *             print("GLOBAL INDEX RAN AHEAD.",)             # <<<<<<<<<<<<<<
11420  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
11421  *             print(dest.size, source.size, num_cells)
11422  */
11423     if (__Pyx_PrintOne(0, __pyx_tuple__3) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
11424 
11425     /* "yt/geometry/oct_container.pyx":545
11426  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:
11427  *             print("GLOBAL INDEX RAN AHEAD.",)
11428  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size             # <<<<<<<<<<<<<<
11429  *             print(dest.size, source.size, num_cells)
11430  *             raise RuntimeError
11431  */
11432     __pyx_t_5 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
11433     __Pyx_GOTREF(__pyx_t_5);
11434     __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error)
11435     __Pyx_GOTREF(__pyx_t_12);
11436     __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
11437     __Pyx_GOTREF(__pyx_t_3);
11438     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11439     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11440     if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
11441     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11442 
11443     /* "yt/geometry/oct_container.pyx":546
11444  *             print("GLOBAL INDEX RAN AHEAD.",)
11445  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
11446  *             print(dest.size, source.size, num_cells)             # <<<<<<<<<<<<<<
11447  *             raise RuntimeError
11448  *         if visitor.index > dest.size:
11449  */
11450     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
11451     __Pyx_GOTREF(__pyx_t_3);
11452     __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
11453     __Pyx_GOTREF(__pyx_t_12);
11454     __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
11455     __Pyx_GOTREF(__pyx_t_5);
11456     __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error)
11457     __Pyx_GOTREF(__pyx_t_11);
11458     __Pyx_GIVEREF(__pyx_t_3);
11459     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
11460     __Pyx_GIVEREF(__pyx_t_12);
11461     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
11462     __Pyx_GIVEREF(__pyx_t_5);
11463     PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5);
11464     __pyx_t_3 = 0;
11465     __pyx_t_12 = 0;
11466     __pyx_t_5 = 0;
11467     if (__Pyx_PrintOne(0, __pyx_t_11) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
11468     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11469 
11470     /* "yt/geometry/oct_container.pyx":547
11471  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
11472  *             print(dest.size, source.size, num_cells)
11473  *             raise RuntimeError             # <<<<<<<<<<<<<<
11474  *         if visitor.index > dest.size:
11475  *             print("DEST INDEX RAN AHEAD.",)
11476  */
11477     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
11478     __PYX_ERR(0, 547, __pyx_L1_error)
11479 
11480     /* "yt/geometry/oct_container.pyx":543
11481  *         visitor.dims = dims
11482  *         self.visit_all_octs(selector, visitor)
11483  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:             # <<<<<<<<<<<<<<
11484  *             print("GLOBAL INDEX RAN AHEAD.",)
11485  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
11486  */
11487   }
11488 
11489   /* "yt/geometry/oct_container.pyx":548
11490  *             print(dest.size, source.size, num_cells)
11491  *             raise RuntimeError
11492  *         if visitor.index > dest.size:             # <<<<<<<<<<<<<<
11493  *             print("DEST INDEX RAN AHEAD.",)
11494  *             print(visitor.index - dest.size)
11495  */
11496   __pyx_t_11 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 548, __pyx_L1_error)
11497   __Pyx_GOTREF(__pyx_t_11);
11498   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
11499   __Pyx_GOTREF(__pyx_t_5);
11500   __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 548, __pyx_L1_error)
11501   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11502   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11503   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 548, __pyx_L1_error)
11504   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11505   if (__pyx_t_2) {
11506 
11507     /* "yt/geometry/oct_container.pyx":549
11508  *             raise RuntimeError
11509  *         if visitor.index > dest.size:
11510  *             print("DEST INDEX RAN AHEAD.",)             # <<<<<<<<<<<<<<
11511  *             print(visitor.index - dest.size)
11512  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size
11513  */
11514     if (__Pyx_PrintOne(0, __pyx_tuple__4) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
11515 
11516     /* "yt/geometry/oct_container.pyx":550
11517  *         if visitor.index > dest.size:
11518  *             print("DEST INDEX RAN AHEAD.",)
11519  *             print(visitor.index - dest.size)             # <<<<<<<<<<<<<<
11520  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size
11521  *             print(num_cells)
11522  */
11523     __pyx_t_12 = __Pyx_PyInt_From_npy_uint64(__pyx_v_visitor->index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 550, __pyx_L1_error)
11524     __Pyx_GOTREF(__pyx_t_12);
11525     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 550, __pyx_L1_error)
11526     __Pyx_GOTREF(__pyx_t_5);
11527     __pyx_t_11 = PyNumber_Subtract(__pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 550, __pyx_L1_error)
11528     __Pyx_GOTREF(__pyx_t_11);
11529     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11530     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11531     if (__Pyx_PrintOne(0, __pyx_t_11) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
11532     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11533 
11534     /* "yt/geometry/oct_container.pyx":551
11535  *             print("DEST INDEX RAN AHEAD.",)
11536  *             print(visitor.index - dest.size)
11537  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size             # <<<<<<<<<<<<<<
11538  *             print(num_cells)
11539  *             raise RuntimeError
11540  */
11541     __pyx_t_11 = __Pyx_PyInt_From_npy_int64((((__pyx_v_visitor->global_index + 1) * __pyx_v_visitor->nz) * __pyx_v_visitor->dims)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 551, __pyx_L1_error)
11542     __Pyx_GOTREF(__pyx_t_11);
11543     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
11544     __Pyx_GOTREF(__pyx_t_5);
11545     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 551, __pyx_L1_error)
11546     __Pyx_GOTREF(__pyx_t_12);
11547     __Pyx_GIVEREF(__pyx_t_11);
11548     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
11549     __Pyx_GIVEREF(__pyx_t_5);
11550     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
11551     __pyx_t_11 = 0;
11552     __pyx_t_5 = 0;
11553     if (__Pyx_Print(0, __pyx_t_12, 1) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
11554     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11555 
11556     /* "yt/geometry/oct_container.pyx":552
11557  *             print(visitor.index - dest.size)
11558  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size
11559  *             print(num_cells)             # <<<<<<<<<<<<<<
11560  *             raise RuntimeError
11561  *         if num_cells >= 0:
11562  */
11563     __pyx_t_12 = __Pyx_PyInt_From_npy_int64(__pyx_v_num_cells); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 552, __pyx_L1_error)
11564     __Pyx_GOTREF(__pyx_t_12);
11565     if (__Pyx_PrintOne(0, __pyx_t_12) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
11566     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
11567 
11568     /* "yt/geometry/oct_container.pyx":553
11569  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size
11570  *             print(num_cells)
11571  *             raise RuntimeError             # <<<<<<<<<<<<<<
11572  *         if num_cells >= 0:
11573  *             return dest
11574  */
11575     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
11576     __PYX_ERR(0, 553, __pyx_L1_error)
11577 
11578     /* "yt/geometry/oct_container.pyx":548
11579  *             print(dest.size, source.size, num_cells)
11580  *             raise RuntimeError
11581  *         if visitor.index > dest.size:             # <<<<<<<<<<<<<<
11582  *             print("DEST INDEX RAN AHEAD.",)
11583  *             print(visitor.index - dest.size)
11584  */
11585   }
11586 
11587   /* "yt/geometry/oct_container.pyx":554
11588  *             print(num_cells)
11589  *             raise RuntimeError
11590  *         if num_cells >= 0:             # <<<<<<<<<<<<<<
11591  *             return dest
11592  *         return visitor.index - offset
11593  */
11594   __pyx_t_2 = ((__pyx_v_num_cells >= 0) != 0);
11595   if (__pyx_t_2) {
11596 
11597     /* "yt/geometry/oct_container.pyx":555
11598  *             raise RuntimeError
11599  *         if num_cells >= 0:
11600  *             return dest             # <<<<<<<<<<<<<<
11601  *         return visitor.index - offset
11602  *
11603  */
11604     __Pyx_XDECREF(__pyx_r);
11605     __Pyx_INCREF(((PyObject *)__pyx_v_dest));
11606     __pyx_r = ((PyObject *)__pyx_v_dest);
11607     goto __pyx_L0;
11608 
11609     /* "yt/geometry/oct_container.pyx":554
11610  *             print(num_cells)
11611  *             raise RuntimeError
11612  *         if num_cells >= 0:             # <<<<<<<<<<<<<<
11613  *             return dest
11614  *         return visitor.index - offset
11615  */
11616   }
11617 
11618   /* "yt/geometry/oct_container.pyx":556
11619  *         if num_cells >= 0:
11620  *             return dest
11621  *         return visitor.index - offset             # <<<<<<<<<<<<<<
11622  *
11623  *     def domain_ind(self, selector, int domain_id = -1):
11624  */
11625   __Pyx_XDECREF(__pyx_r);
11626   __pyx_t_12 = __Pyx_PyInt_From_npy_uint64((__pyx_v_visitor->index - __pyx_v_offset)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 556, __pyx_L1_error)
11627   __Pyx_GOTREF(__pyx_t_12);
11628   __pyx_r = __pyx_t_12;
11629   __pyx_t_12 = 0;
11630   goto __pyx_L0;
11631 
11632   /* "yt/geometry/oct_container.pyx":498
11633  *         return header
11634  *
11635  *     def selector_fill(self, SelectorObject selector,             # <<<<<<<<<<<<<<
11636  *                       np.ndarray source,
11637  *                       np.ndarray dest = None,
11638  */
11639 
11640   /* function exit code */
11641   __pyx_L1_error:;
11642   __Pyx_XDECREF(__pyx_t_3);
11643   __Pyx_XDECREF(__pyx_t_4);
11644   __Pyx_XDECREF(__pyx_t_5);
11645   __Pyx_XDECREF(__pyx_t_6);
11646   __Pyx_XDECREF(__pyx_t_8);
11647   __Pyx_XDECREF(__pyx_t_10);
11648   __Pyx_XDECREF(__pyx_t_11);
11649   __Pyx_XDECREF(__pyx_t_12);
11650   __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
11651   __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
11652   __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
11653   __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
11654   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.selector_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
11655   __pyx_r = NULL;
11656   __pyx_L0:;
11657   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
11658   __Pyx_XDECREF((PyObject *)__pyx_v_visitor_i64);
11659   __Pyx_XDECREF((PyObject *)__pyx_v_visitor_f64);
11660   __Pyx_XDECREF((PyObject *)__pyx_v_source);
11661   __Pyx_XDECREF((PyObject *)__pyx_v_dest);
11662   __Pyx_XGIVEREF(__pyx_r);
11663   __Pyx_RefNannyFinishContext();
11664   return __pyx_r;
11665 }
11666 
11667 /* "yt/geometry/oct_container.pyx":558
11668  *         return visitor.index - offset
11669  *
11670  *     def domain_ind(self, selector, int domain_id = -1):             # <<<<<<<<<<<<<<
11671  *         cdef np.ndarray[np.int64_t, ndim=1] ind
11672  *         # Here's where we grab the masked items.
11673  */
11674 
11675 /* Python wrapper */
11676 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11677 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11678   PyObject *__pyx_v_selector = 0;
11679   int __pyx_v_domain_id;
11680   PyObject *__pyx_r = 0;
11681   __Pyx_RefNannyDeclarations
11682   __Pyx_RefNannySetupContext("domain_ind (wrapper)", 0);
11683   {
11684     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_domain_id,0};
11685     PyObject* values[2] = {0,0};
11686     if (unlikely(__pyx_kwds)) {
11687       Py_ssize_t kw_args;
11688       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11689       switch (pos_args) {
11690         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11691         CYTHON_FALLTHROUGH;
11692         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11693         CYTHON_FALLTHROUGH;
11694         case  0: break;
11695         default: goto __pyx_L5_argtuple_error;
11696       }
11697       kw_args = PyDict_Size(__pyx_kwds);
11698       switch (pos_args) {
11699         case  0:
11700         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
11701         else goto __pyx_L5_argtuple_error;
11702         CYTHON_FALLTHROUGH;
11703         case  1:
11704         if (kw_args > 0) {
11705           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
11706           if (value) { values[1] = value; kw_args--; }
11707         }
11708       }
11709       if (unlikely(kw_args > 0)) {
11710         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "domain_ind") < 0)) __PYX_ERR(0, 558, __pyx_L3_error)
11711       }
11712     } else {
11713       switch (PyTuple_GET_SIZE(__pyx_args)) {
11714         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11715         CYTHON_FALLTHROUGH;
11716         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11717         break;
11718         default: goto __pyx_L5_argtuple_error;
11719       }
11720     }
11721     __pyx_v_selector = values[0];
11722     if (values[1]) {
11723       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 558, __pyx_L3_error)
11724     } else {
11725       __pyx_v_domain_id = ((int)-1);
11726     }
11727   }
11728   goto __pyx_L4_argument_unpacking_done;
11729   __pyx_L5_argtuple_error:;
11730   __Pyx_RaiseArgtupleInvalid("domain_ind", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error)
11731   __pyx_L3_error:;
11732   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domain_ind", __pyx_clineno, __pyx_lineno, __pyx_filename);
11733   __Pyx_RefNannyFinishContext();
11734   return NULL;
11735   __pyx_L4_argument_unpacking_done:;
11736   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id);
11737 
11738   /* function exit code */
11739   __Pyx_RefNannyFinishContext();
11740   return __pyx_r;
11741 }
11742 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_selector,int __pyx_v_domain_id)11743 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_26domain_ind(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_selector, int __pyx_v_domain_id) {
11744   PyArrayObject *__pyx_v_ind = 0;
11745   struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_v_visitor = 0;
11746   __Pyx_LocalBuf_ND __pyx_pybuffernd_ind;
11747   __Pyx_Buffer __pyx_pybuffer_ind;
11748   PyObject *__pyx_r = NULL;
11749   __Pyx_RefNannyDeclarations
11750   PyObject *__pyx_t_1 = NULL;
11751   PyObject *__pyx_t_2 = NULL;
11752   PyObject *__pyx_t_3 = NULL;
11753   PyObject *__pyx_t_4 = NULL;
11754   int __pyx_t_5;
11755   PyObject *__pyx_t_6 = NULL;
11756   PyArrayObject *__pyx_t_7 = NULL;
11757   PyObject *__pyx_t_8 = NULL;
11758   PyObject *__pyx_t_9 = NULL;
11759   PyObject *__pyx_t_10 = NULL;
11760   __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
11761   __Pyx_RefNannySetupContext("domain_ind", 0);
11762   __pyx_pybuffer_ind.pybuffer.buf = NULL;
11763   __pyx_pybuffer_ind.refcount = 0;
11764   __pyx_pybuffernd_ind.data = NULL;
11765   __pyx_pybuffernd_ind.rcbuffer = &__pyx_pybuffer_ind;
11766 
11767   /* "yt/geometry/oct_container.pyx":561
11768  *         cdef np.ndarray[np.int64_t, ndim=1] ind
11769  *         # Here's where we grab the masked items.
11770  *         ind = np.full(self.nocts, -1, 'int64')             # <<<<<<<<<<<<<<
11771  *         cdef oct_visitors.IndexOcts visitor
11772  *         visitor = oct_visitors.IndexOcts(self, domain_id)
11773  */
11774   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
11775   __Pyx_GOTREF(__pyx_t_2);
11776   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
11777   __Pyx_GOTREF(__pyx_t_3);
11778   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11779   __pyx_t_2 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
11780   __Pyx_GOTREF(__pyx_t_2);
11781   __pyx_t_4 = NULL;
11782   __pyx_t_5 = 0;
11783   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11784     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11785     if (likely(__pyx_t_4)) {
11786       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11787       __Pyx_INCREF(__pyx_t_4);
11788       __Pyx_INCREF(function);
11789       __Pyx_DECREF_SET(__pyx_t_3, function);
11790       __pyx_t_5 = 1;
11791     }
11792   }
11793   #if CYTHON_FAST_PYCALL
11794   if (PyFunction_Check(__pyx_t_3)) {
11795     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_int_neg_1, __pyx_n_s_int64};
11796     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
11797     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11798     __Pyx_GOTREF(__pyx_t_1);
11799     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11800   } else
11801   #endif
11802   #if CYTHON_FAST_PYCCALL
11803   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
11804     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_int_neg_1, __pyx_n_s_int64};
11805     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
11806     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11807     __Pyx_GOTREF(__pyx_t_1);
11808     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11809   } else
11810   #endif
11811   {
11812     __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
11813     __Pyx_GOTREF(__pyx_t_6);
11814     if (__pyx_t_4) {
11815       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
11816     }
11817     __Pyx_GIVEREF(__pyx_t_2);
11818     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
11819     __Pyx_INCREF(__pyx_int_neg_1);
11820     __Pyx_GIVEREF(__pyx_int_neg_1);
11821     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_int_neg_1);
11822     __Pyx_INCREF(__pyx_n_s_int64);
11823     __Pyx_GIVEREF(__pyx_n_s_int64);
11824     PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_n_s_int64);
11825     __pyx_t_2 = 0;
11826     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
11827     __Pyx_GOTREF(__pyx_t_1);
11828     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11829   }
11830   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11831   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 561, __pyx_L1_error)
11832   __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
11833   {
11834     __Pyx_BufFmt_StackElem __pyx_stack[1];
11835     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
11836     __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
11837     if (unlikely(__pyx_t_5 < 0)) {
11838       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
11839       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
11840         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
11841         __Pyx_RaiseBufferFallbackError();
11842       } else {
11843         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
11844       }
11845       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
11846     }
11847     __pyx_pybuffernd_ind.diminfo[0].strides = __pyx_pybuffernd_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ind.diminfo[0].shape = __pyx_pybuffernd_ind.rcbuffer->pybuffer.shape[0];
11848     if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 561, __pyx_L1_error)
11849   }
11850   __pyx_t_7 = 0;
11851   __pyx_v_ind = ((PyArrayObject *)__pyx_t_1);
11852   __pyx_t_1 = 0;
11853 
11854   /* "yt/geometry/oct_container.pyx":563
11855  *         ind = np.full(self.nocts, -1, 'int64')
11856  *         cdef oct_visitors.IndexOcts visitor
11857  *         visitor = oct_visitors.IndexOcts(self, domain_id)             # <<<<<<<<<<<<<<
11858  *         visitor.oct_index = ind
11859  *         self.visit_all_octs(selector, visitor)
11860  */
11861   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
11862   __Pyx_GOTREF(__pyx_t_1);
11863   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error)
11864   __Pyx_GOTREF(__pyx_t_3);
11865   __Pyx_INCREF(((PyObject *)__pyx_v_self));
11866   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11867   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
11868   __Pyx_GIVEREF(__pyx_t_1);
11869   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11870   __pyx_t_1 = 0;
11871   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
11872   __Pyx_GOTREF(__pyx_t_1);
11873   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11874   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts *)__pyx_t_1);
11875   __pyx_t_1 = 0;
11876 
11877   /* "yt/geometry/oct_container.pyx":564
11878  *         cdef oct_visitors.IndexOcts visitor
11879  *         visitor = oct_visitors.IndexOcts(self, domain_id)
11880  *         visitor.oct_index = ind             # <<<<<<<<<<<<<<
11881  *         self.visit_all_octs(selector, visitor)
11882  *         return ind
11883  */
11884   __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_ind), PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 564, __pyx_L1_error)
11885   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->oct_index, 0);
11886   __pyx_v_visitor->oct_index = __pyx_t_11;
11887   __pyx_t_11.memview = NULL;
11888   __pyx_t_11.data = NULL;
11889 
11890   /* "yt/geometry/oct_container.pyx":565
11891  *         visitor = oct_visitors.IndexOcts(self, domain_id)
11892  *         visitor.oct_index = ind
11893  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
11894  *         return ind
11895  *
11896  */
11897   if (!(likely(((__pyx_v_selector) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_selector, __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject))))) __PYX_ERR(0, 565, __pyx_L1_error)
11898   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector), ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
11899 
11900   /* "yt/geometry/oct_container.pyx":566
11901  *         visitor.oct_index = ind
11902  *         self.visit_all_octs(selector, visitor)
11903  *         return ind             # <<<<<<<<<<<<<<
11904  *
11905  *     @cython.boundscheck(False)
11906  */
11907   __Pyx_XDECREF(__pyx_r);
11908   __Pyx_INCREF(((PyObject *)__pyx_v_ind));
11909   __pyx_r = ((PyObject *)__pyx_v_ind);
11910   goto __pyx_L0;
11911 
11912   /* "yt/geometry/oct_container.pyx":558
11913  *         return visitor.index - offset
11914  *
11915  *     def domain_ind(self, selector, int domain_id = -1):             # <<<<<<<<<<<<<<
11916  *         cdef np.ndarray[np.int64_t, ndim=1] ind
11917  *         # Here's where we grab the masked items.
11918  */
11919 
11920   /* function exit code */
11921   __pyx_L1_error:;
11922   __Pyx_XDECREF(__pyx_t_1);
11923   __Pyx_XDECREF(__pyx_t_2);
11924   __Pyx_XDECREF(__pyx_t_3);
11925   __Pyx_XDECREF(__pyx_t_4);
11926   __Pyx_XDECREF(__pyx_t_6);
11927   __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
11928   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11929     __Pyx_PyThreadState_declare
11930     __Pyx_PyThreadState_assign
11931     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11932     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
11933   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11934   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domain_ind", __pyx_clineno, __pyx_lineno, __pyx_filename);
11935   __pyx_r = NULL;
11936   goto __pyx_L2;
11937   __pyx_L0:;
11938   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ind.rcbuffer->pybuffer);
11939   __pyx_L2:;
11940   __Pyx_XDECREF((PyObject *)__pyx_v_ind);
11941   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
11942   __Pyx_XGIVEREF(__pyx_r);
11943   __Pyx_RefNannyFinishContext();
11944   return __pyx_r;
11945 }
11946 
11947 /* "yt/geometry/oct_container.pyx":571
11948  *     @cython.wraparound(False)
11949  *     @cython.cdivision(True)
11950  *     def add(self, int curdom, int curlevel,             # <<<<<<<<<<<<<<
11951  *             np.ndarray[np.float64_t, ndim=2] pos,
11952  *             int skip_boundary = 1,
11953  */
11954 
11955 /* Python wrapper */
11956 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11957 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11958   int __pyx_v_curdom;
11959   int __pyx_v_curlevel;
11960   PyArrayObject *__pyx_v_pos = 0;
11961   int __pyx_v_skip_boundary;
11962   int __pyx_v_count_boundary;
11963   PyObject *__pyx_r = 0;
11964   __Pyx_RefNannyDeclarations
11965   __Pyx_RefNannySetupContext("add (wrapper)", 0);
11966   {
11967     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_curdom,&__pyx_n_s_curlevel,&__pyx_n_s_pos,&__pyx_n_s_skip_boundary,&__pyx_n_s_count_boundary,0};
11968     PyObject* values[5] = {0,0,0,0,0};
11969     if (unlikely(__pyx_kwds)) {
11970       Py_ssize_t kw_args;
11971       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11972       switch (pos_args) {
11973         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11974         CYTHON_FALLTHROUGH;
11975         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11976         CYTHON_FALLTHROUGH;
11977         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11978         CYTHON_FALLTHROUGH;
11979         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11980         CYTHON_FALLTHROUGH;
11981         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11982         CYTHON_FALLTHROUGH;
11983         case  0: break;
11984         default: goto __pyx_L5_argtuple_error;
11985       }
11986       kw_args = PyDict_Size(__pyx_kwds);
11987       switch (pos_args) {
11988         case  0:
11989         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_curdom)) != 0)) kw_args--;
11990         else goto __pyx_L5_argtuple_error;
11991         CYTHON_FALLTHROUGH;
11992         case  1:
11993         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_curlevel)) != 0)) kw_args--;
11994         else {
11995           __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 1); __PYX_ERR(0, 571, __pyx_L3_error)
11996         }
11997         CYTHON_FALLTHROUGH;
11998         case  2:
11999         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
12000         else {
12001           __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, 2); __PYX_ERR(0, 571, __pyx_L3_error)
12002         }
12003         CYTHON_FALLTHROUGH;
12004         case  3:
12005         if (kw_args > 0) {
12006           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_skip_boundary);
12007           if (value) { values[3] = value; kw_args--; }
12008         }
12009         CYTHON_FALLTHROUGH;
12010         case  4:
12011         if (kw_args > 0) {
12012           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count_boundary);
12013           if (value) { values[4] = value; kw_args--; }
12014         }
12015       }
12016       if (unlikely(kw_args > 0)) {
12017         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 571, __pyx_L3_error)
12018       }
12019     } else {
12020       switch (PyTuple_GET_SIZE(__pyx_args)) {
12021         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12022         CYTHON_FALLTHROUGH;
12023         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12024         CYTHON_FALLTHROUGH;
12025         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12026         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12027         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12028         break;
12029         default: goto __pyx_L5_argtuple_error;
12030       }
12031     }
12032     __pyx_v_curdom = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_curdom == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L3_error)
12033     __pyx_v_curlevel = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_curlevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L3_error)
12034     __pyx_v_pos = ((PyArrayObject *)values[2]);
12035     if (values[3]) {
12036       __pyx_v_skip_boundary = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_skip_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error)
12037     } else {
12038       __pyx_v_skip_boundary = ((int)1);
12039     }
12040     if (values[4]) {
12041       __pyx_v_count_boundary = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_count_boundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 574, __pyx_L3_error)
12042     } else {
12043       __pyx_v_count_boundary = ((int)0);
12044     }
12045   }
12046   goto __pyx_L4_argument_unpacking_done;
12047   __pyx_L5_argtuple_error:;
12048   __Pyx_RaiseArgtupleInvalid("add", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 571, __pyx_L3_error)
12049   __pyx_L3_error:;
12050   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
12051   __Pyx_RefNannyFinishContext();
12052   return NULL;
12053   __pyx_L4_argument_unpacking_done:;
12054   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), __pyx_ptype_5numpy_ndarray, 1, "pos", 0))) __PYX_ERR(0, 572, __pyx_L1_error)
12055   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_curdom, __pyx_v_curlevel, __pyx_v_pos, __pyx_v_skip_boundary, __pyx_v_count_boundary);
12056 
12057   /* function exit code */
12058   goto __pyx_L0;
12059   __pyx_L1_error:;
12060   __pyx_r = NULL;
12061   __pyx_L0:;
12062   __Pyx_RefNannyFinishContext();
12063   return __pyx_r;
12064 }
12065 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int __pyx_v_curdom,int __pyx_v_curlevel,PyArrayObject * __pyx_v_pos,int __pyx_v_skip_boundary,int __pyx_v_count_boundary)12066 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_28add(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_curdom, int __pyx_v_curlevel, PyArrayObject *__pyx_v_pos, int __pyx_v_skip_boundary, int __pyx_v_count_boundary) {
12067   int __pyx_v_no;
12068   int __pyx_v_p;
12069   int __pyx_v_i;
12070   int __pyx_v_ind[3];
12071   int __pyx_v_nb;
12072   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_cur;
12073   __pyx_t_5numpy_float64_t __pyx_v_pp[3];
12074   __pyx_t_5numpy_float64_t __pyx_v_cp[3];
12075   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
12076   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cont;
12077   int __pyx_v_initial;
12078   int __pyx_v_in_boundary;
12079   CYTHON_UNUSED int __pyx_v__;
12080   __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
12081   __Pyx_Buffer __pyx_pybuffer_pos;
12082   PyObject *__pyx_r = NULL;
12083   __Pyx_RefNannyDeclarations
12084   int __pyx_t_1;
12085   __pyx_t_5numpy_uint64_t __pyx_t_2;
12086   int __pyx_t_3;
12087   int __pyx_t_4;
12088   int __pyx_t_5;
12089   int __pyx_t_6;
12090   Py_ssize_t __pyx_t_7;
12091   Py_ssize_t __pyx_t_8;
12092   int __pyx_t_9;
12093   int __pyx_t_10;
12094   int __pyx_t_11;
12095   int __pyx_t_12;
12096   int __pyx_t_13;
12097   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_14;
12098   PyObject *__pyx_t_15 = NULL;
12099   __Pyx_RefNannySetupContext("add", 0);
12100   __pyx_pybuffer_pos.pybuffer.buf = NULL;
12101   __pyx_pybuffer_pos.refcount = 0;
12102   __pyx_pybuffernd_pos.data = NULL;
12103   __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
12104   {
12105     __Pyx_BufFmt_StackElem __pyx_stack[1];
12106     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 571, __pyx_L1_error)
12107   }
12108   __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1];
12109 
12110   /* "yt/geometry/oct_container.pyx":577
12111  *         cdef int no, p, i
12112  *         cdef int ind[3]
12113  *         cdef int nb = 0             # <<<<<<<<<<<<<<
12114  *         cdef Oct *cur
12115  *         cdef np.float64_t pp[3]
12116  */
12117   __pyx_v_nb = 0;
12118 
12119   /* "yt/geometry/oct_container.pyx":582
12120  *         cdef np.float64_t cp[3]
12121  *         cdef np.float64_t dds[3]
12122  *         no = pos.shape[0] #number of octs             # <<<<<<<<<<<<<<
12123  *         if curdom > self.num_domains: return 0
12124  *         cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1)
12125  */
12126   __pyx_v_no = (__pyx_v_pos->dimensions[0]);
12127 
12128   /* "yt/geometry/oct_container.pyx":583
12129  *         cdef np.float64_t dds[3]
12130  *         no = pos.shape[0] #number of octs
12131  *         if curdom > self.num_domains: return 0             # <<<<<<<<<<<<<<
12132  *         cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1)
12133  *         cdef int initial = cont.n_assigned
12134  */
12135   __pyx_t_1 = ((__pyx_v_curdom > __pyx_v_self->num_domains) != 0);
12136   if (__pyx_t_1) {
12137     __Pyx_XDECREF(__pyx_r);
12138     __Pyx_INCREF(__pyx_int_0);
12139     __pyx_r = __pyx_int_0;
12140     goto __pyx_L0;
12141   }
12142 
12143   /* "yt/geometry/oct_container.pyx":584
12144  *         no = pos.shape[0] #number of octs
12145  *         if curdom > self.num_domains: return 0
12146  *         cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1)             # <<<<<<<<<<<<<<
12147  *         cdef int initial = cont.n_assigned
12148  *         cdef int in_boundary = 0
12149  */
12150   __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_curdom - 1));
12151 
12152   /* "yt/geometry/oct_container.pyx":585
12153  *         if curdom > self.num_domains: return 0
12154  *         cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1)
12155  *         cdef int initial = cont.n_assigned             # <<<<<<<<<<<<<<
12156  *         cdef int in_boundary = 0
12157  *         # How do we bootstrap ourselves?
12158  */
12159   __pyx_t_2 = __pyx_v_cont->n_assigned;
12160   __pyx_v_initial = __pyx_t_2;
12161 
12162   /* "yt/geometry/oct_container.pyx":586
12163  *         cdef OctAllocationContainer *cont = self.domains.get_cont(curdom - 1)
12164  *         cdef int initial = cont.n_assigned
12165  *         cdef int in_boundary = 0             # <<<<<<<<<<<<<<
12166  *         # How do we bootstrap ourselves?
12167  *         for p in range(no):
12168  */
12169   __pyx_v_in_boundary = 0;
12170 
12171   /* "yt/geometry/oct_container.pyx":588
12172  *         cdef int in_boundary = 0
12173  *         # How do we bootstrap ourselves?
12174  *         for p in range(no):             # <<<<<<<<<<<<<<
12175  *             #for every oct we're trying to add find the
12176  *             #floating point unitary position on this level
12177  */
12178   __pyx_t_3 = __pyx_v_no;
12179   __pyx_t_4 = __pyx_t_3;
12180   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12181     __pyx_v_p = __pyx_t_5;
12182 
12183     /* "yt/geometry/oct_container.pyx":591
12184  *             #for every oct we're trying to add find the
12185  *             #floating point unitary position on this level
12186  *             in_boundary = 0             # <<<<<<<<<<<<<<
12187  *             for i in range(3):
12188  *                 pp[i] = pos[p, i]
12189  */
12190     __pyx_v_in_boundary = 0;
12191 
12192     /* "yt/geometry/oct_container.pyx":592
12193  *             #floating point unitary position on this level
12194  *             in_boundary = 0
12195  *             for i in range(3):             # <<<<<<<<<<<<<<
12196  *                 pp[i] = pos[p, i]
12197  *                 dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
12198  */
12199     for (__pyx_t_6 = 0; __pyx_t_6 < 3; __pyx_t_6+=1) {
12200       __pyx_v_i = __pyx_t_6;
12201 
12202       /* "yt/geometry/oct_container.pyx":593
12203  *             in_boundary = 0
12204  *             for i in range(3):
12205  *                 pp[i] = pos[p, i]             # <<<<<<<<<<<<<<
12206  *                 dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
12207  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])
12208  */
12209       __pyx_t_7 = __pyx_v_p;
12210       __pyx_t_8 = __pyx_v_i;
12211       (__pyx_v_pp[__pyx_v_i]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_pos.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_pos.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_pos.diminfo[1].strides));
12212 
12213       /* "yt/geometry/oct_container.pyx":594
12214  *             for i in range(3):
12215  *                 pp[i] = pos[p, i]
12216  *                 dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]             # <<<<<<<<<<<<<<
12217  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])
12218  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
12219  */
12220       (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->DRE[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_self->nn[__pyx_v_i]));
12221 
12222       /* "yt/geometry/oct_container.pyx":595
12223  *                 pp[i] = pos[p, i]
12224  *                 dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
12225  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])             # <<<<<<<<<<<<<<
12226  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
12227  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:
12228  */
12229       (__pyx_v_ind[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)(((__pyx_v_pp[__pyx_v_i]) - (__pyx_v_self->DLE[__pyx_v_i])) / (__pyx_v_dds[__pyx_v_i])));
12230 
12231       /* "yt/geometry/oct_container.pyx":596
12232  *                 dds[i] = (self.DRE[i] - self.DLE[i])/self.nn[i]
12233  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])
12234  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]             # <<<<<<<<<<<<<<
12235  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:
12236  *                     in_boundary = 1
12237  */
12238       (__pyx_v_cp[__pyx_v_i]) = ((((__pyx_v_ind[__pyx_v_i]) + 0.5) * (__pyx_v_dds[__pyx_v_i])) + (__pyx_v_self->DLE[__pyx_v_i]));
12239 
12240       /* "yt/geometry/oct_container.pyx":597
12241  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])
12242  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
12243  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:             # <<<<<<<<<<<<<<
12244  *                     in_boundary = 1
12245  *             if skip_boundary == in_boundary == 1:
12246  */
12247       __pyx_t_9 = (((__pyx_v_ind[__pyx_v_i]) < 0) != 0);
12248       if (!__pyx_t_9) {
12249       } else {
12250         __pyx_t_1 = __pyx_t_9;
12251         goto __pyx_L9_bool_binop_done;
12252       }
12253       __pyx_t_9 = (((__pyx_v_ind[__pyx_v_i]) >= (__pyx_v_self->nn[__pyx_v_i])) != 0);
12254       __pyx_t_1 = __pyx_t_9;
12255       __pyx_L9_bool_binop_done:;
12256       if (__pyx_t_1) {
12257 
12258         /* "yt/geometry/oct_container.pyx":598
12259  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
12260  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:
12261  *                     in_boundary = 1             # <<<<<<<<<<<<<<
12262  *             if skip_boundary == in_boundary == 1:
12263  *                 nb += count_boundary
12264  */
12265         __pyx_v_in_boundary = 1;
12266 
12267         /* "yt/geometry/oct_container.pyx":597
12268  *                 ind[i] = <np.int64_t> ((pp[i] - self.DLE[i])/dds[i])
12269  *                 cp[i] = (ind[i] + 0.5) * dds[i] + self.DLE[i]
12270  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:             # <<<<<<<<<<<<<<
12271  *                     in_boundary = 1
12272  *             if skip_boundary == in_boundary == 1:
12273  */
12274       }
12275     }
12276 
12277     /* "yt/geometry/oct_container.pyx":599
12278  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:
12279  *                     in_boundary = 1
12280  *             if skip_boundary == in_boundary == 1:             # <<<<<<<<<<<<<<
12281  *                 nb += count_boundary
12282  *                 continue
12283  */
12284     __pyx_t_1 = (__pyx_v_skip_boundary == __pyx_v_in_boundary);
12285     if (__pyx_t_1) {
12286       __pyx_t_1 = (__pyx_v_in_boundary == 1);
12287     }
12288     __pyx_t_9 = (__pyx_t_1 != 0);
12289     if (__pyx_t_9) {
12290 
12291       /* "yt/geometry/oct_container.pyx":600
12292  *                     in_boundary = 1
12293  *             if skip_boundary == in_boundary == 1:
12294  *                 nb += count_boundary             # <<<<<<<<<<<<<<
12295  *                 continue
12296  *             cur = self.next_root(curdom, ind)
12297  */
12298       __pyx_v_nb = (__pyx_v_nb + __pyx_v_count_boundary);
12299 
12300       /* "yt/geometry/oct_container.pyx":601
12301  *             if skip_boundary == in_boundary == 1:
12302  *                 nb += count_boundary
12303  *                 continue             # <<<<<<<<<<<<<<
12304  *             cur = self.next_root(curdom, ind)
12305  *             if cur == NULL: raise RuntimeError
12306  */
12307       goto __pyx_L4_continue;
12308 
12309       /* "yt/geometry/oct_container.pyx":599
12310  *                 if ind[i] < 0 or ind[i] >= self.nn[i]:
12311  *                     in_boundary = 1
12312  *             if skip_boundary == in_boundary == 1:             # <<<<<<<<<<<<<<
12313  *                 nb += count_boundary
12314  *                 continue
12315  */
12316     }
12317 
12318     /* "yt/geometry/oct_container.pyx":602
12319  *                 nb += count_boundary
12320  *                 continue
12321  *             cur = self.next_root(curdom, ind)             # <<<<<<<<<<<<<<
12322  *             if cur == NULL: raise RuntimeError
12323  *             # Now we find the location we want
12324  */
12325     __pyx_v_cur = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->next_root(__pyx_v_self, __pyx_v_curdom, __pyx_v_ind);
12326 
12327     /* "yt/geometry/oct_container.pyx":603
12328  *                 continue
12329  *             cur = self.next_root(curdom, ind)
12330  *             if cur == NULL: raise RuntimeError             # <<<<<<<<<<<<<<
12331  *             # Now we find the location we want
12332  *             # Note that RAMSES I think 1-findiceses levels, but we don't.
12333  */
12334     __pyx_t_9 = ((__pyx_v_cur == NULL) != 0);
12335     if (unlikely(__pyx_t_9)) {
12336       __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
12337       __PYX_ERR(0, 603, __pyx_L1_error)
12338     }
12339 
12340     /* "yt/geometry/oct_container.pyx":606
12341  *             # Now we find the location we want
12342  *             # Note that RAMSES I think 1-findiceses levels, but we don't.
12343  *             for _ in range(curlevel):             # <<<<<<<<<<<<<<
12344  *                 # At every level, find the cell this oct
12345  *                 # lives inside
12346  */
12347     __pyx_t_6 = __pyx_v_curlevel;
12348     __pyx_t_10 = __pyx_t_6;
12349     for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
12350       __pyx_v__ = __pyx_t_11;
12351 
12352       /* "yt/geometry/oct_container.pyx":609
12353  *                 # At every level, find the cell this oct
12354  *                 # lives inside
12355  *                 for i in range(3):             # <<<<<<<<<<<<<<
12356  *                     #as we get deeper, oct size halves
12357  *                     dds[i] = dds[i] / 2.0
12358  */
12359       for (__pyx_t_12 = 0; __pyx_t_12 < 3; __pyx_t_12+=1) {
12360         __pyx_v_i = __pyx_t_12;
12361 
12362         /* "yt/geometry/oct_container.pyx":611
12363  *                 for i in range(3):
12364  *                     #as we get deeper, oct size halves
12365  *                     dds[i] = dds[i] / 2.0             # <<<<<<<<<<<<<<
12366  *                     if cp[i] > pp[i]:
12367  *                         ind[i] = 0
12368  */
12369         (__pyx_v_dds[__pyx_v_i]) = ((__pyx_v_dds[__pyx_v_i]) / 2.0);
12370 
12371         /* "yt/geometry/oct_container.pyx":612
12372  *                     #as we get deeper, oct size halves
12373  *                     dds[i] = dds[i] / 2.0
12374  *                     if cp[i] > pp[i]:             # <<<<<<<<<<<<<<
12375  *                         ind[i] = 0
12376  *                         cp[i] -= dds[i]/2.0
12377  */
12378         __pyx_t_9 = (((__pyx_v_cp[__pyx_v_i]) > (__pyx_v_pp[__pyx_v_i])) != 0);
12379         if (__pyx_t_9) {
12380 
12381           /* "yt/geometry/oct_container.pyx":613
12382  *                     dds[i] = dds[i] / 2.0
12383  *                     if cp[i] > pp[i]:
12384  *                         ind[i] = 0             # <<<<<<<<<<<<<<
12385  *                         cp[i] -= dds[i]/2.0
12386  *                     else:
12387  */
12388           (__pyx_v_ind[__pyx_v_i]) = 0;
12389 
12390           /* "yt/geometry/oct_container.pyx":614
12391  *                     if cp[i] > pp[i]:
12392  *                         ind[i] = 0
12393  *                         cp[i] -= dds[i]/2.0             # <<<<<<<<<<<<<<
12394  *                     else:
12395  *                         ind[i] = 1
12396  */
12397           __pyx_t_13 = __pyx_v_i;
12398           (__pyx_v_cp[__pyx_t_13]) = ((__pyx_v_cp[__pyx_t_13]) - ((__pyx_v_dds[__pyx_v_i]) / 2.0));
12399 
12400           /* "yt/geometry/oct_container.pyx":612
12401  *                     #as we get deeper, oct size halves
12402  *                     dds[i] = dds[i] / 2.0
12403  *                     if cp[i] > pp[i]:             # <<<<<<<<<<<<<<
12404  *                         ind[i] = 0
12405  *                         cp[i] -= dds[i]/2.0
12406  */
12407           goto __pyx_L17;
12408         }
12409 
12410         /* "yt/geometry/oct_container.pyx":616
12411  *                         cp[i] -= dds[i]/2.0
12412  *                     else:
12413  *                         ind[i] = 1             # <<<<<<<<<<<<<<
12414  *                         cp[i] += dds[i]/2.0
12415  *                 # Check if it has not been allocated
12416  */
12417         /*else*/ {
12418           (__pyx_v_ind[__pyx_v_i]) = 1;
12419 
12420           /* "yt/geometry/oct_container.pyx":617
12421  *                     else:
12422  *                         ind[i] = 1
12423  *                         cp[i] += dds[i]/2.0             # <<<<<<<<<<<<<<
12424  *                 # Check if it has not been allocated
12425  *                 cur = self.next_child(curdom, ind, cur)
12426  */
12427           __pyx_t_13 = __pyx_v_i;
12428           (__pyx_v_cp[__pyx_t_13]) = ((__pyx_v_cp[__pyx_t_13]) + ((__pyx_v_dds[__pyx_v_i]) / 2.0));
12429         }
12430         __pyx_L17:;
12431       }
12432 
12433       /* "yt/geometry/oct_container.pyx":619
12434  *                         cp[i] += dds[i]/2.0
12435  *                 # Check if it has not been allocated
12436  *                 cur = self.next_child(curdom, ind, cur)             # <<<<<<<<<<<<<<
12437  *             # Now we should be at the right level
12438  *             cur.domain = curdom
12439  */
12440       __pyx_t_14 = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->next_child(__pyx_v_self, __pyx_v_curdom, __pyx_v_ind, __pyx_v_cur); if (unlikely(__pyx_t_14 == ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
12441       __pyx_v_cur = __pyx_t_14;
12442     }
12443 
12444     /* "yt/geometry/oct_container.pyx":621
12445  *                 cur = self.next_child(curdom, ind, cur)
12446  *             # Now we should be at the right level
12447  *             cur.domain = curdom             # <<<<<<<<<<<<<<
12448  *             cur.file_ind = p
12449  *         return cont.n_assigned - initial + nb
12450  */
12451     __pyx_v_cur->domain = __pyx_v_curdom;
12452 
12453     /* "yt/geometry/oct_container.pyx":622
12454  *             # Now we should be at the right level
12455  *             cur.domain = curdom
12456  *             cur.file_ind = p             # <<<<<<<<<<<<<<
12457  *         return cont.n_assigned - initial + nb
12458  *
12459  */
12460     __pyx_v_cur->file_ind = __pyx_v_p;
12461     __pyx_L4_continue:;
12462   }
12463 
12464   /* "yt/geometry/oct_container.pyx":623
12465  *             cur.domain = curdom
12466  *             cur.file_ind = p
12467  *         return cont.n_assigned - initial + nb             # <<<<<<<<<<<<<<
12468  *
12469  *     def allocate_domains(self, domain_counts):
12470  */
12471   __Pyx_XDECREF(__pyx_r);
12472   __pyx_t_15 = __Pyx_PyInt_From_npy_uint64(((__pyx_v_cont->n_assigned - __pyx_v_initial) + __pyx_v_nb)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 623, __pyx_L1_error)
12473   __Pyx_GOTREF(__pyx_t_15);
12474   __pyx_r = __pyx_t_15;
12475   __pyx_t_15 = 0;
12476   goto __pyx_L0;
12477 
12478   /* "yt/geometry/oct_container.pyx":571
12479  *     @cython.wraparound(False)
12480  *     @cython.cdivision(True)
12481  *     def add(self, int curdom, int curlevel,             # <<<<<<<<<<<<<<
12482  *             np.ndarray[np.float64_t, ndim=2] pos,
12483  *             int skip_boundary = 1,
12484  */
12485 
12486   /* function exit code */
12487   __pyx_L1_error:;
12488   __Pyx_XDECREF(__pyx_t_15);
12489   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12490     __Pyx_PyThreadState_declare
12491     __Pyx_PyThreadState_assign
12492     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12493     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
12494   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12495   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
12496   __pyx_r = NULL;
12497   goto __pyx_L2;
12498   __pyx_L0:;
12499   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
12500   __pyx_L2:;
12501   __Pyx_XGIVEREF(__pyx_r);
12502   __Pyx_RefNannyFinishContext();
12503   return __pyx_r;
12504 }
12505 
12506 /* "yt/geometry/oct_container.pyx":625
12507  *         return cont.n_assigned - initial + nb
12508  *
12509  *     def allocate_domains(self, domain_counts):             # <<<<<<<<<<<<<<
12510  *         cdef int count, i
12511  *         self.num_domains = len(domain_counts) # 1-indexed
12512  */
12513 
12514 /* Python wrapper */
12515 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains(PyObject * __pyx_v_self,PyObject * __pyx_v_domain_counts)12516 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domain_counts) {
12517   PyObject *__pyx_r = 0;
12518   __Pyx_RefNannyDeclarations
12519   __Pyx_RefNannySetupContext("allocate_domains (wrapper)", 0);
12520   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_domain_counts));
12521 
12522   /* function exit code */
12523   __Pyx_RefNannyFinishContext();
12524   return __pyx_r;
12525 }
12526 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_domain_counts)12527 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_30allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts) {
12528   int __pyx_v_count;
12529   CYTHON_UNUSED int __pyx_v_i;
12530   PyObject *__pyx_r = NULL;
12531   __Pyx_RefNannyDeclarations
12532   Py_ssize_t __pyx_t_1;
12533   int __pyx_t_2;
12534   PyObject *__pyx_t_3 = NULL;
12535   PyObject *(*__pyx_t_4)(PyObject *);
12536   PyObject *__pyx_t_5 = NULL;
12537   int __pyx_t_6;
12538   int __pyx_t_7;
12539   __Pyx_RefNannySetupContext("allocate_domains", 0);
12540 
12541   /* "yt/geometry/oct_container.pyx":627
12542  *     def allocate_domains(self, domain_counts):
12543  *         cdef int count, i
12544  *         self.num_domains = len(domain_counts) # 1-indexed             # <<<<<<<<<<<<<<
12545  *         for i, count in enumerate(domain_counts):
12546  *             self.domains.append(count)
12547  */
12548   __pyx_t_1 = PyObject_Length(__pyx_v_domain_counts); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 627, __pyx_L1_error)
12549   __pyx_v_self->num_domains = __pyx_t_1;
12550 
12551   /* "yt/geometry/oct_container.pyx":628
12552  *         cdef int count, i
12553  *         self.num_domains = len(domain_counts) # 1-indexed
12554  *         for i, count in enumerate(domain_counts):             # <<<<<<<<<<<<<<
12555  *             self.domains.append(count)
12556  *
12557  */
12558   __pyx_t_2 = 0;
12559   if (likely(PyList_CheckExact(__pyx_v_domain_counts)) || PyTuple_CheckExact(__pyx_v_domain_counts)) {
12560     __pyx_t_3 = __pyx_v_domain_counts; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
12561     __pyx_t_4 = NULL;
12562   } else {
12563     __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domain_counts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
12564     __Pyx_GOTREF(__pyx_t_3);
12565     __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error)
12566   }
12567   for (;;) {
12568     if (likely(!__pyx_t_4)) {
12569       if (likely(PyList_CheckExact(__pyx_t_3))) {
12570         if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
12571         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12572         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
12573         #else
12574         __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error)
12575         __Pyx_GOTREF(__pyx_t_5);
12576         #endif
12577       } else {
12578         if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
12579         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12580         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 628, __pyx_L1_error)
12581         #else
12582         __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error)
12583         __Pyx_GOTREF(__pyx_t_5);
12584         #endif
12585       }
12586     } else {
12587       __pyx_t_5 = __pyx_t_4(__pyx_t_3);
12588       if (unlikely(!__pyx_t_5)) {
12589         PyObject* exc_type = PyErr_Occurred();
12590         if (exc_type) {
12591           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12592           else __PYX_ERR(0, 628, __pyx_L1_error)
12593         }
12594         break;
12595       }
12596       __Pyx_GOTREF(__pyx_t_5);
12597     }
12598     __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error)
12599     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12600     __pyx_v_count = __pyx_t_6;
12601     __pyx_v_i = __pyx_t_2;
12602     __pyx_t_2 = (__pyx_t_2 + 1);
12603 
12604     /* "yt/geometry/oct_container.pyx":629
12605  *         self.num_domains = len(domain_counts) # 1-indexed
12606  *         for i, count in enumerate(domain_counts):
12607  *             self.domains.append(count)             # <<<<<<<<<<<<<<
12608  *
12609  *     cdef void append_domain(self, np.int64_t domain_count):
12610  */
12611     __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
12612     __Pyx_GOTREF(__pyx_t_5);
12613     __pyx_t_7 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->domains), __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 629, __pyx_L1_error)
12614     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12615 
12616     /* "yt/geometry/oct_container.pyx":628
12617  *         cdef int count, i
12618  *         self.num_domains = len(domain_counts) # 1-indexed
12619  *         for i, count in enumerate(domain_counts):             # <<<<<<<<<<<<<<
12620  *             self.domains.append(count)
12621  *
12622  */
12623   }
12624   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12625 
12626   /* "yt/geometry/oct_container.pyx":625
12627  *         return cont.n_assigned - initial + nb
12628  *
12629  *     def allocate_domains(self, domain_counts):             # <<<<<<<<<<<<<<
12630  *         cdef int count, i
12631  *         self.num_domains = len(domain_counts) # 1-indexed
12632  */
12633 
12634   /* function exit code */
12635   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12636   goto __pyx_L0;
12637   __pyx_L1_error:;
12638   __Pyx_XDECREF(__pyx_t_3);
12639   __Pyx_XDECREF(__pyx_t_5);
12640   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.allocate_domains", __pyx_clineno, __pyx_lineno, __pyx_filename);
12641   __pyx_r = NULL;
12642   __pyx_L0:;
12643   __Pyx_XGIVEREF(__pyx_r);
12644   __Pyx_RefNannyFinishContext();
12645   return __pyx_r;
12646 }
12647 
12648 /* "yt/geometry/oct_container.pyx":631
12649  *             self.domains.append(count)
12650  *
12651  *     cdef void append_domain(self, np.int64_t domain_count):             # <<<<<<<<<<<<<<
12652  *         self.num_domains += 1
12653  *         self.domains.append(domain_count)
12654  */
12655 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_domain_count)12656 static void __pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_domain_count) {
12657   __Pyx_RefNannyDeclarations
12658   PyObject *__pyx_t_1 = NULL;
12659   int __pyx_t_2;
12660   __Pyx_RefNannySetupContext("append_domain", 0);
12661 
12662   /* "yt/geometry/oct_container.pyx":632
12663  *
12664  *     cdef void append_domain(self, np.int64_t domain_count):
12665  *         self.num_domains += 1             # <<<<<<<<<<<<<<
12666  *         self.domains.append(domain_count)
12667  *
12668  */
12669   __pyx_v_self->num_domains = (__pyx_v_self->num_domains + 1);
12670 
12671   /* "yt/geometry/oct_container.pyx":633
12672  *     cdef void append_domain(self, np.int64_t domain_count):
12673  *         self.num_domains += 1
12674  *         self.domains.append(domain_count)             # <<<<<<<<<<<<<<
12675  *
12676  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
12677  */
12678   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_domain_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
12679   __Pyx_GOTREF(__pyx_t_1);
12680   __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->domains), __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error)
12681   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12682 
12683   /* "yt/geometry/oct_container.pyx":631
12684  *             self.domains.append(count)
12685  *
12686  *     cdef void append_domain(self, np.int64_t domain_count):             # <<<<<<<<<<<<<<
12687  *         self.num_domains += 1
12688  *         self.domains.append(domain_count)
12689  */
12690 
12691   /* function exit code */
12692   goto __pyx_L0;
12693   __pyx_L1_error:;
12694   __Pyx_XDECREF(__pyx_t_1);
12695   __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.append_domain", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12696   __pyx_L0:;
12697   __Pyx_RefNannyFinishContext();
12698 }
12699 
12700 /* "yt/geometry/oct_container.pyx":635
12701  *         self.domains.append(domain_count)
12702  *
12703  *     cdef Oct* next_root(self, int domain_id, int ind[3]):             # <<<<<<<<<<<<<<
12704  *         cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]]
12705  *         if next != NULL: return next
12706  */
12707 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int __pyx_v_domain_id,int * __pyx_v_ind)12708 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind) {
12709   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_next;
12710   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cont;
12711   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_r;
12712   __Pyx_RefNannyDeclarations
12713   int __pyx_t_1;
12714   __Pyx_RefNannySetupContext("next_root", 0);
12715 
12716   /* "yt/geometry/oct_container.pyx":636
12717  *
12718  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
12719  *         cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]]             # <<<<<<<<<<<<<<
12720  *         if next != NULL: return next
12721  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12722  */
12723   __pyx_v_next = (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]);
12724 
12725   /* "yt/geometry/oct_container.pyx":637
12726  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
12727  *         cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]]
12728  *         if next != NULL: return next             # <<<<<<<<<<<<<<
12729  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12730  *         if cont.n_assigned >= cont.n: raise RuntimeError
12731  */
12732   __pyx_t_1 = ((__pyx_v_next != NULL) != 0);
12733   if (__pyx_t_1) {
12734     __pyx_r = __pyx_v_next;
12735     goto __pyx_L0;
12736   }
12737 
12738   /* "yt/geometry/oct_container.pyx":638
12739  *         cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]]
12740  *         if next != NULL: return next
12741  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)             # <<<<<<<<<<<<<<
12742  *         if cont.n_assigned >= cont.n: raise RuntimeError
12743  *         next = &cont.my_objs[cont.n_assigned]
12744  */
12745   __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_domain_id - 1));
12746 
12747   /* "yt/geometry/oct_container.pyx":639
12748  *         if next != NULL: return next
12749  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12750  *         if cont.n_assigned >= cont.n: raise RuntimeError             # <<<<<<<<<<<<<<
12751  *         next = &cont.my_objs[cont.n_assigned]
12752  *         cont.n_assigned += 1
12753  */
12754   __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0);
12755   if (unlikely(__pyx_t_1)) {
12756     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
12757     __PYX_ERR(0, 639, __pyx_L1_error)
12758   }
12759 
12760   /* "yt/geometry/oct_container.pyx":640
12761  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12762  *         if cont.n_assigned >= cont.n: raise RuntimeError
12763  *         next = &cont.my_objs[cont.n_assigned]             # <<<<<<<<<<<<<<
12764  *         cont.n_assigned += 1
12765  *         self.root_mesh[ind[0]][ind[1]][ind[2]] = next
12766  */
12767   __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned]));
12768 
12769   /* "yt/geometry/oct_container.pyx":641
12770  *         if cont.n_assigned >= cont.n: raise RuntimeError
12771  *         next = &cont.my_objs[cont.n_assigned]
12772  *         cont.n_assigned += 1             # <<<<<<<<<<<<<<
12773  *         self.root_mesh[ind[0]][ind[1]][ind[2]] = next
12774  *         self.nocts += 1
12775  */
12776   __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1);
12777 
12778   /* "yt/geometry/oct_container.pyx":642
12779  *         next = &cont.my_objs[cont.n_assigned]
12780  *         cont.n_assigned += 1
12781  *         self.root_mesh[ind[0]][ind[1]][ind[2]] = next             # <<<<<<<<<<<<<<
12782  *         self.nocts += 1
12783  *         return next
12784  */
12785   (((__pyx_v_self->root_mesh[(__pyx_v_ind[0])])[(__pyx_v_ind[1])])[(__pyx_v_ind[2])]) = __pyx_v_next;
12786 
12787   /* "yt/geometry/oct_container.pyx":643
12788  *         cont.n_assigned += 1
12789  *         self.root_mesh[ind[0]][ind[1]][ind[2]] = next
12790  *         self.nocts += 1             # <<<<<<<<<<<<<<
12791  *         return next
12792  *
12793  */
12794   __pyx_v_self->nocts = (__pyx_v_self->nocts + 1);
12795 
12796   /* "yt/geometry/oct_container.pyx":644
12797  *         self.root_mesh[ind[0]][ind[1]][ind[2]] = next
12798  *         self.nocts += 1
12799  *         return next             # <<<<<<<<<<<<<<
12800  *
12801  *     cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent) except? NULL:
12802  */
12803   __pyx_r = __pyx_v_next;
12804   goto __pyx_L0;
12805 
12806   /* "yt/geometry/oct_container.pyx":635
12807  *         self.domains.append(domain_count)
12808  *
12809  *     cdef Oct* next_root(self, int domain_id, int ind[3]):             # <<<<<<<<<<<<<<
12810  *         cdef Oct *next = self.root_mesh[ind[0]][ind[1]][ind[2]]
12811  *         if next != NULL: return next
12812  */
12813 
12814   /* function exit code */
12815   __pyx_L1_error:;
12816   __Pyx_WriteUnraisable("yt.geometry.oct_container.OctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
12817   __pyx_r = 0;
12818   __pyx_L0:;
12819   __Pyx_RefNannyFinishContext();
12820   return __pyx_r;
12821 }
12822 
12823 /* "yt/geometry/oct_container.pyx":646
12824  *         return next
12825  *
12826  *     cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent) except? NULL:             # <<<<<<<<<<<<<<
12827  *         cdef int i
12828  *         cdef Oct *next = NULL
12829  */
12830 
__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_child(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int __pyx_v_domain_id,int * __pyx_v_ind,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct * __pyx_v_parent)12831 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_child(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_parent) {
12832   int __pyx_v_i;
12833   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_next;
12834   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cont;
12835   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_r;
12836   __Pyx_RefNannyDeclarations
12837   int __pyx_t_1;
12838   int __pyx_t_2;
12839   __Pyx_RefNannySetupContext("next_child", 0);
12840 
12841   /* "yt/geometry/oct_container.pyx":648
12842  *     cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent) except? NULL:
12843  *         cdef int i
12844  *         cdef Oct *next = NULL             # <<<<<<<<<<<<<<
12845  *         if parent.children != NULL:
12846  *             next = parent.children[cind(ind[0],ind[1],ind[2])]
12847  */
12848   __pyx_v_next = NULL;
12849 
12850   /* "yt/geometry/oct_container.pyx":649
12851  *         cdef int i
12852  *         cdef Oct *next = NULL
12853  *         if parent.children != NULL:             # <<<<<<<<<<<<<<
12854  *             next = parent.children[cind(ind[0],ind[1],ind[2])]
12855  *         else:
12856  */
12857   __pyx_t_1 = ((__pyx_v_parent->children != NULL) != 0);
12858   if (__pyx_t_1) {
12859 
12860     /* "yt/geometry/oct_container.pyx":650
12861  *         cdef Oct *next = NULL
12862  *         if parent.children != NULL:
12863  *             next = parent.children[cind(ind[0],ind[1],ind[2])]             # <<<<<<<<<<<<<<
12864  *         else:
12865  *             # This *8 does NOT need to be made generic.
12866  */
12867     __pyx_v_next = (__pyx_v_parent->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]);
12868 
12869     /* "yt/geometry/oct_container.pyx":649
12870  *         cdef int i
12871  *         cdef Oct *next = NULL
12872  *         if parent.children != NULL:             # <<<<<<<<<<<<<<
12873  *             next = parent.children[cind(ind[0],ind[1],ind[2])]
12874  *         else:
12875  */
12876     goto __pyx_L3;
12877   }
12878 
12879   /* "yt/geometry/oct_container.pyx":653
12880  *         else:
12881  *             # This *8 does NOT need to be made generic.
12882  *             parent.children = <Oct **> malloc(sizeof(Oct *) * 8)             # <<<<<<<<<<<<<<
12883  *             for i in range(8):
12884  *                 parent.children[i] = NULL
12885  */
12886   /*else*/ {
12887     __pyx_v_parent->children = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)) * 8)));
12888 
12889     /* "yt/geometry/oct_container.pyx":654
12890  *             # This *8 does NOT need to be made generic.
12891  *             parent.children = <Oct **> malloc(sizeof(Oct *) * 8)
12892  *             for i in range(8):             # <<<<<<<<<<<<<<
12893  *                 parent.children[i] = NULL
12894  *         if next != NULL: return next
12895  */
12896     for (__pyx_t_2 = 0; __pyx_t_2 < 8; __pyx_t_2+=1) {
12897       __pyx_v_i = __pyx_t_2;
12898 
12899       /* "yt/geometry/oct_container.pyx":655
12900  *             parent.children = <Oct **> malloc(sizeof(Oct *) * 8)
12901  *             for i in range(8):
12902  *                 parent.children[i] = NULL             # <<<<<<<<<<<<<<
12903  *         if next != NULL: return next
12904  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12905  */
12906       (__pyx_v_parent->children[__pyx_v_i]) = NULL;
12907     }
12908   }
12909   __pyx_L3:;
12910 
12911   /* "yt/geometry/oct_container.pyx":656
12912  *             for i in range(8):
12913  *                 parent.children[i] = NULL
12914  *         if next != NULL: return next             # <<<<<<<<<<<<<<
12915  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12916  *         if cont.n_assigned >= cont.n: raise RuntimeError
12917  */
12918   __pyx_t_1 = ((__pyx_v_next != NULL) != 0);
12919   if (__pyx_t_1) {
12920     __pyx_r = __pyx_v_next;
12921     goto __pyx_L0;
12922   }
12923 
12924   /* "yt/geometry/oct_container.pyx":657
12925  *                 parent.children[i] = NULL
12926  *         if next != NULL: return next
12927  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)             # <<<<<<<<<<<<<<
12928  *         if cont.n_assigned >= cont.n: raise RuntimeError
12929  *         next = &cont.my_objs[cont.n_assigned]
12930  */
12931   __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->domains, (__pyx_v_domain_id - 1));
12932 
12933   /* "yt/geometry/oct_container.pyx":658
12934  *         if next != NULL: return next
12935  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12936  *         if cont.n_assigned >= cont.n: raise RuntimeError             # <<<<<<<<<<<<<<
12937  *         next = &cont.my_objs[cont.n_assigned]
12938  *         cont.n_assigned += 1
12939  */
12940   __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0);
12941   if (unlikely(__pyx_t_1)) {
12942     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
12943     __PYX_ERR(0, 658, __pyx_L1_error)
12944   }
12945 
12946   /* "yt/geometry/oct_container.pyx":659
12947  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
12948  *         if cont.n_assigned >= cont.n: raise RuntimeError
12949  *         next = &cont.my_objs[cont.n_assigned]             # <<<<<<<<<<<<<<
12950  *         cont.n_assigned += 1
12951  *         parent.children[cind(ind[0],ind[1],ind[2])] = next
12952  */
12953   __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned]));
12954 
12955   /* "yt/geometry/oct_container.pyx":660
12956  *         if cont.n_assigned >= cont.n: raise RuntimeError
12957  *         next = &cont.my_objs[cont.n_assigned]
12958  *         cont.n_assigned += 1             # <<<<<<<<<<<<<<
12959  *         parent.children[cind(ind[0],ind[1],ind[2])] = next
12960  *         self.nocts += 1
12961  */
12962   __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1);
12963 
12964   /* "yt/geometry/oct_container.pyx":661
12965  *         next = &cont.my_objs[cont.n_assigned]
12966  *         cont.n_assigned += 1
12967  *         parent.children[cind(ind[0],ind[1],ind[2])] = next             # <<<<<<<<<<<<<<
12968  *         self.nocts += 1
12969  *         return next
12970  */
12971   (__pyx_v_parent->children[__pyx_f_2yt_8geometry_12oct_visitors_cind((__pyx_v_ind[0]), (__pyx_v_ind[1]), (__pyx_v_ind[2]))]) = __pyx_v_next;
12972 
12973   /* "yt/geometry/oct_container.pyx":662
12974  *         cont.n_assigned += 1
12975  *         parent.children[cind(ind[0],ind[1],ind[2])] = next
12976  *         self.nocts += 1             # <<<<<<<<<<<<<<
12977  *         return next
12978  *
12979  */
12980   __pyx_v_self->nocts = (__pyx_v_self->nocts + 1);
12981 
12982   /* "yt/geometry/oct_container.pyx":663
12983  *         parent.children[cind(ind[0],ind[1],ind[2])] = next
12984  *         self.nocts += 1
12985  *         return next             # <<<<<<<<<<<<<<
12986  *
12987  *     def file_index_octs(self, SelectorObject selector, int domain_id,
12988  */
12989   __pyx_r = __pyx_v_next;
12990   goto __pyx_L0;
12991 
12992   /* "yt/geometry/oct_container.pyx":646
12993  *         return next
12994  *
12995  *     cdef Oct* next_child(self, int domain_id, int ind[3], Oct *parent) except? NULL:             # <<<<<<<<<<<<<<
12996  *         cdef int i
12997  *         cdef Oct *next = NULL
12998  */
12999 
13000   /* function exit code */
13001   __pyx_L1_error:;
13002   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.next_child", __pyx_clineno, __pyx_lineno, __pyx_filename);
13003   __pyx_r = NULL;
13004   __pyx_L0:;
13005   __Pyx_RefNannyFinishContext();
13006   return __pyx_r;
13007 }
13008 
13009 /* "yt/geometry/oct_container.pyx":665
13010  *         return next
13011  *
13012  *     def file_index_octs(self, SelectorObject selector, int domain_id,             # <<<<<<<<<<<<<<
13013  *                         num_cells = -1):
13014  *         # We create oct arrays of the correct size
13015  */
13016 
13017 /* Python wrapper */
13018 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13019 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13020   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
13021   int __pyx_v_domain_id;
13022   PyObject *__pyx_v_num_cells = 0;
13023   PyObject *__pyx_r = 0;
13024   __Pyx_RefNannyDeclarations
13025   __Pyx_RefNannySetupContext("file_index_octs (wrapper)", 0);
13026   {
13027     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_domain_id,&__pyx_n_s_num_cells,0};
13028     PyObject* values[3] = {0,0,0};
13029     values[2] = ((PyObject *)__pyx_int_neg_1);
13030     if (unlikely(__pyx_kwds)) {
13031       Py_ssize_t kw_args;
13032       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13033       switch (pos_args) {
13034         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13035         CYTHON_FALLTHROUGH;
13036         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13037         CYTHON_FALLTHROUGH;
13038         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13039         CYTHON_FALLTHROUGH;
13040         case  0: break;
13041         default: goto __pyx_L5_argtuple_error;
13042       }
13043       kw_args = PyDict_Size(__pyx_kwds);
13044       switch (pos_args) {
13045         case  0:
13046         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
13047         else goto __pyx_L5_argtuple_error;
13048         CYTHON_FALLTHROUGH;
13049         case  1:
13050         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--;
13051         else {
13052           __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, 1); __PYX_ERR(0, 665, __pyx_L3_error)
13053         }
13054         CYTHON_FALLTHROUGH;
13055         case  2:
13056         if (kw_args > 0) {
13057           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
13058           if (value) { values[2] = value; kw_args--; }
13059         }
13060       }
13061       if (unlikely(kw_args > 0)) {
13062         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_index_octs") < 0)) __PYX_ERR(0, 665, __pyx_L3_error)
13063       }
13064     } else {
13065       switch (PyTuple_GET_SIZE(__pyx_args)) {
13066         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13067         CYTHON_FALLTHROUGH;
13068         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13069         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13070         break;
13071         default: goto __pyx_L5_argtuple_error;
13072       }
13073     }
13074     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
13075     __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L3_error)
13076     __pyx_v_num_cells = values[2];
13077   }
13078   goto __pyx_L4_argument_unpacking_done;
13079   __pyx_L5_argtuple_error:;
13080   __Pyx_RaiseArgtupleInvalid("file_index_octs", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 665, __pyx_L3_error)
13081   __pyx_L3_error:;
13082   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.file_index_octs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13083   __Pyx_RefNannyFinishContext();
13084   return NULL;
13085   __pyx_L4_argument_unpacking_done:;
13086   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 665, __pyx_L1_error)
13087   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id, __pyx_v_num_cells);
13088 
13089   /* function exit code */
13090   goto __pyx_L0;
13091   __pyx_L1_error:;
13092   __pyx_r = NULL;
13093   __pyx_L0:;
13094   __Pyx_RefNannyFinishContext();
13095   return __pyx_r;
13096 }
13097 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,int __pyx_v_domain_id,PyObject * __pyx_v_num_cells)13098 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_32file_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells) {
13099   PyArrayObject *__pyx_v_levels = 0;
13100   PyArrayObject *__pyx_v_cell_inds = 0;
13101   PyArrayObject *__pyx_v_file_inds = 0;
13102   struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_v_visitor_o = 0;
13103   struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_v_visitor_r = 0;
13104   PyObject *__pyx_v_visitor = NULL;
13105   __Pyx_LocalBuf_ND __pyx_pybuffernd_cell_inds;
13106   __Pyx_Buffer __pyx_pybuffer_cell_inds;
13107   __Pyx_LocalBuf_ND __pyx_pybuffernd_file_inds;
13108   __Pyx_Buffer __pyx_pybuffer_file_inds;
13109   __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
13110   __Pyx_Buffer __pyx_pybuffer_levels;
13111   PyObject *__pyx_r = NULL;
13112   __Pyx_RefNannyDeclarations
13113   PyObject *__pyx_t_1 = NULL;
13114   int __pyx_t_2;
13115   PyObject *__pyx_t_3 = NULL;
13116   PyObject *__pyx_t_4 = NULL;
13117   PyObject *__pyx_t_5 = NULL;
13118   int __pyx_t_6;
13119   PyObject *__pyx_t_7 = NULL;
13120   PyArrayObject *__pyx_t_8 = NULL;
13121   PyObject *__pyx_t_9 = NULL;
13122   PyObject *__pyx_t_10 = NULL;
13123   PyObject *__pyx_t_11 = NULL;
13124   PyArrayObject *__pyx_t_12 = NULL;
13125   PyArrayObject *__pyx_t_13 = NULL;
13126   __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
13127   __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
13128   __Pyx_RefNannySetupContext("file_index_octs", 0);
13129   __Pyx_INCREF(__pyx_v_num_cells);
13130   __pyx_pybuffer_levels.pybuffer.buf = NULL;
13131   __pyx_pybuffer_levels.refcount = 0;
13132   __pyx_pybuffernd_levels.data = NULL;
13133   __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
13134   __pyx_pybuffer_cell_inds.pybuffer.buf = NULL;
13135   __pyx_pybuffer_cell_inds.refcount = 0;
13136   __pyx_pybuffernd_cell_inds.data = NULL;
13137   __pyx_pybuffernd_cell_inds.rcbuffer = &__pyx_pybuffer_cell_inds;
13138   __pyx_pybuffer_file_inds.pybuffer.buf = NULL;
13139   __pyx_pybuffer_file_inds.refcount = 0;
13140   __pyx_pybuffernd_file_inds.data = NULL;
13141   __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds;
13142 
13143   /* "yt/geometry/oct_container.pyx":672
13144  *         cdef np.ndarray[np.uint8_t, ndim=1] cell_inds
13145  *         cdef np.ndarray[np.int64_t, ndim=1] file_inds
13146  *         if num_cells < 0:             # <<<<<<<<<<<<<<
13147  *             num_cells = selector.count_oct_cells(self, domain_id)
13148  *         # Initialize variables with dummy values
13149  */
13150   __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_cells, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
13151   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
13152   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13153   if (__pyx_t_2) {
13154 
13155     /* "yt/geometry/oct_container.pyx":673
13156  *         cdef np.ndarray[np.int64_t, ndim=1] file_inds
13157  *         if num_cells < 0:
13158  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
13159  *         # Initialize variables with dummy values
13160  *         levels = np.full(num_cells, 255, dtype="uint8")
13161  */
13162     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error)
13163     __Pyx_GOTREF(__pyx_t_3);
13164     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error)
13165     __Pyx_GOTREF(__pyx_t_4);
13166     __pyx_t_5 = NULL;
13167     __pyx_t_6 = 0;
13168     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13169       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
13170       if (likely(__pyx_t_5)) {
13171         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13172         __Pyx_INCREF(__pyx_t_5);
13173         __Pyx_INCREF(function);
13174         __Pyx_DECREF_SET(__pyx_t_3, function);
13175         __pyx_t_6 = 1;
13176       }
13177     }
13178     #if CYTHON_FAST_PYCALL
13179     if (PyFunction_Check(__pyx_t_3)) {
13180       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
13181       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
13182       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13183       __Pyx_GOTREF(__pyx_t_1);
13184       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13185     } else
13186     #endif
13187     #if CYTHON_FAST_PYCCALL
13188     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13189       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
13190       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
13191       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13192       __Pyx_GOTREF(__pyx_t_1);
13193       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13194     } else
13195     #endif
13196     {
13197       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L1_error)
13198       __Pyx_GOTREF(__pyx_t_7);
13199       if (__pyx_t_5) {
13200         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13201       }
13202       __Pyx_INCREF(((PyObject *)__pyx_v_self));
13203       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13204       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
13205       __Pyx_GIVEREF(__pyx_t_4);
13206       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
13207       __pyx_t_4 = 0;
13208       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
13209       __Pyx_GOTREF(__pyx_t_1);
13210       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13211     }
13212     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13213     __Pyx_DECREF_SET(__pyx_v_num_cells, __pyx_t_1);
13214     __pyx_t_1 = 0;
13215 
13216     /* "yt/geometry/oct_container.pyx":672
13217  *         cdef np.ndarray[np.uint8_t, ndim=1] cell_inds
13218  *         cdef np.ndarray[np.int64_t, ndim=1] file_inds
13219  *         if num_cells < 0:             # <<<<<<<<<<<<<<
13220  *             num_cells = selector.count_oct_cells(self, domain_id)
13221  *         # Initialize variables with dummy values
13222  */
13223   }
13224 
13225   /* "yt/geometry/oct_container.pyx":675
13226  *             num_cells = selector.count_oct_cells(self, domain_id)
13227  *         # Initialize variables with dummy values
13228  *         levels = np.full(num_cells, 255, dtype="uint8")             # <<<<<<<<<<<<<<
13229  *         file_inds = np.full(num_cells, -1, dtype="int64")
13230  *         cell_inds = np.full(num_cells, 8, dtype="uint8")
13231  */
13232   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
13233   __Pyx_GOTREF(__pyx_t_1);
13234   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
13235   __Pyx_GOTREF(__pyx_t_3);
13236   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13237   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
13238   __Pyx_GOTREF(__pyx_t_1);
13239   __Pyx_INCREF(__pyx_v_num_cells);
13240   __Pyx_GIVEREF(__pyx_v_num_cells);
13241   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_num_cells);
13242   __Pyx_INCREF(__pyx_int_255);
13243   __Pyx_GIVEREF(__pyx_int_255);
13244   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_255);
13245   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
13246   __Pyx_GOTREF(__pyx_t_7);
13247   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 675, __pyx_L1_error)
13248   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
13249   __Pyx_GOTREF(__pyx_t_4);
13250   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13251   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13252   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13253   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 675, __pyx_L1_error)
13254   __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
13255   {
13256     __Pyx_BufFmt_StackElem __pyx_stack[1];
13257     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
13258     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
13259     if (unlikely(__pyx_t_6 < 0)) {
13260       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
13261       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
13262         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
13263         __Pyx_RaiseBufferFallbackError();
13264       } else {
13265         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13266       }
13267       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
13268     }
13269     __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0];
13270     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 675, __pyx_L1_error)
13271   }
13272   __pyx_t_8 = 0;
13273   __pyx_v_levels = ((PyArrayObject *)__pyx_t_4);
13274   __pyx_t_4 = 0;
13275 
13276   /* "yt/geometry/oct_container.pyx":676
13277  *         # Initialize variables with dummy values
13278  *         levels = np.full(num_cells, 255, dtype="uint8")
13279  *         file_inds = np.full(num_cells, -1, dtype="int64")             # <<<<<<<<<<<<<<
13280  *         cell_inds = np.full(num_cells, 8, dtype="uint8")
13281  *         cdef oct_visitors.FillFileIndicesO visitor_o
13282  */
13283   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
13284   __Pyx_GOTREF(__pyx_t_4);
13285   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_full); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 676, __pyx_L1_error)
13286   __Pyx_GOTREF(__pyx_t_7);
13287   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13288   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error)
13289   __Pyx_GOTREF(__pyx_t_4);
13290   __Pyx_INCREF(__pyx_v_num_cells);
13291   __Pyx_GIVEREF(__pyx_v_num_cells);
13292   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_num_cells);
13293   __Pyx_INCREF(__pyx_int_neg_1);
13294   __Pyx_GIVEREF(__pyx_int_neg_1);
13295   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
13296   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
13297   __Pyx_GOTREF(__pyx_t_1);
13298   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 676, __pyx_L1_error)
13299   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
13300   __Pyx_GOTREF(__pyx_t_3);
13301   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13302   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13303   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13304   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 676, __pyx_L1_error)
13305   __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
13306   {
13307     __Pyx_BufFmt_StackElem __pyx_stack[1];
13308     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
13309     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
13310     if (unlikely(__pyx_t_6 < 0)) {
13311       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
13312       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
13313         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
13314         __Pyx_RaiseBufferFallbackError();
13315       } else {
13316         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
13317       }
13318       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
13319     }
13320     __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0];
13321     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 676, __pyx_L1_error)
13322   }
13323   __pyx_t_12 = 0;
13324   __pyx_v_file_inds = ((PyArrayObject *)__pyx_t_3);
13325   __pyx_t_3 = 0;
13326 
13327   /* "yt/geometry/oct_container.pyx":677
13328  *         levels = np.full(num_cells, 255, dtype="uint8")
13329  *         file_inds = np.full(num_cells, -1, dtype="int64")
13330  *         cell_inds = np.full(num_cells, 8, dtype="uint8")             # <<<<<<<<<<<<<<
13331  *         cdef oct_visitors.FillFileIndicesO visitor_o
13332  *         cdef oct_visitors.FillFileIndicesR visitor_r
13333  */
13334   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
13335   __Pyx_GOTREF(__pyx_t_3);
13336   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
13337   __Pyx_GOTREF(__pyx_t_1);
13338   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13339   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
13340   __Pyx_GOTREF(__pyx_t_3);
13341   __Pyx_INCREF(__pyx_v_num_cells);
13342   __Pyx_GIVEREF(__pyx_v_num_cells);
13343   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_num_cells);
13344   __Pyx_INCREF(__pyx_int_8);
13345   __Pyx_GIVEREF(__pyx_int_8);
13346   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_8);
13347   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
13348   __Pyx_GOTREF(__pyx_t_4);
13349   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 677, __pyx_L1_error)
13350   __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error)
13351   __Pyx_GOTREF(__pyx_t_7);
13352   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13353   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13354   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13355   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 677, __pyx_L1_error)
13356   __pyx_t_13 = ((PyArrayObject *)__pyx_t_7);
13357   {
13358     __Pyx_BufFmt_StackElem __pyx_stack[1];
13359     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
13360     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
13361     if (unlikely(__pyx_t_6 < 0)) {
13362       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
13363       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
13364         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
13365         __Pyx_RaiseBufferFallbackError();
13366       } else {
13367         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
13368       }
13369       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
13370     }
13371     __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0];
13372     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 677, __pyx_L1_error)
13373   }
13374   __pyx_t_13 = 0;
13375   __pyx_v_cell_inds = ((PyArrayObject *)__pyx_t_7);
13376   __pyx_t_7 = 0;
13377 
13378   /* "yt/geometry/oct_container.pyx":680
13379  *         cdef oct_visitors.FillFileIndicesO visitor_o
13380  *         cdef oct_visitors.FillFileIndicesR visitor_r
13381  *         if self.fill_style == "r":             # <<<<<<<<<<<<<<
13382  *             visitor_r = oct_visitors.FillFileIndicesR(self, domain_id)
13383  *             visitor_r.levels = levels
13384  */
13385   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
13386   if (__pyx_t_2) {
13387 
13388     /* "yt/geometry/oct_container.pyx":681
13389  *         cdef oct_visitors.FillFileIndicesR visitor_r
13390  *         if self.fill_style == "r":
13391  *             visitor_r = oct_visitors.FillFileIndicesR(self, domain_id)             # <<<<<<<<<<<<<<
13392  *             visitor_r.levels = levels
13393  *             visitor_r.file_inds = file_inds
13394  */
13395     __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
13396     __Pyx_GOTREF(__pyx_t_7);
13397     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error)
13398     __Pyx_GOTREF(__pyx_t_4);
13399     __Pyx_INCREF(((PyObject *)__pyx_v_self));
13400     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13401     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
13402     __Pyx_GIVEREF(__pyx_t_7);
13403     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
13404     __pyx_t_7 = 0;
13405     __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
13406     __Pyx_GOTREF(__pyx_t_7);
13407     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13408     __pyx_v_visitor_r = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR *)__pyx_t_7);
13409     __pyx_t_7 = 0;
13410 
13411     /* "yt/geometry/oct_container.pyx":682
13412  *         if self.fill_style == "r":
13413  *             visitor_r = oct_visitors.FillFileIndicesR(self, domain_id)
13414  *             visitor_r.levels = levels             # <<<<<<<<<<<<<<
13415  *             visitor_r.file_inds = file_inds
13416  *             visitor_r.cell_inds = cell_inds
13417  */
13418     __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_levels), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 682, __pyx_L1_error)
13419     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->levels, 0);
13420     __pyx_v_visitor_r->levels = __pyx_t_14;
13421     __pyx_t_14.memview = NULL;
13422     __pyx_t_14.data = NULL;
13423 
13424     /* "yt/geometry/oct_container.pyx":683
13425  *             visitor_r = oct_visitors.FillFileIndicesR(self, domain_id)
13426  *             visitor_r.levels = levels
13427  *             visitor_r.file_inds = file_inds             # <<<<<<<<<<<<<<
13428  *             visitor_r.cell_inds = cell_inds
13429  *             visitor = visitor_r
13430  */
13431     __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_file_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 683, __pyx_L1_error)
13432     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->file_inds, 0);
13433     __pyx_v_visitor_r->file_inds = __pyx_t_15;
13434     __pyx_t_15.memview = NULL;
13435     __pyx_t_15.data = NULL;
13436 
13437     /* "yt/geometry/oct_container.pyx":684
13438  *             visitor_r.levels = levels
13439  *             visitor_r.file_inds = file_inds
13440  *             visitor_r.cell_inds = cell_inds             # <<<<<<<<<<<<<<
13441  *             visitor = visitor_r
13442  *         elif self.fill_style == "o":
13443  */
13444     __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_cell_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 684, __pyx_L1_error)
13445     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_r->cell_inds, 0);
13446     __pyx_v_visitor_r->cell_inds = __pyx_t_14;
13447     __pyx_t_14.memview = NULL;
13448     __pyx_t_14.data = NULL;
13449 
13450     /* "yt/geometry/oct_container.pyx":685
13451  *             visitor_r.file_inds = file_inds
13452  *             visitor_r.cell_inds = cell_inds
13453  *             visitor = visitor_r             # <<<<<<<<<<<<<<
13454  *         elif self.fill_style == "o":
13455  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)
13456  */
13457     __Pyx_INCREF(((PyObject *)__pyx_v_visitor_r));
13458     __pyx_v_visitor = ((PyObject *)__pyx_v_visitor_r);
13459 
13460     /* "yt/geometry/oct_container.pyx":680
13461  *         cdef oct_visitors.FillFileIndicesO visitor_o
13462  *         cdef oct_visitors.FillFileIndicesR visitor_r
13463  *         if self.fill_style == "r":             # <<<<<<<<<<<<<<
13464  *             visitor_r = oct_visitors.FillFileIndicesR(self, domain_id)
13465  *             visitor_r.levels = levels
13466  */
13467     goto __pyx_L4;
13468   }
13469 
13470   /* "yt/geometry/oct_container.pyx":686
13471  *             visitor_r.cell_inds = cell_inds
13472  *             visitor = visitor_r
13473  *         elif self.fill_style == "o":             # <<<<<<<<<<<<<<
13474  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)
13475  *             visitor_o.levels = levels
13476  */
13477   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->fill_style, __pyx_n_s_o, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 686, __pyx_L1_error)
13478   if (likely(__pyx_t_2)) {
13479 
13480     /* "yt/geometry/oct_container.pyx":687
13481  *             visitor = visitor_r
13482  *         elif self.fill_style == "o":
13483  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)             # <<<<<<<<<<<<<<
13484  *             visitor_o.levels = levels
13485  *             visitor_o.file_inds = file_inds
13486  */
13487     __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error)
13488     __Pyx_GOTREF(__pyx_t_7);
13489     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
13490     __Pyx_GOTREF(__pyx_t_4);
13491     __Pyx_INCREF(((PyObject *)__pyx_v_self));
13492     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13493     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
13494     __Pyx_GIVEREF(__pyx_t_7);
13495     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
13496     __pyx_t_7 = 0;
13497     __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error)
13498     __Pyx_GOTREF(__pyx_t_7);
13499     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13500     __pyx_v_visitor_o = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO *)__pyx_t_7);
13501     __pyx_t_7 = 0;
13502 
13503     /* "yt/geometry/oct_container.pyx":688
13504  *         elif self.fill_style == "o":
13505  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)
13506  *             visitor_o.levels = levels             # <<<<<<<<<<<<<<
13507  *             visitor_o.file_inds = file_inds
13508  *             visitor_o.cell_inds = cell_inds
13509  */
13510     __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_levels), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 688, __pyx_L1_error)
13511     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->levels, 0);
13512     __pyx_v_visitor_o->levels = __pyx_t_14;
13513     __pyx_t_14.memview = NULL;
13514     __pyx_t_14.data = NULL;
13515 
13516     /* "yt/geometry/oct_container.pyx":689
13517  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)
13518  *             visitor_o.levels = levels
13519  *             visitor_o.file_inds = file_inds             # <<<<<<<<<<<<<<
13520  *             visitor_o.cell_inds = cell_inds
13521  *             visitor = visitor_o
13522  */
13523     __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_file_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 689, __pyx_L1_error)
13524     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->file_inds, 0);
13525     __pyx_v_visitor_o->file_inds = __pyx_t_15;
13526     __pyx_t_15.memview = NULL;
13527     __pyx_t_15.data = NULL;
13528 
13529     /* "yt/geometry/oct_container.pyx":690
13530  *             visitor_o.levels = levels
13531  *             visitor_o.file_inds = file_inds
13532  *             visitor_o.cell_inds = cell_inds             # <<<<<<<<<<<<<<
13533  *             visitor = visitor_o
13534  *         else:
13535  */
13536     __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_cell_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 690, __pyx_L1_error)
13537     __PYX_XDEC_MEMVIEW(&__pyx_v_visitor_o->cell_inds, 0);
13538     __pyx_v_visitor_o->cell_inds = __pyx_t_14;
13539     __pyx_t_14.memview = NULL;
13540     __pyx_t_14.data = NULL;
13541 
13542     /* "yt/geometry/oct_container.pyx":691
13543  *             visitor_o.file_inds = file_inds
13544  *             visitor_o.cell_inds = cell_inds
13545  *             visitor = visitor_o             # <<<<<<<<<<<<<<
13546  *         else:
13547  *             raise RuntimeError
13548  */
13549     __Pyx_INCREF(((PyObject *)__pyx_v_visitor_o));
13550     __pyx_v_visitor = ((PyObject *)__pyx_v_visitor_o);
13551 
13552     /* "yt/geometry/oct_container.pyx":686
13553  *             visitor_r.cell_inds = cell_inds
13554  *             visitor = visitor_r
13555  *         elif self.fill_style == "o":             # <<<<<<<<<<<<<<
13556  *             visitor_o = oct_visitors.FillFileIndicesO(self, domain_id)
13557  *             visitor_o.levels = levels
13558  */
13559     goto __pyx_L4;
13560   }
13561 
13562   /* "yt/geometry/oct_container.pyx":693
13563  *             visitor = visitor_o
13564  *         else:
13565  *             raise RuntimeError             # <<<<<<<<<<<<<<
13566  *         self.visit_all_octs(selector, visitor)
13567  *         return levels, cell_inds, file_inds
13568  */
13569   /*else*/ {
13570     __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
13571     __PYX_ERR(0, 693, __pyx_L1_error)
13572   }
13573   __pyx_L4:;
13574 
13575   /* "yt/geometry/oct_container.pyx":694
13576  *         else:
13577  *             raise RuntimeError
13578  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
13579  *         return levels, cell_inds, file_inds
13580  *
13581  */
13582   if (!(likely(__Pyx_TypeTest(__pyx_v_visitor, __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor)))) __PYX_ERR(0, 694, __pyx_L1_error)
13583   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
13584 
13585   /* "yt/geometry/oct_container.pyx":695
13586  *             raise RuntimeError
13587  *         self.visit_all_octs(selector, visitor)
13588  *         return levels, cell_inds, file_inds             # <<<<<<<<<<<<<<
13589  *
13590  *     def morton_index_octs(self, SelectorObject selector, int domain_id,
13591  */
13592   __Pyx_XDECREF(__pyx_r);
13593   __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __pyx_L1_error)
13594   __Pyx_GOTREF(__pyx_t_7);
13595   __Pyx_INCREF(((PyObject *)__pyx_v_levels));
13596   __Pyx_GIVEREF(((PyObject *)__pyx_v_levels));
13597   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_levels));
13598   __Pyx_INCREF(((PyObject *)__pyx_v_cell_inds));
13599   __Pyx_GIVEREF(((PyObject *)__pyx_v_cell_inds));
13600   PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_cell_inds));
13601   __Pyx_INCREF(((PyObject *)__pyx_v_file_inds));
13602   __Pyx_GIVEREF(((PyObject *)__pyx_v_file_inds));
13603   PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_file_inds));
13604   __pyx_r = __pyx_t_7;
13605   __pyx_t_7 = 0;
13606   goto __pyx_L0;
13607 
13608   /* "yt/geometry/oct_container.pyx":665
13609  *         return next
13610  *
13611  *     def file_index_octs(self, SelectorObject selector, int domain_id,             # <<<<<<<<<<<<<<
13612  *                         num_cells = -1):
13613  *         # We create oct arrays of the correct size
13614  */
13615 
13616   /* function exit code */
13617   __pyx_L1_error:;
13618   __Pyx_XDECREF(__pyx_t_1);
13619   __Pyx_XDECREF(__pyx_t_3);
13620   __Pyx_XDECREF(__pyx_t_4);
13621   __Pyx_XDECREF(__pyx_t_5);
13622   __Pyx_XDECREF(__pyx_t_7);
13623   __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
13624   __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
13625   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13626     __Pyx_PyThreadState_declare
13627     __Pyx_PyThreadState_assign
13628     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13629     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
13630     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
13631     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
13632   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13633   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.file_index_octs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13634   __pyx_r = NULL;
13635   goto __pyx_L2;
13636   __pyx_L0:;
13637   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
13638   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
13639   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
13640   __pyx_L2:;
13641   __Pyx_XDECREF((PyObject *)__pyx_v_levels);
13642   __Pyx_XDECREF((PyObject *)__pyx_v_cell_inds);
13643   __Pyx_XDECREF((PyObject *)__pyx_v_file_inds);
13644   __Pyx_XDECREF((PyObject *)__pyx_v_visitor_o);
13645   __Pyx_XDECREF((PyObject *)__pyx_v_visitor_r);
13646   __Pyx_XDECREF(__pyx_v_visitor);
13647   __Pyx_XDECREF(__pyx_v_num_cells);
13648   __Pyx_XGIVEREF(__pyx_r);
13649   __Pyx_RefNannyFinishContext();
13650   return __pyx_r;
13651 }
13652 
13653 /* "yt/geometry/oct_container.pyx":697
13654  *         return levels, cell_inds, file_inds
13655  *
13656  *     def morton_index_octs(self, SelectorObject selector, int domain_id,             # <<<<<<<<<<<<<<
13657  *                           num_cells = -1):
13658  *         cdef np.int64_t i
13659  */
13660 
13661 /* Python wrapper */
13662 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35morton_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35morton_index_octs(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13663 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35morton_index_octs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13664   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
13665   int __pyx_v_domain_id;
13666   PyObject *__pyx_v_num_cells = 0;
13667   PyObject *__pyx_r = 0;
13668   __Pyx_RefNannyDeclarations
13669   __Pyx_RefNannySetupContext("morton_index_octs (wrapper)", 0);
13670   {
13671     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_domain_id,&__pyx_n_s_num_cells,0};
13672     PyObject* values[3] = {0,0,0};
13673     values[2] = ((PyObject *)__pyx_int_neg_1);
13674     if (unlikely(__pyx_kwds)) {
13675       Py_ssize_t kw_args;
13676       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13677       switch (pos_args) {
13678         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13679         CYTHON_FALLTHROUGH;
13680         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13681         CYTHON_FALLTHROUGH;
13682         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13683         CYTHON_FALLTHROUGH;
13684         case  0: break;
13685         default: goto __pyx_L5_argtuple_error;
13686       }
13687       kw_args = PyDict_Size(__pyx_kwds);
13688       switch (pos_args) {
13689         case  0:
13690         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
13691         else goto __pyx_L5_argtuple_error;
13692         CYTHON_FALLTHROUGH;
13693         case  1:
13694         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--;
13695         else {
13696           __Pyx_RaiseArgtupleInvalid("morton_index_octs", 0, 2, 3, 1); __PYX_ERR(0, 697, __pyx_L3_error)
13697         }
13698         CYTHON_FALLTHROUGH;
13699         case  2:
13700         if (kw_args > 0) {
13701           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
13702           if (value) { values[2] = value; kw_args--; }
13703         }
13704       }
13705       if (unlikely(kw_args > 0)) {
13706         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "morton_index_octs") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
13707       }
13708     } else {
13709       switch (PyTuple_GET_SIZE(__pyx_args)) {
13710         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13711         CYTHON_FALLTHROUGH;
13712         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13713         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13714         break;
13715         default: goto __pyx_L5_argtuple_error;
13716       }
13717     }
13718     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
13719     __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 697, __pyx_L3_error)
13720     __pyx_v_num_cells = values[2];
13721   }
13722   goto __pyx_L4_argument_unpacking_done;
13723   __pyx_L5_argtuple_error:;
13724   __Pyx_RaiseArgtupleInvalid("morton_index_octs", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
13725   __pyx_L3_error:;
13726   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.morton_index_octs", __pyx_clineno, __pyx_lineno, __pyx_filename);
13727   __Pyx_RefNannyFinishContext();
13728   return NULL;
13729   __pyx_L4_argument_unpacking_done:;
13730   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 697, __pyx_L1_error)
13731   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34morton_index_octs(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id, __pyx_v_num_cells);
13732 
13733   /* function exit code */
13734   goto __pyx_L0;
13735   __pyx_L1_error:;
13736   __pyx_r = NULL;
13737   __pyx_L0:;
13738   __Pyx_RefNannyFinishContext();
13739   return __pyx_r;
13740 }
13741 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34morton_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,int __pyx_v_domain_id,PyObject * __pyx_v_num_cells)13742 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_34morton_index_octs(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, PyObject *__pyx_v_num_cells) {
13743   __pyx_t_5numpy_int64_t __pyx_v_i;
13744   __Pyx_memviewslice __pyx_v_levels = { 0, 0, { 0 }, { 0 }, { 0 } };
13745   __Pyx_memviewslice __pyx_v_morton_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
13746   struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts *__pyx_v_visitor = 0;
13747   PyObject *__pyx_r = NULL;
13748   __Pyx_RefNannyDeclarations
13749   PyObject *__pyx_t_1 = NULL;
13750   int __pyx_t_2;
13751   PyObject *__pyx_t_3 = NULL;
13752   PyObject *__pyx_t_4 = NULL;
13753   PyObject *__pyx_t_5 = NULL;
13754   int __pyx_t_6;
13755   PyObject *__pyx_t_7 = NULL;
13756   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
13757   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
13758   long __pyx_t_10;
13759   long __pyx_t_11;
13760   __pyx_t_5numpy_int64_t __pyx_t_12;
13761   __pyx_t_5numpy_int64_t __pyx_t_13;
13762   __pyx_t_5numpy_int64_t __pyx_t_14;
13763   __Pyx_RefNannySetupContext("morton_index_octs", 0);
13764   __Pyx_INCREF(__pyx_v_num_cells);
13765 
13766   /* "yt/geometry/oct_container.pyx":702
13767  *         cdef np.uint8_t[:] levels
13768  *         cdef np.uint64_t[:] morton_inds
13769  *         if num_cells < 0:             # <<<<<<<<<<<<<<
13770  *             num_cells = selector.count_oct_cells(self, domain_id)
13771  *         levels = np.zeros(num_cells, dtype="uint8")
13772  */
13773   __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_cells, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
13774   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
13775   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13776   if (__pyx_t_2) {
13777 
13778     /* "yt/geometry/oct_container.pyx":703
13779  *         cdef np.uint64_t[:] morton_inds
13780  *         if num_cells < 0:
13781  *             num_cells = selector.count_oct_cells(self, domain_id)             # <<<<<<<<<<<<<<
13782  *         levels = np.zeros(num_cells, dtype="uint8")
13783  *         morton_inds = np.zeros(num_cells, dtype="uint64")
13784  */
13785     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_oct_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
13786     __Pyx_GOTREF(__pyx_t_3);
13787     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
13788     __Pyx_GOTREF(__pyx_t_4);
13789     __pyx_t_5 = NULL;
13790     __pyx_t_6 = 0;
13791     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
13792       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
13793       if (likely(__pyx_t_5)) {
13794         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13795         __Pyx_INCREF(__pyx_t_5);
13796         __Pyx_INCREF(function);
13797         __Pyx_DECREF_SET(__pyx_t_3, function);
13798         __pyx_t_6 = 1;
13799       }
13800     }
13801     #if CYTHON_FAST_PYCALL
13802     if (PyFunction_Check(__pyx_t_3)) {
13803       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
13804       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
13805       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13806       __Pyx_GOTREF(__pyx_t_1);
13807       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13808     } else
13809     #endif
13810     #if CYTHON_FAST_PYCCALL
13811     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
13812       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
13813       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
13814       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13815       __Pyx_GOTREF(__pyx_t_1);
13816       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13817     } else
13818     #endif
13819     {
13820       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 703, __pyx_L1_error)
13821       __Pyx_GOTREF(__pyx_t_7);
13822       if (__pyx_t_5) {
13823         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
13824       }
13825       __Pyx_INCREF(((PyObject *)__pyx_v_self));
13826       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13827       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
13828       __Pyx_GIVEREF(__pyx_t_4);
13829       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
13830       __pyx_t_4 = 0;
13831       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
13832       __Pyx_GOTREF(__pyx_t_1);
13833       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13834     }
13835     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13836     __Pyx_DECREF_SET(__pyx_v_num_cells, __pyx_t_1);
13837     __pyx_t_1 = 0;
13838 
13839     /* "yt/geometry/oct_container.pyx":702
13840  *         cdef np.uint8_t[:] levels
13841  *         cdef np.uint64_t[:] morton_inds
13842  *         if num_cells < 0:             # <<<<<<<<<<<<<<
13843  *             num_cells = selector.count_oct_cells(self, domain_id)
13844  *         levels = np.zeros(num_cells, dtype="uint8")
13845  */
13846   }
13847 
13848   /* "yt/geometry/oct_container.pyx":704
13849  *         if num_cells < 0:
13850  *             num_cells = selector.count_oct_cells(self, domain_id)
13851  *         levels = np.zeros(num_cells, dtype="uint8")             # <<<<<<<<<<<<<<
13852  *         morton_inds = np.zeros(num_cells, dtype="uint64")
13853  *         for i in range(num_cells):
13854  */
13855   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
13856   __Pyx_GOTREF(__pyx_t_1);
13857   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
13858   __Pyx_GOTREF(__pyx_t_3);
13859   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13860   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
13861   __Pyx_GOTREF(__pyx_t_1);
13862   __Pyx_INCREF(__pyx_v_num_cells);
13863   __Pyx_GIVEREF(__pyx_v_num_cells);
13864   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_num_cells);
13865   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error)
13866   __Pyx_GOTREF(__pyx_t_7);
13867   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 704, __pyx_L1_error)
13868   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error)
13869   __Pyx_GOTREF(__pyx_t_4);
13870   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13871   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13872   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13873   __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 704, __pyx_L1_error)
13874   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13875   __pyx_v_levels = __pyx_t_8;
13876   __pyx_t_8.memview = NULL;
13877   __pyx_t_8.data = NULL;
13878 
13879   /* "yt/geometry/oct_container.pyx":705
13880  *             num_cells = selector.count_oct_cells(self, domain_id)
13881  *         levels = np.zeros(num_cells, dtype="uint8")
13882  *         morton_inds = np.zeros(num_cells, dtype="uint64")             # <<<<<<<<<<<<<<
13883  *         for i in range(num_cells):
13884  *             levels[i] = 100
13885  */
13886   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
13887   __Pyx_GOTREF(__pyx_t_4);
13888   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 705, __pyx_L1_error)
13889   __Pyx_GOTREF(__pyx_t_7);
13890   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13891   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
13892   __Pyx_GOTREF(__pyx_t_4);
13893   __Pyx_INCREF(__pyx_v_num_cells);
13894   __Pyx_GIVEREF(__pyx_v_num_cells);
13895   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_num_cells);
13896   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
13897   __Pyx_GOTREF(__pyx_t_1);
13898   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_uint64) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
13899   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
13900   __Pyx_GOTREF(__pyx_t_3);
13901   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13902   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13903   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13904   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 705, __pyx_L1_error)
13905   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13906   __pyx_v_morton_inds = __pyx_t_9;
13907   __pyx_t_9.memview = NULL;
13908   __pyx_t_9.data = NULL;
13909 
13910   /* "yt/geometry/oct_container.pyx":706
13911  *         levels = np.zeros(num_cells, dtype="uint8")
13912  *         morton_inds = np.zeros(num_cells, dtype="uint64")
13913  *         for i in range(num_cells):             # <<<<<<<<<<<<<<
13914  *             levels[i] = 100
13915  *             morton_inds[i] = 0
13916  */
13917   __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_num_cells); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L1_error)
13918   __pyx_t_11 = __pyx_t_10;
13919   for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
13920     __pyx_v_i = __pyx_t_12;
13921 
13922     /* "yt/geometry/oct_container.pyx":707
13923  *         morton_inds = np.zeros(num_cells, dtype="uint64")
13924  *         for i in range(num_cells):
13925  *             levels[i] = 100             # <<<<<<<<<<<<<<
13926  *             morton_inds[i] = 0
13927  *         cdef oct_visitors.MortonIndexOcts visitor
13928  */
13929     __pyx_t_13 = __pyx_v_i;
13930     __pyx_t_6 = -1;
13931     if (__pyx_t_13 < 0) {
13932       __pyx_t_13 += __pyx_v_levels.shape[0];
13933       if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
13934     } else if (unlikely(__pyx_t_13 >= __pyx_v_levels.shape[0])) __pyx_t_6 = 0;
13935     if (unlikely(__pyx_t_6 != -1)) {
13936       __Pyx_RaiseBufferIndexError(__pyx_t_6);
13937       __PYX_ERR(0, 707, __pyx_L1_error)
13938     }
13939     *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_13 * __pyx_v_levels.strides[0]) )) = 0x64;
13940 
13941     /* "yt/geometry/oct_container.pyx":708
13942  *         for i in range(num_cells):
13943  *             levels[i] = 100
13944  *             morton_inds[i] = 0             # <<<<<<<<<<<<<<
13945  *         cdef oct_visitors.MortonIndexOcts visitor
13946  *         visitor = oct_visitors.MortonIndexOcts(self, domain_id)
13947  */
13948     __pyx_t_14 = __pyx_v_i;
13949     __pyx_t_6 = -1;
13950     if (__pyx_t_14 < 0) {
13951       __pyx_t_14 += __pyx_v_morton_inds.shape[0];
13952       if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
13953     } else if (unlikely(__pyx_t_14 >= __pyx_v_morton_inds.shape[0])) __pyx_t_6 = 0;
13954     if (unlikely(__pyx_t_6 != -1)) {
13955       __Pyx_RaiseBufferIndexError(__pyx_t_6);
13956       __PYX_ERR(0, 708, __pyx_L1_error)
13957     }
13958     *((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_morton_inds.data + __pyx_t_14 * __pyx_v_morton_inds.strides[0]) )) = 0;
13959   }
13960 
13961   /* "yt/geometry/oct_container.pyx":710
13962  *             morton_inds[i] = 0
13963  *         cdef oct_visitors.MortonIndexOcts visitor
13964  *         visitor = oct_visitors.MortonIndexOcts(self, domain_id)             # <<<<<<<<<<<<<<
13965  *         visitor.level_arr = levels
13966  *         visitor.morton_ind = morton_inds
13967  */
13968   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
13969   __Pyx_GOTREF(__pyx_t_3);
13970   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
13971   __Pyx_GOTREF(__pyx_t_1);
13972   __Pyx_INCREF(((PyObject *)__pyx_v_self));
13973   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13974   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
13975   __Pyx_GIVEREF(__pyx_t_3);
13976   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
13977   __pyx_t_3 = 0;
13978   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
13979   __Pyx_GOTREF(__pyx_t_3);
13980   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13981   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts *)__pyx_t_3);
13982   __pyx_t_3 = 0;
13983 
13984   /* "yt/geometry/oct_container.pyx":711
13985  *         cdef oct_visitors.MortonIndexOcts visitor
13986  *         visitor = oct_visitors.MortonIndexOcts(self, domain_id)
13987  *         visitor.level_arr = levels             # <<<<<<<<<<<<<<
13988  *         visitor.morton_ind = morton_inds
13989  *         self.visit_all_octs(selector, visitor)
13990  */
13991   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->level_arr, 0);
13992   __PYX_INC_MEMVIEW(&__pyx_v_levels, 0);
13993   __pyx_v_visitor->level_arr = __pyx_v_levels;
13994 
13995   /* "yt/geometry/oct_container.pyx":712
13996  *         visitor = oct_visitors.MortonIndexOcts(self, domain_id)
13997  *         visitor.level_arr = levels
13998  *         visitor.morton_ind = morton_inds             # <<<<<<<<<<<<<<
13999  *         self.visit_all_octs(selector, visitor)
14000  *         return levels, morton_inds
14001  */
14002   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->morton_ind, 0);
14003   __PYX_INC_MEMVIEW(&__pyx_v_morton_inds, 0);
14004   __pyx_v_visitor->morton_ind = __pyx_v_morton_inds;
14005 
14006   /* "yt/geometry/oct_container.pyx":713
14007  *         visitor.level_arr = levels
14008  *         visitor.morton_ind = morton_inds
14009  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
14010  *         return levels, morton_inds
14011  *
14012  */
14013   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
14014 
14015   /* "yt/geometry/oct_container.pyx":714
14016  *         visitor.morton_ind = morton_inds
14017  *         self.visit_all_octs(selector, visitor)
14018  *         return levels, morton_inds             # <<<<<<<<<<<<<<
14019  *
14020  *     def domain_count(self, SelectorObject selector):
14021  */
14022   __Pyx_XDECREF(__pyx_r);
14023   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_levels, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
14024   __Pyx_GOTREF(__pyx_t_3);
14025   __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_morton_inds, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint64_t, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
14026   __Pyx_GOTREF(__pyx_t_1);
14027   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error)
14028   __Pyx_GOTREF(__pyx_t_4);
14029   __Pyx_GIVEREF(__pyx_t_3);
14030   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
14031   __Pyx_GIVEREF(__pyx_t_1);
14032   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
14033   __pyx_t_3 = 0;
14034   __pyx_t_1 = 0;
14035   __pyx_r = __pyx_t_4;
14036   __pyx_t_4 = 0;
14037   goto __pyx_L0;
14038 
14039   /* "yt/geometry/oct_container.pyx":697
14040  *         return levels, cell_inds, file_inds
14041  *
14042  *     def morton_index_octs(self, SelectorObject selector, int domain_id,             # <<<<<<<<<<<<<<
14043  *                           num_cells = -1):
14044  *         cdef np.int64_t i
14045  */
14046 
14047   /* function exit code */
14048   __pyx_L1_error:;
14049   __Pyx_XDECREF(__pyx_t_1);
14050   __Pyx_XDECREF(__pyx_t_3);
14051   __Pyx_XDECREF(__pyx_t_4);
14052   __Pyx_XDECREF(__pyx_t_5);
14053   __Pyx_XDECREF(__pyx_t_7);
14054   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
14055   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
14056   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.morton_index_octs", __pyx_clineno, __pyx_lineno, __pyx_filename);
14057   __pyx_r = NULL;
14058   __pyx_L0:;
14059   __PYX_XDEC_MEMVIEW(&__pyx_v_levels, 1);
14060   __PYX_XDEC_MEMVIEW(&__pyx_v_morton_inds, 1);
14061   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
14062   __Pyx_XDECREF(__pyx_v_num_cells);
14063   __Pyx_XGIVEREF(__pyx_r);
14064   __Pyx_RefNannyFinishContext();
14065   return __pyx_r;
14066 }
14067 
14068 /* "yt/geometry/oct_container.pyx":716
14069  *         return levels, morton_inds
14070  *
14071  *     def domain_count(self, SelectorObject selector):             # <<<<<<<<<<<<<<
14072  *         # We create oct arrays of the correct size
14073  *         cdef np.ndarray[np.int64_t, ndim=1] domain_counts
14074  */
14075 
14076 /* Python wrapper */
14077 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(PyObject * __pyx_v_self,PyObject * __pyx_v_selector)14078 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) {
14079   PyObject *__pyx_r = 0;
14080   __Pyx_RefNannyDeclarations
14081   __Pyx_RefNannySetupContext("domain_count (wrapper)", 0);
14082   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 716, __pyx_L1_error)
14083   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36domain_count(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector));
14084 
14085   /* function exit code */
14086   goto __pyx_L0;
14087   __pyx_L1_error:;
14088   __pyx_r = NULL;
14089   __pyx_L0:;
14090   __Pyx_RefNannyFinishContext();
14091   return __pyx_r;
14092 }
14093 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector)14094 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_36domain_count(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
14095   PyArrayObject *__pyx_v_domain_counts = 0;
14096   struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_v_visitor = 0;
14097   __Pyx_LocalBuf_ND __pyx_pybuffernd_domain_counts;
14098   __Pyx_Buffer __pyx_pybuffer_domain_counts;
14099   PyObject *__pyx_r = NULL;
14100   __Pyx_RefNannyDeclarations
14101   PyObject *__pyx_t_1 = NULL;
14102   PyObject *__pyx_t_2 = NULL;
14103   PyObject *__pyx_t_3 = NULL;
14104   PyObject *__pyx_t_4 = NULL;
14105   PyArrayObject *__pyx_t_5 = NULL;
14106   int __pyx_t_6;
14107   PyObject *__pyx_t_7 = NULL;
14108   PyObject *__pyx_t_8 = NULL;
14109   PyObject *__pyx_t_9 = NULL;
14110   __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
14111   __Pyx_RefNannySetupContext("domain_count", 0);
14112   __pyx_pybuffer_domain_counts.pybuffer.buf = NULL;
14113   __pyx_pybuffer_domain_counts.refcount = 0;
14114   __pyx_pybuffernd_domain_counts.data = NULL;
14115   __pyx_pybuffernd_domain_counts.rcbuffer = &__pyx_pybuffer_domain_counts;
14116 
14117   /* "yt/geometry/oct_container.pyx":719
14118  *         # We create oct arrays of the correct size
14119  *         cdef np.ndarray[np.int64_t, ndim=1] domain_counts
14120  *         domain_counts = np.zeros(self.num_domains, dtype="int64")             # <<<<<<<<<<<<<<
14121  *         cdef oct_visitors.CountByDomain visitor
14122  *         visitor = oct_visitors.CountByDomain(self, -1)
14123  */
14124   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
14125   __Pyx_GOTREF(__pyx_t_1);
14126   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
14127   __Pyx_GOTREF(__pyx_t_2);
14128   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14129   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
14130   __Pyx_GOTREF(__pyx_t_1);
14131   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
14132   __Pyx_GOTREF(__pyx_t_3);
14133   __Pyx_GIVEREF(__pyx_t_1);
14134   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14135   __pyx_t_1 = 0;
14136   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
14137   __Pyx_GOTREF(__pyx_t_1);
14138   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
14139   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error)
14140   __Pyx_GOTREF(__pyx_t_4);
14141   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14142   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14143   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14144   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 719, __pyx_L1_error)
14145   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
14146   {
14147     __Pyx_BufFmt_StackElem __pyx_stack[1];
14148     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer);
14149     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
14150     if (unlikely(__pyx_t_6 < 0)) {
14151       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
14152       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_domain_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
14153         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
14154         __Pyx_RaiseBufferFallbackError();
14155       } else {
14156         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
14157       }
14158       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
14159     }
14160     __pyx_pybuffernd_domain_counts.diminfo[0].strides = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domain_counts.diminfo[0].shape = __pyx_pybuffernd_domain_counts.rcbuffer->pybuffer.shape[0];
14161     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
14162   }
14163   __pyx_t_5 = 0;
14164   __pyx_v_domain_counts = ((PyArrayObject *)__pyx_t_4);
14165   __pyx_t_4 = 0;
14166 
14167   /* "yt/geometry/oct_container.pyx":721
14168  *         domain_counts = np.zeros(self.num_domains, dtype="int64")
14169  *         cdef oct_visitors.CountByDomain visitor
14170  *         visitor = oct_visitors.CountByDomain(self, -1)             # <<<<<<<<<<<<<<
14171  *         visitor.domain_counts = domain_counts
14172  *         self.visit_all_octs(selector, visitor)
14173  */
14174   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error)
14175   __Pyx_GOTREF(__pyx_t_4);
14176   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14177   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14178   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
14179   __Pyx_INCREF(__pyx_int_neg_1);
14180   __Pyx_GIVEREF(__pyx_int_neg_1);
14181   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
14182   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
14183   __Pyx_GOTREF(__pyx_t_1);
14184   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14185   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain *)__pyx_t_1);
14186   __pyx_t_1 = 0;
14187 
14188   /* "yt/geometry/oct_container.pyx":722
14189  *         cdef oct_visitors.CountByDomain visitor
14190  *         visitor = oct_visitors.CountByDomain(self, -1)
14191  *         visitor.domain_counts = domain_counts             # <<<<<<<<<<<<<<
14192  *         self.visit_all_octs(selector, visitor)
14193  *         return domain_counts
14194  */
14195   __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_domain_counts), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 722, __pyx_L1_error)
14196   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domain_counts, 0);
14197   __pyx_v_visitor->domain_counts = __pyx_t_10;
14198   __pyx_t_10.memview = NULL;
14199   __pyx_t_10.data = NULL;
14200 
14201   /* "yt/geometry/oct_container.pyx":723
14202  *         visitor = oct_visitors.CountByDomain(self, -1)
14203  *         visitor.domain_counts = domain_counts
14204  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
14205  *         return domain_counts
14206  *
14207  */
14208   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
14209 
14210   /* "yt/geometry/oct_container.pyx":724
14211  *         visitor.domain_counts = domain_counts
14212  *         self.visit_all_octs(selector, visitor)
14213  *         return domain_counts             # <<<<<<<<<<<<<<
14214  *
14215  *     @cython.boundscheck(False)
14216  */
14217   __Pyx_XDECREF(__pyx_r);
14218   __Pyx_INCREF(((PyObject *)__pyx_v_domain_counts));
14219   __pyx_r = ((PyObject *)__pyx_v_domain_counts);
14220   goto __pyx_L0;
14221 
14222   /* "yt/geometry/oct_container.pyx":716
14223  *         return levels, morton_inds
14224  *
14225  *     def domain_count(self, SelectorObject selector):             # <<<<<<<<<<<<<<
14226  *         # We create oct arrays of the correct size
14227  *         cdef np.ndarray[np.int64_t, ndim=1] domain_counts
14228  */
14229 
14230   /* function exit code */
14231   __pyx_L1_error:;
14232   __Pyx_XDECREF(__pyx_t_1);
14233   __Pyx_XDECREF(__pyx_t_2);
14234   __Pyx_XDECREF(__pyx_t_3);
14235   __Pyx_XDECREF(__pyx_t_4);
14236   __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
14237   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14238     __Pyx_PyThreadState_declare
14239     __Pyx_PyThreadState_assign
14240     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14241     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer);
14242   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14243   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domain_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
14244   __pyx_r = NULL;
14245   goto __pyx_L2;
14246   __pyx_L0:;
14247   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domain_counts.rcbuffer->pybuffer);
14248   __pyx_L2:;
14249   __Pyx_XDECREF((PyObject *)__pyx_v_domain_counts);
14250   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
14251   __Pyx_XGIVEREF(__pyx_r);
14252   __Pyx_RefNannyFinishContext();
14253   return __pyx_r;
14254 }
14255 
14256 /* "yt/geometry/oct_container.pyx":729
14257  *     @cython.wraparound(False)
14258  *     @cython.cdivision(True)
14259  *     def fill_level(self, int level,             # <<<<<<<<<<<<<<
14260  *                    np.ndarray[np.uint8_t, ndim=1] levels,
14261  *                    np.ndarray[np.uint8_t, ndim=1] cell_inds,
14262  */
14263 
14264 /* Python wrapper */
14265 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14266 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14267   int __pyx_v_level;
14268   PyArrayObject *__pyx_v_levels = 0;
14269   PyArrayObject *__pyx_v_cell_inds = 0;
14270   PyArrayObject *__pyx_v_file_inds = 0;
14271   PyObject *__pyx_v_dest_fields = 0;
14272   PyObject *__pyx_v_source_fields = 0;
14273   __pyx_t_5numpy_int64_t __pyx_v_offset;
14274   PyObject *__pyx_r = 0;
14275   __Pyx_RefNannyDeclarations
14276   __Pyx_RefNannySetupContext("fill_level (wrapper)", 0);
14277   {
14278     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_levels,&__pyx_n_s_cell_inds,&__pyx_n_s_file_inds,&__pyx_n_s_dest_fields,&__pyx_n_s_source_fields,&__pyx_n_s_offset,0};
14279     PyObject* values[7] = {0,0,0,0,0,0,0};
14280     if (unlikely(__pyx_kwds)) {
14281       Py_ssize_t kw_args;
14282       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14283       switch (pos_args) {
14284         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
14285         CYTHON_FALLTHROUGH;
14286         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
14287         CYTHON_FALLTHROUGH;
14288         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
14289         CYTHON_FALLTHROUGH;
14290         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14291         CYTHON_FALLTHROUGH;
14292         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14293         CYTHON_FALLTHROUGH;
14294         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14295         CYTHON_FALLTHROUGH;
14296         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14297         CYTHON_FALLTHROUGH;
14298         case  0: break;
14299         default: goto __pyx_L5_argtuple_error;
14300       }
14301       kw_args = PyDict_Size(__pyx_kwds);
14302       switch (pos_args) {
14303         case  0:
14304         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
14305         else goto __pyx_L5_argtuple_error;
14306         CYTHON_FALLTHROUGH;
14307         case  1:
14308         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
14309         else {
14310           __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 1); __PYX_ERR(0, 729, __pyx_L3_error)
14311         }
14312         CYTHON_FALLTHROUGH;
14313         case  2:
14314         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--;
14315         else {
14316           __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 2); __PYX_ERR(0, 729, __pyx_L3_error)
14317         }
14318         CYTHON_FALLTHROUGH;
14319         case  3:
14320         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--;
14321         else {
14322           __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 3); __PYX_ERR(0, 729, __pyx_L3_error)
14323         }
14324         CYTHON_FALLTHROUGH;
14325         case  4:
14326         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_fields)) != 0)) kw_args--;
14327         else {
14328           __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 4); __PYX_ERR(0, 729, __pyx_L3_error)
14329         }
14330         CYTHON_FALLTHROUGH;
14331         case  5:
14332         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_fields)) != 0)) kw_args--;
14333         else {
14334           __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, 5); __PYX_ERR(0, 729, __pyx_L3_error)
14335         }
14336         CYTHON_FALLTHROUGH;
14337         case  6:
14338         if (kw_args > 0) {
14339           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
14340           if (value) { values[6] = value; kw_args--; }
14341         }
14342       }
14343       if (unlikely(kw_args > 0)) {
14344         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_level") < 0)) __PYX_ERR(0, 729, __pyx_L3_error)
14345       }
14346     } else {
14347       switch (PyTuple_GET_SIZE(__pyx_args)) {
14348         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
14349         CYTHON_FALLTHROUGH;
14350         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
14351         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
14352         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14353         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14354         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14355         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14356         break;
14357         default: goto __pyx_L5_argtuple_error;
14358       }
14359     }
14360     __pyx_v_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L3_error)
14361     __pyx_v_levels = ((PyArrayObject *)values[1]);
14362     __pyx_v_cell_inds = ((PyArrayObject *)values[2]);
14363     __pyx_v_file_inds = ((PyArrayObject *)values[3]);
14364     __pyx_v_dest_fields = values[4];
14365     __pyx_v_source_fields = values[5];
14366     if (values[6]) {
14367       __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L3_error)
14368     } else {
14369       __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0);
14370     }
14371   }
14372   goto __pyx_L4_argument_unpacking_done;
14373   __pyx_L5_argtuple_error:;
14374   __Pyx_RaiseArgtupleInvalid("fill_level", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 729, __pyx_L3_error)
14375   __pyx_L3_error:;
14376   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
14377   __Pyx_RefNannyFinishContext();
14378   return NULL;
14379   __pyx_L4_argument_unpacking_done:;
14380   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 730, __pyx_L1_error)
14381   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cell_inds), __pyx_ptype_5numpy_ndarray, 1, "cell_inds", 0))) __PYX_ERR(0, 731, __pyx_L1_error)
14382   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_inds), __pyx_ptype_5numpy_ndarray, 1, "file_inds", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
14383   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38fill_level(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_level, __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_dest_fields, __pyx_v_source_fields, __pyx_v_offset);
14384 
14385   /* function exit code */
14386   goto __pyx_L0;
14387   __pyx_L1_error:;
14388   __pyx_r = NULL;
14389   __pyx_L0:;
14390   __Pyx_RefNannyFinishContext();
14391   return __pyx_r;
14392 }
14393 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int __pyx_v_level,PyArrayObject * __pyx_v_levels,PyArrayObject * __pyx_v_cell_inds,PyArrayObject * __pyx_v_file_inds,PyObject * __pyx_v_dest_fields,PyObject * __pyx_v_source_fields,__pyx_t_5numpy_int64_t __pyx_v_offset)14394 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_38fill_level(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int64_t __pyx_v_offset) {
14395   PyArrayObject *__pyx_v_source = 0;
14396   PyArrayObject *__pyx_v_dest = 0;
14397   int __pyx_v_i;
14398   int __pyx_v_lvl;
14399   PyObject *__pyx_v_key = NULL;
14400   __Pyx_LocalBuf_ND __pyx_pybuffernd_cell_inds;
14401   __Pyx_Buffer __pyx_pybuffer_cell_inds;
14402   __Pyx_LocalBuf_ND __pyx_pybuffernd_dest;
14403   __Pyx_Buffer __pyx_pybuffer_dest;
14404   __Pyx_LocalBuf_ND __pyx_pybuffernd_file_inds;
14405   __Pyx_Buffer __pyx_pybuffer_file_inds;
14406   __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
14407   __Pyx_Buffer __pyx_pybuffer_levels;
14408   __Pyx_LocalBuf_ND __pyx_pybuffernd_source;
14409   __Pyx_Buffer __pyx_pybuffer_source;
14410   PyObject *__pyx_r = NULL;
14411   __Pyx_RefNannyDeclarations
14412   PyObject *__pyx_t_1 = NULL;
14413   Py_ssize_t __pyx_t_2;
14414   PyObject *(*__pyx_t_3)(PyObject *);
14415   PyObject *__pyx_t_4 = NULL;
14416   PyArrayObject *__pyx_t_5 = NULL;
14417   int __pyx_t_6;
14418   PyObject *__pyx_t_7 = NULL;
14419   PyObject *__pyx_t_8 = NULL;
14420   PyObject *__pyx_t_9 = NULL;
14421   PyArrayObject *__pyx_t_10 = NULL;
14422   npy_intp __pyx_t_11;
14423   npy_intp __pyx_t_12;
14424   Py_ssize_t __pyx_t_13;
14425   int __pyx_t_14;
14426   Py_ssize_t __pyx_t_15;
14427   PyObject *__pyx_t_16 = NULL;
14428   __pyx_t_5numpy_float64_t __pyx_t_17;
14429   __pyx_t_5numpy_int64_t __pyx_t_18;
14430   Py_ssize_t __pyx_t_19;
14431   Py_ssize_t __pyx_t_20;
14432   __pyx_t_5numpy_int64_t __pyx_t_21;
14433   size_t __pyx_t_22;
14434   __pyx_t_5numpy_int64_t __pyx_t_23;
14435   __Pyx_RefNannySetupContext("fill_level", 0);
14436   __pyx_pybuffer_source.pybuffer.buf = NULL;
14437   __pyx_pybuffer_source.refcount = 0;
14438   __pyx_pybuffernd_source.data = NULL;
14439   __pyx_pybuffernd_source.rcbuffer = &__pyx_pybuffer_source;
14440   __pyx_pybuffer_dest.pybuffer.buf = NULL;
14441   __pyx_pybuffer_dest.refcount = 0;
14442   __pyx_pybuffernd_dest.data = NULL;
14443   __pyx_pybuffernd_dest.rcbuffer = &__pyx_pybuffer_dest;
14444   __pyx_pybuffer_levels.pybuffer.buf = NULL;
14445   __pyx_pybuffer_levels.refcount = 0;
14446   __pyx_pybuffernd_levels.data = NULL;
14447   __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
14448   __pyx_pybuffer_cell_inds.pybuffer.buf = NULL;
14449   __pyx_pybuffer_cell_inds.refcount = 0;
14450   __pyx_pybuffernd_cell_inds.data = NULL;
14451   __pyx_pybuffernd_cell_inds.rcbuffer = &__pyx_pybuffer_cell_inds;
14452   __pyx_pybuffer_file_inds.pybuffer.buf = NULL;
14453   __pyx_pybuffer_file_inds.refcount = 0;
14454   __pyx_pybuffernd_file_inds.data = NULL;
14455   __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds;
14456   {
14457     __Pyx_BufFmt_StackElem __pyx_stack[1];
14458     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error)
14459   }
14460   __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0];
14461   {
14462     __Pyx_BufFmt_StackElem __pyx_stack[1];
14463     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error)
14464   }
14465   __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0];
14466   {
14467     __Pyx_BufFmt_StackElem __pyx_stack[1];
14468     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 729, __pyx_L1_error)
14469   }
14470   __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0];
14471 
14472   /* "yt/geometry/oct_container.pyx":739
14473  *         cdef int i, lvl
14474  *
14475  *         for key in dest_fields:             # <<<<<<<<<<<<<<
14476  *             dest = dest_fields[key]
14477  *             source = source_fields[key]
14478  */
14479   if (likely(PyList_CheckExact(__pyx_v_dest_fields)) || PyTuple_CheckExact(__pyx_v_dest_fields)) {
14480     __pyx_t_1 = __pyx_v_dest_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
14481     __pyx_t_3 = NULL;
14482   } else {
14483     __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dest_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
14484     __Pyx_GOTREF(__pyx_t_1);
14485     __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
14486   }
14487   for (;;) {
14488     if (likely(!__pyx_t_3)) {
14489       if (likely(PyList_CheckExact(__pyx_t_1))) {
14490         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
14491         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14492         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
14493         #else
14494         __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
14495         __Pyx_GOTREF(__pyx_t_4);
14496         #endif
14497       } else {
14498         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
14499         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14500         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
14501         #else
14502         __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
14503         __Pyx_GOTREF(__pyx_t_4);
14504         #endif
14505       }
14506     } else {
14507       __pyx_t_4 = __pyx_t_3(__pyx_t_1);
14508       if (unlikely(!__pyx_t_4)) {
14509         PyObject* exc_type = PyErr_Occurred();
14510         if (exc_type) {
14511           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14512           else __PYX_ERR(0, 739, __pyx_L1_error)
14513         }
14514         break;
14515       }
14516       __Pyx_GOTREF(__pyx_t_4);
14517     }
14518     __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
14519     __pyx_t_4 = 0;
14520 
14521     /* "yt/geometry/oct_container.pyx":740
14522  *
14523  *         for key in dest_fields:
14524  *             dest = dest_fields[key]             # <<<<<<<<<<<<<<
14525  *             source = source_fields[key]
14526  *             for i in range(levels.shape[0]):
14527  */
14528     __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_dest_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
14529     __Pyx_GOTREF(__pyx_t_4);
14530     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 740, __pyx_L1_error)
14531     __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
14532     {
14533       __Pyx_BufFmt_StackElem __pyx_stack[1];
14534       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
14535       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
14536       if (unlikely(__pyx_t_6 < 0)) {
14537         PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
14538         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14539           Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
14540           __Pyx_RaiseBufferFallbackError();
14541         } else {
14542           PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
14543         }
14544         __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
14545       }
14546       __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0];
14547       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 740, __pyx_L1_error)
14548     }
14549     __pyx_t_5 = 0;
14550     __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_4));
14551     __pyx_t_4 = 0;
14552 
14553     /* "yt/geometry/oct_container.pyx":741
14554  *         for key in dest_fields:
14555  *             dest = dest_fields[key]
14556  *             source = source_fields[key]             # <<<<<<<<<<<<<<
14557  *             for i in range(levels.shape[0]):
14558  *                 lvl = levels[i]
14559  */
14560     __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_source_fields, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error)
14561     __Pyx_GOTREF(__pyx_t_4);
14562     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 741, __pyx_L1_error)
14563     __pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
14564     {
14565       __Pyx_BufFmt_StackElem __pyx_stack[1];
14566       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
14567       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
14568       if (unlikely(__pyx_t_6 < 0)) {
14569         PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
14570         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_v_source, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
14571           Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
14572           __Pyx_RaiseBufferFallbackError();
14573         } else {
14574           PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
14575         }
14576         __pyx_t_9 = __pyx_t_8 = __pyx_t_7 = 0;
14577       }
14578       __pyx_pybuffernd_source.diminfo[0].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_source.diminfo[0].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_source.diminfo[1].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_source.diminfo[1].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[1];
14579       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 741, __pyx_L1_error)
14580     }
14581     __pyx_t_10 = 0;
14582     __Pyx_XDECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_4));
14583     __pyx_t_4 = 0;
14584 
14585     /* "yt/geometry/oct_container.pyx":742
14586  *             dest = dest_fields[key]
14587  *             source = source_fields[key]
14588  *             for i in range(levels.shape[0]):             # <<<<<<<<<<<<<<
14589  *                 lvl = levels[i]
14590  *                 if lvl != level: continue
14591  */
14592     __pyx_t_11 = (__pyx_v_levels->dimensions[0]);
14593     __pyx_t_12 = __pyx_t_11;
14594     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_12; __pyx_t_6+=1) {
14595       __pyx_v_i = __pyx_t_6;
14596 
14597       /* "yt/geometry/oct_container.pyx":743
14598  *             source = source_fields[key]
14599  *             for i in range(levels.shape[0]):
14600  *                 lvl = levels[i]             # <<<<<<<<<<<<<<
14601  *                 if lvl != level: continue
14602  *                 if file_inds[i] < 0:
14603  */
14604       __pyx_t_13 = __pyx_v_i;
14605       __pyx_v_lvl = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_levels.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_levels.diminfo[0].strides));
14606 
14607       /* "yt/geometry/oct_container.pyx":744
14608  *             for i in range(levels.shape[0]):
14609  *                 lvl = levels[i]
14610  *                 if lvl != level: continue             # <<<<<<<<<<<<<<
14611  *                 if file_inds[i] < 0:
14612  *                     dest[i + offset] = np.nan
14613  */
14614       __pyx_t_14 = ((__pyx_v_lvl != __pyx_v_level) != 0);
14615       if (__pyx_t_14) {
14616         goto __pyx_L5_continue;
14617       }
14618 
14619       /* "yt/geometry/oct_container.pyx":745
14620  *                 lvl = levels[i]
14621  *                 if lvl != level: continue
14622  *                 if file_inds[i] < 0:             # <<<<<<<<<<<<<<
14623  *                     dest[i + offset] = np.nan
14624  *                 else:
14625  */
14626       __pyx_t_15 = __pyx_v_i;
14627       __pyx_t_14 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_file_inds.diminfo[0].strides)) < 0) != 0);
14628       if (__pyx_t_14) {
14629 
14630         /* "yt/geometry/oct_container.pyx":746
14631  *                 if lvl != level: continue
14632  *                 if file_inds[i] < 0:
14633  *                     dest[i + offset] = np.nan             # <<<<<<<<<<<<<<
14634  *                 else:
14635  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
14636  */
14637         __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
14638         __Pyx_GOTREF(__pyx_t_4);
14639         __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 746, __pyx_L1_error)
14640         __Pyx_GOTREF(__pyx_t_16);
14641         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14642         __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_17 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
14643         __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
14644         __pyx_t_18 = (__pyx_v_i + __pyx_v_offset);
14645         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dest.diminfo[0].strides) = __pyx_t_17;
14646 
14647         /* "yt/geometry/oct_container.pyx":745
14648  *                 lvl = levels[i]
14649  *                 if lvl != level: continue
14650  *                 if file_inds[i] < 0:             # <<<<<<<<<<<<<<
14651  *                     dest[i + offset] = np.nan
14652  *                 else:
14653  */
14654         goto __pyx_L8;
14655       }
14656 
14657       /* "yt/geometry/oct_container.pyx":748
14658  *                     dest[i + offset] = np.nan
14659  *                 else:
14660  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]             # <<<<<<<<<<<<<<
14661  *
14662  *     def fill_index(self, SelectorObject selector = AlwaysSelector(None)):
14663  */
14664       /*else*/ {
14665         __pyx_t_19 = __pyx_v_i;
14666         __pyx_t_20 = __pyx_v_i;
14667         __pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_file_inds.diminfo[0].strides));
14668         __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_cell_inds.diminfo[0].strides));
14669         __pyx_t_23 = (__pyx_v_i + __pyx_v_offset);
14670         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_dest.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_source.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_source.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_source.diminfo[1].strides));
14671       }
14672       __pyx_L8:;
14673       __pyx_L5_continue:;
14674     }
14675 
14676     /* "yt/geometry/oct_container.pyx":739
14677  *         cdef int i, lvl
14678  *
14679  *         for key in dest_fields:             # <<<<<<<<<<<<<<
14680  *             dest = dest_fields[key]
14681  *             source = source_fields[key]
14682  */
14683   }
14684   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14685 
14686   /* "yt/geometry/oct_container.pyx":729
14687  *     @cython.wraparound(False)
14688  *     @cython.cdivision(True)
14689  *     def fill_level(self, int level,             # <<<<<<<<<<<<<<
14690  *                    np.ndarray[np.uint8_t, ndim=1] levels,
14691  *                    np.ndarray[np.uint8_t, ndim=1] cell_inds,
14692  */
14693 
14694   /* function exit code */
14695   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14696   goto __pyx_L0;
14697   __pyx_L1_error:;
14698   __Pyx_XDECREF(__pyx_t_1);
14699   __Pyx_XDECREF(__pyx_t_4);
14700   __Pyx_XDECREF(__pyx_t_16);
14701   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14702     __Pyx_PyThreadState_declare
14703     __Pyx_PyThreadState_assign
14704     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14705     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
14706     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
14707     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
14708     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
14709     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
14710   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14711   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_level", __pyx_clineno, __pyx_lineno, __pyx_filename);
14712   __pyx_r = NULL;
14713   goto __pyx_L2;
14714   __pyx_L0:;
14715   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
14716   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
14717   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
14718   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
14719   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
14720   __pyx_L2:;
14721   __Pyx_XDECREF((PyObject *)__pyx_v_source);
14722   __Pyx_XDECREF((PyObject *)__pyx_v_dest);
14723   __Pyx_XDECREF(__pyx_v_key);
14724   __Pyx_XGIVEREF(__pyx_r);
14725   __Pyx_RefNannyFinishContext();
14726   return __pyx_r;
14727 }
14728 
14729 /* "yt/geometry/oct_container.pyx":750
14730  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
14731  *
14732  *     def fill_index(self, SelectorObject selector = AlwaysSelector(None)):             # <<<<<<<<<<<<<<
14733  *         """Get the on-file index of each cell"""
14734  *         cdef StoreIndex visitor
14735  */
14736 
14737 /* Python wrapper */
14738 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41fill_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14739 static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index[] = "Get the on-file index of each cell";
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41fill_index(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14740 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41fill_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14741   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
14742   PyObject *__pyx_r = 0;
14743   __Pyx_RefNannyDeclarations
14744   __Pyx_RefNannySetupContext("fill_index (wrapper)", 0);
14745   {
14746     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,0};
14747     PyObject* values[1] = {0};
14748     values[0] = (PyObject *)__pyx_k__5;
14749     if (unlikely(__pyx_kwds)) {
14750       Py_ssize_t kw_args;
14751       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14752       switch (pos_args) {
14753         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14754         CYTHON_FALLTHROUGH;
14755         case  0: break;
14756         default: goto __pyx_L5_argtuple_error;
14757       }
14758       kw_args = PyDict_Size(__pyx_kwds);
14759       switch (pos_args) {
14760         case  0:
14761         if (kw_args > 0) {
14762           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector);
14763           if (value) { values[0] = value; kw_args--; }
14764         }
14765       }
14766       if (unlikely(kw_args > 0)) {
14767         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_index") < 0)) __PYX_ERR(0, 750, __pyx_L3_error)
14768       }
14769     } else {
14770       switch (PyTuple_GET_SIZE(__pyx_args)) {
14771         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14772         CYTHON_FALLTHROUGH;
14773         case  0: break;
14774         default: goto __pyx_L5_argtuple_error;
14775       }
14776     }
14777     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
14778   }
14779   goto __pyx_L4_argument_unpacking_done;
14780   __pyx_L5_argtuple_error:;
14781   __Pyx_RaiseArgtupleInvalid("fill_index", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 750, __pyx_L3_error)
14782   __pyx_L3_error:;
14783   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14784   __Pyx_RefNannyFinishContext();
14785   return NULL;
14786   __pyx_L4_argument_unpacking_done:;
14787   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 750, __pyx_L1_error)
14788   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector);
14789 
14790   /* function exit code */
14791   goto __pyx_L0;
14792   __pyx_L1_error:;
14793   __pyx_r = NULL;
14794   __pyx_L0:;
14795   __Pyx_RefNannyFinishContext();
14796   return __pyx_r;
14797 }
14798 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector)14799 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
14800   struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex *__pyx_v_visitor = 0;
14801   __Pyx_memviewslice __pyx_v_cell_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
14802   PyObject *__pyx_r = NULL;
14803   __Pyx_RefNannyDeclarations
14804   PyObject *__pyx_t_1 = NULL;
14805   PyObject *__pyx_t_2 = NULL;
14806   PyObject *__pyx_t_3 = NULL;
14807   PyObject *__pyx_t_4 = NULL;
14808   PyObject *__pyx_t_5 = NULL;
14809   __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
14810   __Pyx_RefNannySetupContext("fill_index", 0);
14811 
14812   /* "yt/geometry/oct_container.pyx":756
14813  *         cdef np.int64_t[:, :, :, :] cell_inds
14814  *
14815  *         cell_inds = np.full((self.nocts, 2, 2, 2), -1, dtype=np.int64)             # <<<<<<<<<<<<<<
14816  *
14817  *         visitor = StoreIndex(self, -1)
14818  */
14819   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
14820   __Pyx_GOTREF(__pyx_t_1);
14821   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
14822   __Pyx_GOTREF(__pyx_t_2);
14823   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14824   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
14825   __Pyx_GOTREF(__pyx_t_1);
14826   __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
14827   __Pyx_GOTREF(__pyx_t_3);
14828   __Pyx_GIVEREF(__pyx_t_1);
14829   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14830   __Pyx_INCREF(__pyx_int_2);
14831   __Pyx_GIVEREF(__pyx_int_2);
14832   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
14833   __Pyx_INCREF(__pyx_int_2);
14834   __Pyx_GIVEREF(__pyx_int_2);
14835   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
14836   __Pyx_INCREF(__pyx_int_2);
14837   __Pyx_GIVEREF(__pyx_int_2);
14838   PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_2);
14839   __pyx_t_1 = 0;
14840   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
14841   __Pyx_GOTREF(__pyx_t_1);
14842   __Pyx_GIVEREF(__pyx_t_3);
14843   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
14844   __Pyx_INCREF(__pyx_int_neg_1);
14845   __Pyx_GIVEREF(__pyx_int_neg_1);
14846   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1);
14847   __pyx_t_3 = 0;
14848   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
14849   __Pyx_GOTREF(__pyx_t_3);
14850   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error)
14851   __Pyx_GOTREF(__pyx_t_4);
14852   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
14853   __Pyx_GOTREF(__pyx_t_5);
14854   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14855   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 756, __pyx_L1_error)
14856   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14857   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
14858   __Pyx_GOTREF(__pyx_t_5);
14859   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14860   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14861   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14862   __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 756, __pyx_L1_error)
14863   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14864   __pyx_v_cell_inds = __pyx_t_6;
14865   __pyx_t_6.memview = NULL;
14866   __pyx_t_6.data = NULL;
14867 
14868   /* "yt/geometry/oct_container.pyx":758
14869  *         cell_inds = np.full((self.nocts, 2, 2, 2), -1, dtype=np.int64)
14870  *
14871  *         visitor = StoreIndex(self, -1)             # <<<<<<<<<<<<<<
14872  *         visitor.cell_inds = cell_inds
14873  *
14874  */
14875   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
14876   __Pyx_GOTREF(__pyx_t_5);
14877   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14878   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14879   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
14880   __Pyx_INCREF(__pyx_int_neg_1);
14881   __Pyx_GIVEREF(__pyx_int_neg_1);
14882   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_neg_1);
14883   __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
14884   __Pyx_GOTREF(__pyx_t_3);
14885   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14886   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex *)__pyx_t_3);
14887   __pyx_t_3 = 0;
14888 
14889   /* "yt/geometry/oct_container.pyx":759
14890  *
14891  *         visitor = StoreIndex(self, -1)
14892  *         visitor.cell_inds = cell_inds             # <<<<<<<<<<<<<<
14893  *
14894  *         self.visit_all_octs(selector, visitor)
14895  */
14896   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->cell_inds, 0);
14897   __PYX_INC_MEMVIEW(&__pyx_v_cell_inds, 0);
14898   __pyx_v_visitor->cell_inds = __pyx_v_cell_inds;
14899 
14900   /* "yt/geometry/oct_container.pyx":761
14901  *         visitor.cell_inds = cell_inds
14902  *
14903  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
14904  *
14905  *         return np.asarray(cell_inds)
14906  */
14907   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
14908 
14909   /* "yt/geometry/oct_container.pyx":763
14910  *         self.visit_all_octs(selector, visitor)
14911  *
14912  *         return np.asarray(cell_inds)             # <<<<<<<<<<<<<<
14913  *
14914  *     def fill_octcellindex_neighbours(self, SelectorObject selector, int num_octs=-1, int domain_id=-1, int n_ghost_zones=1):
14915  */
14916   __Pyx_XDECREF(__pyx_r);
14917   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
14918   __Pyx_GOTREF(__pyx_t_5);
14919   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error)
14920   __Pyx_GOTREF(__pyx_t_1);
14921   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14922   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_cell_inds, 4, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
14923   __Pyx_GOTREF(__pyx_t_5);
14924   __pyx_t_2 = NULL;
14925   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14926     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
14927     if (likely(__pyx_t_2)) {
14928       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
14929       __Pyx_INCREF(__pyx_t_2);
14930       __Pyx_INCREF(function);
14931       __Pyx_DECREF_SET(__pyx_t_1, function);
14932     }
14933   }
14934   __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
14935   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14936   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14937   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
14938   __Pyx_GOTREF(__pyx_t_3);
14939   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14940   __pyx_r = __pyx_t_3;
14941   __pyx_t_3 = 0;
14942   goto __pyx_L0;
14943 
14944   /* "yt/geometry/oct_container.pyx":750
14945  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
14946  *
14947  *     def fill_index(self, SelectorObject selector = AlwaysSelector(None)):             # <<<<<<<<<<<<<<
14948  *         """Get the on-file index of each cell"""
14949  *         cdef StoreIndex visitor
14950  */
14951 
14952   /* function exit code */
14953   __pyx_L1_error:;
14954   __Pyx_XDECREF(__pyx_t_1);
14955   __Pyx_XDECREF(__pyx_t_2);
14956   __Pyx_XDECREF(__pyx_t_3);
14957   __Pyx_XDECREF(__pyx_t_4);
14958   __Pyx_XDECREF(__pyx_t_5);
14959   __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
14960   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14961   __pyx_r = NULL;
14962   __pyx_L0:;
14963   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
14964   __PYX_XDEC_MEMVIEW(&__pyx_v_cell_inds, 1);
14965   __Pyx_XGIVEREF(__pyx_r);
14966   __Pyx_RefNannyFinishContext();
14967   return __pyx_r;
14968 }
14969 
14970 /* "yt/geometry/oct_container.pyx":765
14971  *         return np.asarray(cell_inds)
14972  *
14973  *     def fill_octcellindex_neighbours(self, SelectorObject selector, int num_octs=-1, int domain_id=-1, int n_ghost_zones=1):             # <<<<<<<<<<<<<<
14974  *         """Compute the oct and cell indices of all the cells within all selected octs, extended
14975  *         by one cell in all directions (for ghost zones computations).
14976  */
14977 
14978 /* Python wrapper */
14979 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43fill_octcellindex_neighbours(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14980 static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours[] = "Compute the oct and cell indices of all the cells within all selected octs, extended\n        by one cell in all directions (for ghost zones computations).\n\n        Parameters\n        ----------\n        selector : SelectorObject\n            Selector for the octs to compute neighbour of\n        num_octs : int, optional\n            The number of octs to read in\n        domain_id : int, optional\n            The domain to perform the selection over\n\n        Returns\n        -------\n        oct_inds : int64 ndarray (nocts*8, )\n            The on-domain index of the octs containing each cell\n        cell_inds : uint8 ndarray (nocts*8, )\n            The index of the cell in its parent oct\n\n        Note\n        ----\n        oct_inds/cell_inds\n        ";
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43fill_octcellindex_neighbours(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14981 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43fill_octcellindex_neighbours(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14982   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
14983   int __pyx_v_num_octs;
14984   int __pyx_v_domain_id;
14985   int __pyx_v_n_ghost_zones;
14986   PyObject *__pyx_r = 0;
14987   __Pyx_RefNannyDeclarations
14988   __Pyx_RefNannySetupContext("fill_octcellindex_neighbours (wrapper)", 0);
14989   {
14990     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_num_octs,&__pyx_n_s_domain_id,&__pyx_n_s_n_ghost_zones,0};
14991     PyObject* values[4] = {0,0,0,0};
14992     if (unlikely(__pyx_kwds)) {
14993       Py_ssize_t kw_args;
14994       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14995       switch (pos_args) {
14996         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14997         CYTHON_FALLTHROUGH;
14998         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14999         CYTHON_FALLTHROUGH;
15000         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15001         CYTHON_FALLTHROUGH;
15002         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15003         CYTHON_FALLTHROUGH;
15004         case  0: break;
15005         default: goto __pyx_L5_argtuple_error;
15006       }
15007       kw_args = PyDict_Size(__pyx_kwds);
15008       switch (pos_args) {
15009         case  0:
15010         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
15011         else goto __pyx_L5_argtuple_error;
15012         CYTHON_FALLTHROUGH;
15013         case  1:
15014         if (kw_args > 0) {
15015           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_octs);
15016           if (value) { values[1] = value; kw_args--; }
15017         }
15018         CYTHON_FALLTHROUGH;
15019         case  2:
15020         if (kw_args > 0) {
15021           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id);
15022           if (value) { values[2] = value; kw_args--; }
15023         }
15024         CYTHON_FALLTHROUGH;
15025         case  3:
15026         if (kw_args > 0) {
15027           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n_ghost_zones);
15028           if (value) { values[3] = value; kw_args--; }
15029         }
15030       }
15031       if (unlikely(kw_args > 0)) {
15032         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_octcellindex_neighbours") < 0)) __PYX_ERR(0, 765, __pyx_L3_error)
15033       }
15034     } else {
15035       switch (PyTuple_GET_SIZE(__pyx_args)) {
15036         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15037         CYTHON_FALLTHROUGH;
15038         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15039         CYTHON_FALLTHROUGH;
15040         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15041         CYTHON_FALLTHROUGH;
15042         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15043         break;
15044         default: goto __pyx_L5_argtuple_error;
15045       }
15046     }
15047     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
15048     if (values[1]) {
15049       __pyx_v_num_octs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_octs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L3_error)
15050     } else {
15051       __pyx_v_num_octs = ((int)-1);
15052     }
15053     if (values[2]) {
15054       __pyx_v_domain_id = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L3_error)
15055     } else {
15056       __pyx_v_domain_id = ((int)-1);
15057     }
15058     if (values[3]) {
15059       __pyx_v_n_ghost_zones = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n_ghost_zones == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L3_error)
15060     } else {
15061       __pyx_v_n_ghost_zones = ((int)1);
15062     }
15063   }
15064   goto __pyx_L4_argument_unpacking_done;
15065   __pyx_L5_argtuple_error:;
15066   __Pyx_RaiseArgtupleInvalid("fill_octcellindex_neighbours", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 765, __pyx_L3_error)
15067   __pyx_L3_error:;
15068   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_octcellindex_neighbours", __pyx_clineno, __pyx_lineno, __pyx_filename);
15069   __Pyx_RefNannyFinishContext();
15070   return NULL;
15071   __pyx_L4_argument_unpacking_done:;
15072   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 765, __pyx_L1_error)
15073   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_num_octs, __pyx_v_domain_id, __pyx_v_n_ghost_zones);
15074 
15075   /* function exit code */
15076   goto __pyx_L0;
15077   __pyx_L1_error:;
15078   __pyx_r = NULL;
15079   __pyx_L0:;
15080   __Pyx_RefNannyFinishContext();
15081   return __pyx_r;
15082 }
15083 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,int __pyx_v_num_octs,int __pyx_v_domain_id,int __pyx_v_n_ghost_zones)15084 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_num_octs, int __pyx_v_domain_id, int __pyx_v_n_ghost_zones) {
15085   struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *__pyx_v_visitor = 0;
15086   __Pyx_memviewslice __pyx_v_cell_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
15087   __Pyx_memviewslice __pyx_v_oct_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
15088   PyObject *__pyx_r = NULL;
15089   __Pyx_RefNannyDeclarations
15090   int __pyx_t_1;
15091   PyObject *__pyx_t_2 = NULL;
15092   PyObject *__pyx_t_3 = NULL;
15093   PyObject *__pyx_t_4 = NULL;
15094   PyObject *__pyx_t_5 = NULL;
15095   int __pyx_t_6;
15096   PyObject *__pyx_t_7 = NULL;
15097   __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
15098   __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
15099   __Pyx_RefNannySetupContext("fill_octcellindex_neighbours", 0);
15100 
15101   /* "yt/geometry/oct_container.pyx":789
15102  *         oct_inds/cell_inds
15103  *         """
15104  *         if num_octs == -1:             # <<<<<<<<<<<<<<
15105  *             num_octs = selector.count_octs(self, domain_id)
15106  *
15107  */
15108   __pyx_t_1 = ((__pyx_v_num_octs == -1L) != 0);
15109   if (__pyx_t_1) {
15110 
15111     /* "yt/geometry/oct_container.pyx":790
15112  *         """
15113  *         if num_octs == -1:
15114  *             num_octs = selector.count_octs(self, domain_id)             # <<<<<<<<<<<<<<
15115  *
15116  *         cdef NeighbourCellIndexVisitor visitor
15117  */
15118     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_octs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
15119     __Pyx_GOTREF(__pyx_t_3);
15120     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
15121     __Pyx_GOTREF(__pyx_t_4);
15122     __pyx_t_5 = NULL;
15123     __pyx_t_6 = 0;
15124     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
15125       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
15126       if (likely(__pyx_t_5)) {
15127         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
15128         __Pyx_INCREF(__pyx_t_5);
15129         __Pyx_INCREF(function);
15130         __Pyx_DECREF_SET(__pyx_t_3, function);
15131         __pyx_t_6 = 1;
15132       }
15133     }
15134     #if CYTHON_FAST_PYCALL
15135     if (PyFunction_Check(__pyx_t_3)) {
15136       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
15137       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
15138       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15139       __Pyx_GOTREF(__pyx_t_2);
15140       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15141     } else
15142     #endif
15143     #if CYTHON_FAST_PYCCALL
15144     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
15145       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
15146       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
15147       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15148       __Pyx_GOTREF(__pyx_t_2);
15149       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15150     } else
15151     #endif
15152     {
15153       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 790, __pyx_L1_error)
15154       __Pyx_GOTREF(__pyx_t_7);
15155       if (__pyx_t_5) {
15156         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
15157       }
15158       __Pyx_INCREF(((PyObject *)__pyx_v_self));
15159       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15160       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
15161       __Pyx_GIVEREF(__pyx_t_4);
15162       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
15163       __pyx_t_4 = 0;
15164       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
15165       __Pyx_GOTREF(__pyx_t_2);
15166       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15167     }
15168     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15169     __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
15170     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15171     __pyx_v_num_octs = __pyx_t_6;
15172 
15173     /* "yt/geometry/oct_container.pyx":789
15174  *         oct_inds/cell_inds
15175  *         """
15176  *         if num_octs == -1:             # <<<<<<<<<<<<<<
15177  *             num_octs = selector.count_octs(self, domain_id)
15178  *
15179  */
15180   }
15181 
15182   /* "yt/geometry/oct_container.pyx":797
15183  *         cdef np.int64_t[::1] oct_inds
15184  *
15185  *         cell_inds = np.full(num_octs*4**3, 8, dtype=np.uint8)             # <<<<<<<<<<<<<<
15186  *         oct_inds = np.full(num_octs*4**3, -1, dtype=np.int64)
15187  *
15188  */
15189   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error)
15190   __Pyx_GOTREF(__pyx_t_2);
15191   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 797, __pyx_L1_error)
15192   __Pyx_GOTREF(__pyx_t_3);
15193   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15194   __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_num_octs * 64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error)
15195   __Pyx_GOTREF(__pyx_t_2);
15196   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error)
15197   __Pyx_GOTREF(__pyx_t_7);
15198   __Pyx_GIVEREF(__pyx_t_2);
15199   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
15200   __Pyx_INCREF(__pyx_int_8);
15201   __Pyx_GIVEREF(__pyx_int_8);
15202   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_8);
15203   __pyx_t_2 = 0;
15204   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 797, __pyx_L1_error)
15205   __Pyx_GOTREF(__pyx_t_2);
15206   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error)
15207   __Pyx_GOTREF(__pyx_t_4);
15208   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error)
15209   __Pyx_GOTREF(__pyx_t_5);
15210   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15211   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 797, __pyx_L1_error)
15212   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15213   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error)
15214   __Pyx_GOTREF(__pyx_t_5);
15215   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15216   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15217   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15218   __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 797, __pyx_L1_error)
15219   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15220   __pyx_v_cell_inds = __pyx_t_8;
15221   __pyx_t_8.memview = NULL;
15222   __pyx_t_8.data = NULL;
15223 
15224   /* "yt/geometry/oct_container.pyx":798
15225  *
15226  *         cell_inds = np.full(num_octs*4**3, 8, dtype=np.uint8)
15227  *         oct_inds = np.full(num_octs*4**3, -1, dtype=np.int64)             # <<<<<<<<<<<<<<
15228  *
15229  *         visitor = NeighbourCellIndexVisitor(self, -1, n_ghost_zones)
15230  */
15231   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 798, __pyx_L1_error)
15232   __Pyx_GOTREF(__pyx_t_5);
15233   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error)
15234   __Pyx_GOTREF(__pyx_t_2);
15235   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15236   __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_num_octs * 64)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 798, __pyx_L1_error)
15237   __Pyx_GOTREF(__pyx_t_5);
15238   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 798, __pyx_L1_error)
15239   __Pyx_GOTREF(__pyx_t_7);
15240   __Pyx_GIVEREF(__pyx_t_5);
15241   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
15242   __Pyx_INCREF(__pyx_int_neg_1);
15243   __Pyx_GIVEREF(__pyx_int_neg_1);
15244   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
15245   __pyx_t_5 = 0;
15246   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 798, __pyx_L1_error)
15247   __Pyx_GOTREF(__pyx_t_5);
15248   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error)
15249   __Pyx_GOTREF(__pyx_t_3);
15250   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error)
15251   __Pyx_GOTREF(__pyx_t_4);
15252   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15253   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
15254   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15255   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error)
15256   __Pyx_GOTREF(__pyx_t_4);
15257   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15258   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15259   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15260   __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 798, __pyx_L1_error)
15261   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15262   __pyx_v_oct_inds = __pyx_t_9;
15263   __pyx_t_9.memview = NULL;
15264   __pyx_t_9.data = NULL;
15265 
15266   /* "yt/geometry/oct_container.pyx":800
15267  *         oct_inds = np.full(num_octs*4**3, -1, dtype=np.int64)
15268  *
15269  *         visitor = NeighbourCellIndexVisitor(self, -1, n_ghost_zones)             # <<<<<<<<<<<<<<
15270  *         visitor.cell_inds = cell_inds
15271  *         visitor.domain_inds = oct_inds
15272  */
15273   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_ghost_zones); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
15274   __Pyx_GOTREF(__pyx_t_4);
15275   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L1_error)
15276   __Pyx_GOTREF(__pyx_t_5);
15277   __Pyx_INCREF(((PyObject *)__pyx_v_self));
15278   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15279   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
15280   __Pyx_INCREF(__pyx_int_neg_1);
15281   __Pyx_GIVEREF(__pyx_int_neg_1);
15282   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_neg_1);
15283   __Pyx_GIVEREF(__pyx_t_4);
15284   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
15285   __pyx_t_4 = 0;
15286   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
15287   __Pyx_GOTREF(__pyx_t_4);
15288   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15289   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *)__pyx_t_4);
15290   __pyx_t_4 = 0;
15291 
15292   /* "yt/geometry/oct_container.pyx":801
15293  *
15294  *         visitor = NeighbourCellIndexVisitor(self, -1, n_ghost_zones)
15295  *         visitor.cell_inds = cell_inds             # <<<<<<<<<<<<<<
15296  *         visitor.domain_inds = oct_inds
15297  *
15298  */
15299   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->cell_inds, 0);
15300   __PYX_INC_MEMVIEW(&__pyx_v_cell_inds, 0);
15301   __pyx_v_visitor->cell_inds = __pyx_v_cell_inds;
15302 
15303   /* "yt/geometry/oct_container.pyx":802
15304  *         visitor = NeighbourCellIndexVisitor(self, -1, n_ghost_zones)
15305  *         visitor.cell_inds = cell_inds
15306  *         visitor.domain_inds = oct_inds             # <<<<<<<<<<<<<<
15307  *
15308  *         self.visit_all_octs(selector, visitor)
15309  */
15310   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domain_inds, 0);
15311   __PYX_INC_MEMVIEW(&__pyx_v_oct_inds, 0);
15312   __pyx_v_visitor->domain_inds = __pyx_v_oct_inds;
15313 
15314   /* "yt/geometry/oct_container.pyx":804
15315  *         visitor.domain_inds = oct_inds
15316  *
15317  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
15318  *
15319  *         return np.asarray(oct_inds), np.asarray(cell_inds)
15320  */
15321   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
15322 
15323   /* "yt/geometry/oct_container.pyx":806
15324  *         self.visit_all_octs(selector, visitor)
15325  *
15326  *         return np.asarray(oct_inds), np.asarray(cell_inds)             # <<<<<<<<<<<<<<
15327  *
15328  *     @cython.boundscheck(False)
15329  */
15330   __Pyx_XDECREF(__pyx_r);
15331   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
15332   __Pyx_GOTREF(__pyx_t_5);
15333   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error)
15334   __Pyx_GOTREF(__pyx_t_7);
15335   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15336   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_oct_inds, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_int64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_int64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
15337   __Pyx_GOTREF(__pyx_t_5);
15338   __pyx_t_2 = NULL;
15339   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
15340     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
15341     if (likely(__pyx_t_2)) {
15342       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
15343       __Pyx_INCREF(__pyx_t_2);
15344       __Pyx_INCREF(function);
15345       __Pyx_DECREF_SET(__pyx_t_7, function);
15346     }
15347   }
15348   __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5);
15349   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15350   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15351   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error)
15352   __Pyx_GOTREF(__pyx_t_4);
15353   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15354   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
15355   __Pyx_GOTREF(__pyx_t_5);
15356   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
15357   __Pyx_GOTREF(__pyx_t_2);
15358   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15359   __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_cell_inds, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
15360   __Pyx_GOTREF(__pyx_t_5);
15361   __pyx_t_3 = NULL;
15362   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15363     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
15364     if (likely(__pyx_t_3)) {
15365       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15366       __Pyx_INCREF(__pyx_t_3);
15367       __Pyx_INCREF(function);
15368       __Pyx_DECREF_SET(__pyx_t_2, function);
15369     }
15370   }
15371   __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
15372   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15373   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15374   if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error)
15375   __Pyx_GOTREF(__pyx_t_7);
15376   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15377   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
15378   __Pyx_GOTREF(__pyx_t_2);
15379   __Pyx_GIVEREF(__pyx_t_4);
15380   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
15381   __Pyx_GIVEREF(__pyx_t_7);
15382   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
15383   __pyx_t_4 = 0;
15384   __pyx_t_7 = 0;
15385   __pyx_r = __pyx_t_2;
15386   __pyx_t_2 = 0;
15387   goto __pyx_L0;
15388 
15389   /* "yt/geometry/oct_container.pyx":765
15390  *         return np.asarray(cell_inds)
15391  *
15392  *     def fill_octcellindex_neighbours(self, SelectorObject selector, int num_octs=-1, int domain_id=-1, int n_ghost_zones=1):             # <<<<<<<<<<<<<<
15393  *         """Compute the oct and cell indices of all the cells within all selected octs, extended
15394  *         by one cell in all directions (for ghost zones computations).
15395  */
15396 
15397   /* function exit code */
15398   __pyx_L1_error:;
15399   __Pyx_XDECREF(__pyx_t_2);
15400   __Pyx_XDECREF(__pyx_t_3);
15401   __Pyx_XDECREF(__pyx_t_4);
15402   __Pyx_XDECREF(__pyx_t_5);
15403   __Pyx_XDECREF(__pyx_t_7);
15404   __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
15405   __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
15406   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_octcellindex_neighbours", __pyx_clineno, __pyx_lineno, __pyx_filename);
15407   __pyx_r = NULL;
15408   __pyx_L0:;
15409   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
15410   __PYX_XDEC_MEMVIEW(&__pyx_v_cell_inds, 1);
15411   __PYX_XDEC_MEMVIEW(&__pyx_v_oct_inds, 1);
15412   __Pyx_XGIVEREF(__pyx_r);
15413   __Pyx_RefNannyFinishContext();
15414   return __pyx_r;
15415 }
15416 
15417 /* "yt/geometry/oct_container.pyx":811
15418  *     @cython.wraparound(False)
15419  *     @cython.cdivision(True)
15420  *     def fill_level_with_domain(             # <<<<<<<<<<<<<<
15421  *                    self, int level,
15422  *                    np.uint8_t[:] levels,
15423  */
15424 
15425 /* Python wrapper */
15426 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_45fill_level_with_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15427 static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain[] = "Similar to fill_level but accepts a domain argument.\n\n        This is particularly useful for frontends that have buffer zones at CPU boundaries.\n        These buffer oct cells have a different domain than the local one and\n        are usually not read, but one has to read them e.g. to compute ghost zones.\n        ";
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_45fill_level_with_domain(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15428 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_45fill_level_with_domain(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15429   int __pyx_v_level;
15430   __Pyx_memviewslice __pyx_v_levels = { 0, 0, { 0 }, { 0 }, { 0 } };
15431   __Pyx_memviewslice __pyx_v_cell_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
15432   __Pyx_memviewslice __pyx_v_file_inds = { 0, 0, { 0 }, { 0 }, { 0 } };
15433   __Pyx_memviewslice __pyx_v_domains = { 0, 0, { 0 }, { 0 }, { 0 } };
15434   PyObject *__pyx_v_dest_fields = 0;
15435   PyObject *__pyx_v_source_fields = 0;
15436   __pyx_t_5numpy_int32_t __pyx_v_domain;
15437   __pyx_t_5numpy_int64_t __pyx_v_offset;
15438   PyObject *__pyx_r = 0;
15439   __Pyx_RefNannyDeclarations
15440   __Pyx_RefNannySetupContext("fill_level_with_domain (wrapper)", 0);
15441   {
15442     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_levels,&__pyx_n_s_cell_inds,&__pyx_n_s_file_inds,&__pyx_n_s_domains,&__pyx_n_s_dest_fields,&__pyx_n_s_source_fields,&__pyx_n_s_domain,&__pyx_n_s_offset,0};
15443     PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
15444     if (unlikely(__pyx_kwds)) {
15445       Py_ssize_t kw_args;
15446       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15447       switch (pos_args) {
15448         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15449         CYTHON_FALLTHROUGH;
15450         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15451         CYTHON_FALLTHROUGH;
15452         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15453         CYTHON_FALLTHROUGH;
15454         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15455         CYTHON_FALLTHROUGH;
15456         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15457         CYTHON_FALLTHROUGH;
15458         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15459         CYTHON_FALLTHROUGH;
15460         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15461         CYTHON_FALLTHROUGH;
15462         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15463         CYTHON_FALLTHROUGH;
15464         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15465         CYTHON_FALLTHROUGH;
15466         case  0: break;
15467         default: goto __pyx_L5_argtuple_error;
15468       }
15469       kw_args = PyDict_Size(__pyx_kwds);
15470       switch (pos_args) {
15471         case  0:
15472         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
15473         else goto __pyx_L5_argtuple_error;
15474         CYTHON_FALLTHROUGH;
15475         case  1:
15476         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
15477         else {
15478           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 1); __PYX_ERR(0, 811, __pyx_L3_error)
15479         }
15480         CYTHON_FALLTHROUGH;
15481         case  2:
15482         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--;
15483         else {
15484           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 2); __PYX_ERR(0, 811, __pyx_L3_error)
15485         }
15486         CYTHON_FALLTHROUGH;
15487         case  3:
15488         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--;
15489         else {
15490           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 3); __PYX_ERR(0, 811, __pyx_L3_error)
15491         }
15492         CYTHON_FALLTHROUGH;
15493         case  4:
15494         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domains)) != 0)) kw_args--;
15495         else {
15496           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 4); __PYX_ERR(0, 811, __pyx_L3_error)
15497         }
15498         CYTHON_FALLTHROUGH;
15499         case  5:
15500         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest_fields)) != 0)) kw_args--;
15501         else {
15502           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 5); __PYX_ERR(0, 811, __pyx_L3_error)
15503         }
15504         CYTHON_FALLTHROUGH;
15505         case  6:
15506         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source_fields)) != 0)) kw_args--;
15507         else {
15508           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 6); __PYX_ERR(0, 811, __pyx_L3_error)
15509         }
15510         CYTHON_FALLTHROUGH;
15511         case  7:
15512         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain)) != 0)) kw_args--;
15513         else {
15514           __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, 7); __PYX_ERR(0, 811, __pyx_L3_error)
15515         }
15516         CYTHON_FALLTHROUGH;
15517         case  8:
15518         if (kw_args > 0) {
15519           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset);
15520           if (value) { values[8] = value; kw_args--; }
15521         }
15522       }
15523       if (unlikely(kw_args > 0)) {
15524         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_level_with_domain") < 0)) __PYX_ERR(0, 811, __pyx_L3_error)
15525       }
15526     } else {
15527       switch (PyTuple_GET_SIZE(__pyx_args)) {
15528         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15529         CYTHON_FALLTHROUGH;
15530         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15531         values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15532         values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15533         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15534         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15535         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15536         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15537         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15538         break;
15539         default: goto __pyx_L5_argtuple_error;
15540       }
15541     }
15542     __pyx_v_level = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 812, __pyx_L3_error)
15543     __pyx_v_levels = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_levels.memview)) __PYX_ERR(0, 813, __pyx_L3_error)
15544     __pyx_v_cell_inds = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(values[2], PyBUF_WRITABLE); if (unlikely(!__pyx_v_cell_inds.memview)) __PYX_ERR(0, 814, __pyx_L3_error)
15545     __pyx_v_file_inds = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_file_inds.memview)) __PYX_ERR(0, 815, __pyx_L3_error)
15546     __pyx_v_domains = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_domains.memview)) __PYX_ERR(0, 816, __pyx_L3_error)
15547     __pyx_v_dest_fields = ((PyObject*)values[5]);
15548     __pyx_v_source_fields = ((PyObject*)values[6]);
15549     __pyx_v_domain = __Pyx_PyInt_As_npy_int32(values[7]); if (unlikely((__pyx_v_domain == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
15550     if (values[8]) {
15551       __pyx_v_offset = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_offset == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
15552     } else {
15553       __pyx_v_offset = ((__pyx_t_5numpy_int64_t)0);
15554     }
15555   }
15556   goto __pyx_L4_argument_unpacking_done;
15557   __pyx_L5_argtuple_error:;
15558   __Pyx_RaiseArgtupleInvalid("fill_level_with_domain", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 811, __pyx_L3_error)
15559   __pyx_L3_error:;
15560   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_level_with_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
15561   __Pyx_RefNannyFinishContext();
15562   return NULL;
15563   __pyx_L4_argument_unpacking_done:;
15564   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest_fields), (&PyDict_Type), 1, "dest_fields", 1))) __PYX_ERR(0, 817, __pyx_L1_error)
15565   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source_fields), (&PyDict_Type), 1, "source_fields", 1))) __PYX_ERR(0, 818, __pyx_L1_error)
15566   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_level, __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_domains, __pyx_v_dest_fields, __pyx_v_source_fields, __pyx_v_domain, __pyx_v_offset);
15567 
15568   /* function exit code */
15569   goto __pyx_L0;
15570   __pyx_L1_error:;
15571   __pyx_r = NULL;
15572   __pyx_L0:;
15573   __Pyx_RefNannyFinishContext();
15574   return __pyx_r;
15575 }
15576 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,int __pyx_v_level,__Pyx_memviewslice __pyx_v_levels,__Pyx_memviewslice __pyx_v_cell_inds,__Pyx_memviewslice __pyx_v_file_inds,__Pyx_memviewslice __pyx_v_domains,PyObject * __pyx_v_dest_fields,PyObject * __pyx_v_source_fields,__pyx_t_5numpy_int32_t __pyx_v_domain,__pyx_t_5numpy_int64_t __pyx_v_offset)15577 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, int __pyx_v_level, __Pyx_memviewslice __pyx_v_levels, __Pyx_memviewslice __pyx_v_cell_inds, __Pyx_memviewslice __pyx_v_file_inds, __Pyx_memviewslice __pyx_v_domains, PyObject *__pyx_v_dest_fields, PyObject *__pyx_v_source_fields, __pyx_t_5numpy_int32_t __pyx_v_domain, __pyx_t_5numpy_int64_t __pyx_v_offset) {
15578   PyArrayObject *__pyx_v_source = 0;
15579   PyArrayObject *__pyx_v_dest = 0;
15580   int __pyx_v_i;
15581   int __pyx_v_count;
15582   int __pyx_v_lev;
15583   __pyx_t_5numpy_int32_t __pyx_v_dom;
15584   PyObject *__pyx_v_key = NULL;
15585   __Pyx_LocalBuf_ND __pyx_pybuffernd_dest;
15586   __Pyx_Buffer __pyx_pybuffer_dest;
15587   __Pyx_LocalBuf_ND __pyx_pybuffernd_source;
15588   __Pyx_Buffer __pyx_pybuffer_source;
15589   PyObject *__pyx_r = NULL;
15590   __Pyx_RefNannyDeclarations
15591   PyObject *__pyx_t_1 = NULL;
15592   Py_ssize_t __pyx_t_2;
15593   Py_ssize_t __pyx_t_3;
15594   int __pyx_t_4;
15595   PyObject *__pyx_t_5 = NULL;
15596   int __pyx_t_6;
15597   PyArrayObject *__pyx_t_7 = NULL;
15598   PyObject *__pyx_t_8 = NULL;
15599   PyObject *__pyx_t_9 = NULL;
15600   PyObject *__pyx_t_10 = NULL;
15601   PyArrayObject *__pyx_t_11 = NULL;
15602   Py_ssize_t __pyx_t_12;
15603   Py_ssize_t __pyx_t_13;
15604   Py_ssize_t __pyx_t_14;
15605   Py_ssize_t __pyx_t_15;
15606   int __pyx_t_16;
15607   int __pyx_t_17;
15608   Py_ssize_t __pyx_t_18;
15609   PyObject *__pyx_t_19 = NULL;
15610   __pyx_t_5numpy_float64_t __pyx_t_20;
15611   __pyx_t_5numpy_int64_t __pyx_t_21;
15612   Py_ssize_t __pyx_t_22;
15613   Py_ssize_t __pyx_t_23;
15614   __pyx_t_5numpy_int64_t __pyx_t_24;
15615   size_t __pyx_t_25;
15616   __pyx_t_5numpy_int64_t __pyx_t_26;
15617   __Pyx_RefNannySetupContext("fill_level_with_domain", 0);
15618   __pyx_pybuffer_source.pybuffer.buf = NULL;
15619   __pyx_pybuffer_source.refcount = 0;
15620   __pyx_pybuffernd_source.data = NULL;
15621   __pyx_pybuffernd_source.rcbuffer = &__pyx_pybuffer_source;
15622   __pyx_pybuffer_dest.pybuffer.buf = NULL;
15623   __pyx_pybuffer_dest.refcount = 0;
15624   __pyx_pybuffernd_dest.data = NULL;
15625   __pyx_pybuffernd_dest.rcbuffer = &__pyx_pybuffer_dest;
15626 
15627   /* "yt/geometry/oct_container.pyx":833
15628  *         cdef np.int32_t dom
15629  *
15630  *         for key in dest_fields:             # <<<<<<<<<<<<<<
15631  *             dest = dest_fields[key]
15632  *             source = source_fields[key]
15633  */
15634   __pyx_t_2 = 0;
15635   if (unlikely(__pyx_v_dest_fields == Py_None)) {
15636     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
15637     __PYX_ERR(0, 833, __pyx_L1_error)
15638   }
15639   __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_dest_fields, 1, ((PyObject *)NULL), (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
15640   __Pyx_GOTREF(__pyx_t_5);
15641   __Pyx_XDECREF(__pyx_t_1);
15642   __pyx_t_1 = __pyx_t_5;
15643   __pyx_t_5 = 0;
15644   while (1) {
15645     __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, NULL, NULL, __pyx_t_4);
15646     if (unlikely(__pyx_t_6 == 0)) break;
15647     if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 833, __pyx_L1_error)
15648     __Pyx_GOTREF(__pyx_t_5);
15649     __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
15650     __pyx_t_5 = 0;
15651 
15652     /* "yt/geometry/oct_container.pyx":834
15653  *
15654  *         for key in dest_fields:
15655  *             dest = dest_fields[key]             # <<<<<<<<<<<<<<
15656  *             source = source_fields[key]
15657  *             count = 0
15658  */
15659     if (unlikely(__pyx_v_dest_fields == Py_None)) {
15660       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15661       __PYX_ERR(0, 834, __pyx_L1_error)
15662     }
15663     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_dest_fields, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 834, __pyx_L1_error)
15664     __Pyx_GOTREF(__pyx_t_5);
15665     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 834, __pyx_L1_error)
15666     __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
15667     {
15668       __Pyx_BufFmt_StackElem __pyx_stack[1];
15669       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
15670       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
15671       if (unlikely(__pyx_t_6 < 0)) {
15672         PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
15673         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dest.rcbuffer->pybuffer, (PyObject*)__pyx_v_dest, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
15674           Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
15675           __Pyx_RaiseBufferFallbackError();
15676         } else {
15677           PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
15678         }
15679         __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
15680       }
15681       __pyx_pybuffernd_dest.diminfo[0].strides = __pyx_pybuffernd_dest.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dest.diminfo[0].shape = __pyx_pybuffernd_dest.rcbuffer->pybuffer.shape[0];
15682       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 834, __pyx_L1_error)
15683     }
15684     __pyx_t_7 = 0;
15685     __Pyx_XDECREF_SET(__pyx_v_dest, ((PyArrayObject *)__pyx_t_5));
15686     __pyx_t_5 = 0;
15687 
15688     /* "yt/geometry/oct_container.pyx":835
15689  *         for key in dest_fields:
15690  *             dest = dest_fields[key]
15691  *             source = source_fields[key]             # <<<<<<<<<<<<<<
15692  *             count = 0
15693  *             for i in range(levels.shape[0]):
15694  */
15695     if (unlikely(__pyx_v_source_fields == Py_None)) {
15696       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
15697       __PYX_ERR(0, 835, __pyx_L1_error)
15698     }
15699     __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_source_fields, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error)
15700     __Pyx_GOTREF(__pyx_t_5);
15701     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 835, __pyx_L1_error)
15702     __pyx_t_11 = ((PyArrayObject *)__pyx_t_5);
15703     {
15704       __Pyx_BufFmt_StackElem __pyx_stack[1];
15705       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
15706       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
15707       if (unlikely(__pyx_t_6 < 0)) {
15708         PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
15709         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_source.rcbuffer->pybuffer, (PyObject*)__pyx_v_source, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
15710           Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
15711           __Pyx_RaiseBufferFallbackError();
15712         } else {
15713           PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
15714         }
15715         __pyx_t_10 = __pyx_t_9 = __pyx_t_8 = 0;
15716       }
15717       __pyx_pybuffernd_source.diminfo[0].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_source.diminfo[0].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_source.diminfo[1].strides = __pyx_pybuffernd_source.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_source.diminfo[1].shape = __pyx_pybuffernd_source.rcbuffer->pybuffer.shape[1];
15718       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
15719     }
15720     __pyx_t_11 = 0;
15721     __Pyx_XDECREF_SET(__pyx_v_source, ((PyArrayObject *)__pyx_t_5));
15722     __pyx_t_5 = 0;
15723 
15724     /* "yt/geometry/oct_container.pyx":836
15725  *             dest = dest_fields[key]
15726  *             source = source_fields[key]
15727  *             count = 0             # <<<<<<<<<<<<<<
15728  *             for i in range(levels.shape[0]):
15729  *                 lev = levels[i]
15730  */
15731     __pyx_v_count = 0;
15732 
15733     /* "yt/geometry/oct_container.pyx":837
15734  *             source = source_fields[key]
15735  *             count = 0
15736  *             for i in range(levels.shape[0]):             # <<<<<<<<<<<<<<
15737  *                 lev = levels[i]
15738  *                 dom = domains[i]
15739  */
15740     __pyx_t_12 = (__pyx_v_levels.shape[0]);
15741     __pyx_t_13 = __pyx_t_12;
15742     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_13; __pyx_t_6+=1) {
15743       __pyx_v_i = __pyx_t_6;
15744 
15745       /* "yt/geometry/oct_container.pyx":838
15746  *             count = 0
15747  *             for i in range(levels.shape[0]):
15748  *                 lev = levels[i]             # <<<<<<<<<<<<<<
15749  *                 dom = domains[i]
15750  *                 if lev != level or dom != domain: continue
15751  */
15752       __pyx_t_14 = __pyx_v_i;
15753       __pyx_v_lev = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_levels.data + __pyx_t_14 * __pyx_v_levels.strides[0]) )));
15754 
15755       /* "yt/geometry/oct_container.pyx":839
15756  *             for i in range(levels.shape[0]):
15757  *                 lev = levels[i]
15758  *                 dom = domains[i]             # <<<<<<<<<<<<<<
15759  *                 if lev != level or dom != domain: continue
15760  *                 count += 1
15761  */
15762       __pyx_t_15 = __pyx_v_i;
15763       __pyx_v_dom = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_domains.data + __pyx_t_15 * __pyx_v_domains.strides[0]) )));
15764 
15765       /* "yt/geometry/oct_container.pyx":840
15766  *                 lev = levels[i]
15767  *                 dom = domains[i]
15768  *                 if lev != level or dom != domain: continue             # <<<<<<<<<<<<<<
15769  *                 count += 1
15770  *                 if file_inds[i] < 0:
15771  */
15772       __pyx_t_17 = ((__pyx_v_lev != __pyx_v_level) != 0);
15773       if (!__pyx_t_17) {
15774       } else {
15775         __pyx_t_16 = __pyx_t_17;
15776         goto __pyx_L8_bool_binop_done;
15777       }
15778       __pyx_t_17 = ((__pyx_v_dom != __pyx_v_domain) != 0);
15779       __pyx_t_16 = __pyx_t_17;
15780       __pyx_L8_bool_binop_done:;
15781       if (__pyx_t_16) {
15782         goto __pyx_L5_continue;
15783       }
15784 
15785       /* "yt/geometry/oct_container.pyx":841
15786  *                 dom = domains[i]
15787  *                 if lev != level or dom != domain: continue
15788  *                 count += 1             # <<<<<<<<<<<<<<
15789  *                 if file_inds[i] < 0:
15790  *                     dest[i + offset] = np.nan
15791  */
15792       __pyx_v_count = (__pyx_v_count + 1);
15793 
15794       /* "yt/geometry/oct_container.pyx":842
15795  *                 if lev != level or dom != domain: continue
15796  *                 count += 1
15797  *                 if file_inds[i] < 0:             # <<<<<<<<<<<<<<
15798  *                     dest[i + offset] = np.nan
15799  *                 else:
15800  */
15801       __pyx_t_18 = __pyx_v_i;
15802       __pyx_t_16 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_file_inds.data + __pyx_t_18 * __pyx_v_file_inds.strides[0]) ))) < 0) != 0);
15803       if (__pyx_t_16) {
15804 
15805         /* "yt/geometry/oct_container.pyx":843
15806  *                 count += 1
15807  *                 if file_inds[i] < 0:
15808  *                     dest[i + offset] = np.nan             # <<<<<<<<<<<<<<
15809  *                 else:
15810  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
15811  */
15812         __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 843, __pyx_L1_error)
15813         __Pyx_GOTREF(__pyx_t_5);
15814         __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_nan); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 843, __pyx_L1_error)
15815         __Pyx_GOTREF(__pyx_t_19);
15816         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15817         __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_20 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 843, __pyx_L1_error)
15818         __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
15819         __pyx_t_21 = (__pyx_v_i + __pyx_v_offset);
15820         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_dest.diminfo[0].strides) = __pyx_t_20;
15821 
15822         /* "yt/geometry/oct_container.pyx":842
15823  *                 if lev != level or dom != domain: continue
15824  *                 count += 1
15825  *                 if file_inds[i] < 0:             # <<<<<<<<<<<<<<
15826  *                     dest[i + offset] = np.nan
15827  *                 else:
15828  */
15829         goto __pyx_L10;
15830       }
15831 
15832       /* "yt/geometry/oct_container.pyx":845
15833  *                     dest[i + offset] = np.nan
15834  *                 else:
15835  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]             # <<<<<<<<<<<<<<
15836  *         return count
15837  *
15838  */
15839       /*else*/ {
15840         __pyx_t_22 = __pyx_v_i;
15841         __pyx_t_23 = __pyx_v_i;
15842         __pyx_t_24 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_file_inds.data + __pyx_t_22 * __pyx_v_file_inds.strides[0]) )));
15843         __pyx_t_25 = (*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ (__pyx_v_cell_inds.data + __pyx_t_23 * __pyx_v_cell_inds.strides[0]) )));
15844         __pyx_t_26 = (__pyx_v_i + __pyx_v_offset);
15845         *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_dest.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_dest.diminfo[0].strides) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_source.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_source.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_source.diminfo[1].strides));
15846       }
15847       __pyx_L10:;
15848       __pyx_L5_continue:;
15849     }
15850   }
15851   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15852 
15853   /* "yt/geometry/oct_container.pyx":846
15854  *                 else:
15855  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
15856  *         return count             # <<<<<<<<<<<<<<
15857  *
15858  *     @cython.boundscheck(False)
15859  */
15860   __Pyx_XDECREF(__pyx_r);
15861   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error)
15862   __Pyx_GOTREF(__pyx_t_1);
15863   __pyx_r = __pyx_t_1;
15864   __pyx_t_1 = 0;
15865   goto __pyx_L0;
15866 
15867   /* "yt/geometry/oct_container.pyx":811
15868  *     @cython.wraparound(False)
15869  *     @cython.cdivision(True)
15870  *     def fill_level_with_domain(             # <<<<<<<<<<<<<<
15871  *                    self, int level,
15872  *                    np.uint8_t[:] levels,
15873  */
15874 
15875   /* function exit code */
15876   __pyx_L1_error:;
15877   __Pyx_XDECREF(__pyx_t_1);
15878   __Pyx_XDECREF(__pyx_t_5);
15879   __Pyx_XDECREF(__pyx_t_19);
15880   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15881     __Pyx_PyThreadState_declare
15882     __Pyx_PyThreadState_assign
15883     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15884     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
15885     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
15886   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15887   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.fill_level_with_domain", __pyx_clineno, __pyx_lineno, __pyx_filename);
15888   __pyx_r = NULL;
15889   goto __pyx_L2;
15890   __pyx_L0:;
15891   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dest.rcbuffer->pybuffer);
15892   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_source.rcbuffer->pybuffer);
15893   __pyx_L2:;
15894   __Pyx_XDECREF((PyObject *)__pyx_v_source);
15895   __Pyx_XDECREF((PyObject *)__pyx_v_dest);
15896   __Pyx_XDECREF(__pyx_v_key);
15897   __PYX_XDEC_MEMVIEW(&__pyx_v_levels, 1);
15898   __PYX_XDEC_MEMVIEW(&__pyx_v_cell_inds, 1);
15899   __PYX_XDEC_MEMVIEW(&__pyx_v_file_inds, 1);
15900   __PYX_XDEC_MEMVIEW(&__pyx_v_domains, 1);
15901   __Pyx_XGIVEREF(__pyx_r);
15902   __Pyx_RefNannyFinishContext();
15903   return __pyx_r;
15904 }
15905 
15906 /* "yt/geometry/oct_container.pyx":851
15907  *     @cython.wraparound(False)
15908  *     @cython.cdivision(True)
15909  *     def file_index_octs_with_ghost_zones(             # <<<<<<<<<<<<<<
15910  *             self, SelectorObject selector, int domain_id,
15911  *             int num_cells=1, int n_ghost_zones=1):
15912  */
15913 
15914 /* Python wrapper */
15915 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_47file_index_octs_with_ghost_zones(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15916 static char __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones[] = "Similar as file_index_octs, but returns the level, cell index,\n        file index and domain of the neighbouring cells as well.\n\n        Arguments\n        ---------\n        selector : SelectorObject\n            The selector object. It is expected to select all cells for a given oct.\n        domain_id : int\n            The domain to select. Set to -1 to select all domains.\n        num_cells : int, optional\n            The total number of cells (accounting for a 1-cell thick ghost zone layer).\n\n        Returns\n        -------\n        levels : uint8, shape (num_cells,)\n            The level of each cell of the super oct\n        cell_inds : uint8, shape (num_cells, )\n            The index of each cell of the super oct within its own oct\n        file_inds : int64, shape (num_cells, )\n            The on-file position of the cell. See notes below.\n        domains : int32, shape (num_cells)\n            The domain to which the cells belongs. See notes below.\n\n        Notes\n        -----\n\n        The algorithm constructs a \"super-oct\" around each oct (see sketch below,\n        where the original oct cells are marked with an x).\n\n        Note that for sparse octrees (such as RAMSES'), the neighbouring cells\n        may belong to another domain (this is stored in `domains`). If the dataset\n        provides buffer zones between domains (such as RAMSES), this may be stored\n        locally and can be accessed directly.\n\n\n        +---+---+---+---+\n        |   |   |   |   |\n        |---+---+---+---|\n        |   | x | x |   |\n        |---+---+---+---|\n        |   | x | x |   |\n        |---+---+---+---|\n        |   |   |   |   |\n        +---+---+---+---+\n\n        ";
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_47file_index_octs_with_ghost_zones(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15917 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_47file_index_octs_with_ghost_zones(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15918   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
15919   int __pyx_v_domain_id;
15920   int __pyx_v_num_cells;
15921   int __pyx_v_n_ghost_zones;
15922   PyObject *__pyx_r = 0;
15923   __Pyx_RefNannyDeclarations
15924   __Pyx_RefNannySetupContext("file_index_octs_with_ghost_zones (wrapper)", 0);
15925   {
15926     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_domain_id,&__pyx_n_s_num_cells,&__pyx_n_s_n_ghost_zones,0};
15927     PyObject* values[4] = {0,0,0,0};
15928     if (unlikely(__pyx_kwds)) {
15929       Py_ssize_t kw_args;
15930       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15931       switch (pos_args) {
15932         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15933         CYTHON_FALLTHROUGH;
15934         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15935         CYTHON_FALLTHROUGH;
15936         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15937         CYTHON_FALLTHROUGH;
15938         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15939         CYTHON_FALLTHROUGH;
15940         case  0: break;
15941         default: goto __pyx_L5_argtuple_error;
15942       }
15943       kw_args = PyDict_Size(__pyx_kwds);
15944       switch (pos_args) {
15945         case  0:
15946         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
15947         else goto __pyx_L5_argtuple_error;
15948         CYTHON_FALLTHROUGH;
15949         case  1:
15950         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--;
15951         else {
15952           __Pyx_RaiseArgtupleInvalid("file_index_octs_with_ghost_zones", 0, 2, 4, 1); __PYX_ERR(0, 851, __pyx_L3_error)
15953         }
15954         CYTHON_FALLTHROUGH;
15955         case  2:
15956         if (kw_args > 0) {
15957           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_cells);
15958           if (value) { values[2] = value; kw_args--; }
15959         }
15960         CYTHON_FALLTHROUGH;
15961         case  3:
15962         if (kw_args > 0) {
15963           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n_ghost_zones);
15964           if (value) { values[3] = value; kw_args--; }
15965         }
15966       }
15967       if (unlikely(kw_args > 0)) {
15968         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_index_octs_with_ghost_zones") < 0)) __PYX_ERR(0, 851, __pyx_L3_error)
15969       }
15970     } else {
15971       switch (PyTuple_GET_SIZE(__pyx_args)) {
15972         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15973         CYTHON_FALLTHROUGH;
15974         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15975         CYTHON_FALLTHROUGH;
15976         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15977         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15978         break;
15979         default: goto __pyx_L5_argtuple_error;
15980       }
15981     }
15982     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
15983     __pyx_v_domain_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_domain_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L3_error)
15984     if (values[2]) {
15985       __pyx_v_num_cells = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_num_cells == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L3_error)
15986     } else {
15987       __pyx_v_num_cells = ((int)1);
15988     }
15989     if (values[3]) {
15990       __pyx_v_n_ghost_zones = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_n_ghost_zones == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L3_error)
15991     } else {
15992       __pyx_v_n_ghost_zones = ((int)1);
15993     }
15994   }
15995   goto __pyx_L4_argument_unpacking_done;
15996   __pyx_L5_argtuple_error:;
15997   __Pyx_RaiseArgtupleInvalid("file_index_octs_with_ghost_zones", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 851, __pyx_L3_error)
15998   __pyx_L3_error:;
15999   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.file_index_octs_with_ghost_zones", __pyx_clineno, __pyx_lineno, __pyx_filename);
16000   __Pyx_RefNannyFinishContext();
16001   return NULL;
16002   __pyx_L4_argument_unpacking_done:;
16003   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 852, __pyx_L1_error)
16004   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_selector, __pyx_v_domain_id, __pyx_v_num_cells, __pyx_v_n_ghost_zones);
16005 
16006   /* function exit code */
16007   goto __pyx_L0;
16008   __pyx_L1_error:;
16009   __pyx_r = NULL;
16010   __pyx_L0:;
16011   __Pyx_RefNannyFinishContext();
16012   return __pyx_r;
16013 }
16014 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,int __pyx_v_domain_id,int __pyx_v_num_cells,int __pyx_v_n_ghost_zones)16015 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, int __pyx_v_domain_id, int __pyx_v_num_cells, int __pyx_v_n_ghost_zones) {
16016   int __pyx_v_num_octs;
16017   struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *__pyx_v_visitor = 0;
16018   PyArrayObject *__pyx_v_levels = 0;
16019   PyArrayObject *__pyx_v_cell_inds = 0;
16020   PyArrayObject *__pyx_v_file_inds = 0;
16021   PyArrayObject *__pyx_v_domains = 0;
16022   __Pyx_LocalBuf_ND __pyx_pybuffernd_cell_inds;
16023   __Pyx_Buffer __pyx_pybuffer_cell_inds;
16024   __Pyx_LocalBuf_ND __pyx_pybuffernd_domains;
16025   __Pyx_Buffer __pyx_pybuffer_domains;
16026   __Pyx_LocalBuf_ND __pyx_pybuffernd_file_inds;
16027   __Pyx_Buffer __pyx_pybuffer_file_inds;
16028   __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
16029   __Pyx_Buffer __pyx_pybuffer_levels;
16030   PyObject *__pyx_r = NULL;
16031   __Pyx_RefNannyDeclarations
16032   int __pyx_t_1;
16033   PyObject *__pyx_t_2 = NULL;
16034   PyObject *__pyx_t_3 = NULL;
16035   PyObject *__pyx_t_4 = NULL;
16036   PyObject *__pyx_t_5 = NULL;
16037   int __pyx_t_6;
16038   PyObject *__pyx_t_7 = NULL;
16039   PyArrayObject *__pyx_t_8 = NULL;
16040   PyObject *__pyx_t_9 = NULL;
16041   PyObject *__pyx_t_10 = NULL;
16042   PyObject *__pyx_t_11 = NULL;
16043   PyArrayObject *__pyx_t_12 = NULL;
16044   PyArrayObject *__pyx_t_13 = NULL;
16045   PyArrayObject *__pyx_t_14 = NULL;
16046   __Pyx_memviewslice __pyx_t_15 = { 0, 0, { 0 }, { 0 }, { 0 } };
16047   __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
16048   __Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
16049   __Pyx_RefNannySetupContext("file_index_octs_with_ghost_zones", 0);
16050   __pyx_pybuffer_levels.pybuffer.buf = NULL;
16051   __pyx_pybuffer_levels.refcount = 0;
16052   __pyx_pybuffernd_levels.data = NULL;
16053   __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
16054   __pyx_pybuffer_cell_inds.pybuffer.buf = NULL;
16055   __pyx_pybuffer_cell_inds.refcount = 0;
16056   __pyx_pybuffernd_cell_inds.data = NULL;
16057   __pyx_pybuffernd_cell_inds.rcbuffer = &__pyx_pybuffer_cell_inds;
16058   __pyx_pybuffer_file_inds.pybuffer.buf = NULL;
16059   __pyx_pybuffer_file_inds.refcount = 0;
16060   __pyx_pybuffernd_file_inds.data = NULL;
16061   __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds;
16062   __pyx_pybuffer_domains.pybuffer.buf = NULL;
16063   __pyx_pybuffer_domains.refcount = 0;
16064   __pyx_pybuffernd_domains.data = NULL;
16065   __pyx_pybuffernd_domains.rcbuffer = &__pyx_pybuffer_domains;
16066 
16067   /* "yt/geometry/oct_container.pyx":902
16068  *         cdef np.int64_t i
16069  *         cdef int num_octs
16070  *         if num_cells < 0:             # <<<<<<<<<<<<<<
16071  *             num_octs = selector.count_octs(self, domain_id)
16072  *             num_cells = num_octs * 4**3
16073  */
16074   __pyx_t_1 = ((__pyx_v_num_cells < 0) != 0);
16075   if (__pyx_t_1) {
16076 
16077     /* "yt/geometry/oct_container.pyx":903
16078  *         cdef int num_octs
16079  *         if num_cells < 0:
16080  *             num_octs = selector.count_octs(self, domain_id)             # <<<<<<<<<<<<<<
16081  *             num_cells = num_octs * 4**3
16082  *         cdef NeighbourCellVisitor visitor
16083  */
16084     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_selector), __pyx_n_s_count_octs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
16085     __Pyx_GOTREF(__pyx_t_3);
16086     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_domain_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 903, __pyx_L1_error)
16087     __Pyx_GOTREF(__pyx_t_4);
16088     __pyx_t_5 = NULL;
16089     __pyx_t_6 = 0;
16090     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
16091       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
16092       if (likely(__pyx_t_5)) {
16093         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
16094         __Pyx_INCREF(__pyx_t_5);
16095         __Pyx_INCREF(function);
16096         __Pyx_DECREF_SET(__pyx_t_3, function);
16097         __pyx_t_6 = 1;
16098       }
16099     }
16100     #if CYTHON_FAST_PYCALL
16101     if (PyFunction_Check(__pyx_t_3)) {
16102       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
16103       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
16104       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16105       __Pyx_GOTREF(__pyx_t_2);
16106       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16107     } else
16108     #endif
16109     #if CYTHON_FAST_PYCCALL
16110     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
16111       PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_t_4};
16112       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
16113       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16114       __Pyx_GOTREF(__pyx_t_2);
16115       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16116     } else
16117     #endif
16118     {
16119       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 903, __pyx_L1_error)
16120       __Pyx_GOTREF(__pyx_t_7);
16121       if (__pyx_t_5) {
16122         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
16123       }
16124       __Pyx_INCREF(((PyObject *)__pyx_v_self));
16125       __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16126       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
16127       __Pyx_GIVEREF(__pyx_t_4);
16128       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
16129       __pyx_t_4 = 0;
16130       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
16131       __Pyx_GOTREF(__pyx_t_2);
16132       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16133     }
16134     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16135     __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 903, __pyx_L1_error)
16136     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16137     __pyx_v_num_octs = __pyx_t_6;
16138 
16139     /* "yt/geometry/oct_container.pyx":904
16140  *         if num_cells < 0:
16141  *             num_octs = selector.count_octs(self, domain_id)
16142  *             num_cells = num_octs * 4**3             # <<<<<<<<<<<<<<
16143  *         cdef NeighbourCellVisitor visitor
16144  *
16145  */
16146     __pyx_v_num_cells = (__pyx_v_num_octs * 64);
16147 
16148     /* "yt/geometry/oct_container.pyx":902
16149  *         cdef np.int64_t i
16150  *         cdef int num_octs
16151  *         if num_cells < 0:             # <<<<<<<<<<<<<<
16152  *             num_octs = selector.count_octs(self, domain_id)
16153  *             num_cells = num_octs * 4**3
16154  */
16155   }
16156 
16157   /* "yt/geometry/oct_container.pyx":911
16158  *         cdef np.ndarray[np.int64_t, ndim=1] file_inds
16159  *         cdef np.ndarray[np.int32_t, ndim=1] domains
16160  *         levels = np.full(num_cells, 255, dtype="uint8")             # <<<<<<<<<<<<<<
16161  *         file_inds = np.full(num_cells, -1, dtype="int64")
16162  *         cell_inds = np.full(num_cells, 8, dtype="uint8")
16163  */
16164   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
16165   __Pyx_GOTREF(__pyx_t_2);
16166   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 911, __pyx_L1_error)
16167   __Pyx_GOTREF(__pyx_t_3);
16168   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16169   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
16170   __Pyx_GOTREF(__pyx_t_2);
16171   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 911, __pyx_L1_error)
16172   __Pyx_GOTREF(__pyx_t_7);
16173   __Pyx_GIVEREF(__pyx_t_2);
16174   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
16175   __Pyx_INCREF(__pyx_int_255);
16176   __Pyx_GIVEREF(__pyx_int_255);
16177   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_255);
16178   __pyx_t_2 = 0;
16179   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
16180   __Pyx_GOTREF(__pyx_t_2);
16181   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
16182   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L1_error)
16183   __Pyx_GOTREF(__pyx_t_4);
16184   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16185   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16186   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16187   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 911, __pyx_L1_error)
16188   __pyx_t_8 = ((PyArrayObject *)__pyx_t_4);
16189   {
16190     __Pyx_BufFmt_StackElem __pyx_stack[1];
16191     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
16192     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16193     if (unlikely(__pyx_t_6 < 0)) {
16194       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
16195       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16196         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
16197         __Pyx_RaiseBufferFallbackError();
16198       } else {
16199         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
16200       }
16201       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
16202     }
16203     __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0];
16204     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 911, __pyx_L1_error)
16205   }
16206   __pyx_t_8 = 0;
16207   __pyx_v_levels = ((PyArrayObject *)__pyx_t_4);
16208   __pyx_t_4 = 0;
16209 
16210   /* "yt/geometry/oct_container.pyx":912
16211  *         cdef np.ndarray[np.int32_t, ndim=1] domains
16212  *         levels = np.full(num_cells, 255, dtype="uint8")
16213  *         file_inds = np.full(num_cells, -1, dtype="int64")             # <<<<<<<<<<<<<<
16214  *         cell_inds = np.full(num_cells, 8, dtype="uint8")
16215  *         domains = np.full(num_cells, -1, dtype="int32")
16216  */
16217   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
16218   __Pyx_GOTREF(__pyx_t_4);
16219   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error)
16220   __Pyx_GOTREF(__pyx_t_2);
16221   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16222   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_num_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
16223   __Pyx_GOTREF(__pyx_t_4);
16224   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error)
16225   __Pyx_GOTREF(__pyx_t_7);
16226   __Pyx_GIVEREF(__pyx_t_4);
16227   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
16228   __Pyx_INCREF(__pyx_int_neg_1);
16229   __Pyx_GIVEREF(__pyx_int_neg_1);
16230   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
16231   __pyx_t_4 = 0;
16232   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
16233   __Pyx_GOTREF(__pyx_t_4);
16234   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
16235   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
16236   __Pyx_GOTREF(__pyx_t_3);
16237   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16238   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16239   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16240   if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 912, __pyx_L1_error)
16241   __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
16242   {
16243     __Pyx_BufFmt_StackElem __pyx_stack[1];
16244     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
16245     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16246     if (unlikely(__pyx_t_6 < 0)) {
16247       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
16248       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16249         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
16250         __Pyx_RaiseBufferFallbackError();
16251       } else {
16252         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
16253       }
16254       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
16255     }
16256     __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0];
16257     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
16258   }
16259   __pyx_t_12 = 0;
16260   __pyx_v_file_inds = ((PyArrayObject *)__pyx_t_3);
16261   __pyx_t_3 = 0;
16262 
16263   /* "yt/geometry/oct_container.pyx":913
16264  *         levels = np.full(num_cells, 255, dtype="uint8")
16265  *         file_inds = np.full(num_cells, -1, dtype="int64")
16266  *         cell_inds = np.full(num_cells, 8, dtype="uint8")             # <<<<<<<<<<<<<<
16267  *         domains = np.full(num_cells, -1, dtype="int32")
16268  *
16269  */
16270   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
16271   __Pyx_GOTREF(__pyx_t_3);
16272   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_full); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 913, __pyx_L1_error)
16273   __Pyx_GOTREF(__pyx_t_4);
16274   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16275   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_num_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
16276   __Pyx_GOTREF(__pyx_t_3);
16277   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 913, __pyx_L1_error)
16278   __Pyx_GOTREF(__pyx_t_7);
16279   __Pyx_GIVEREF(__pyx_t_3);
16280   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
16281   __Pyx_INCREF(__pyx_int_8);
16282   __Pyx_GIVEREF(__pyx_int_8);
16283   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_8);
16284   __pyx_t_3 = 0;
16285   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
16286   __Pyx_GOTREF(__pyx_t_3);
16287   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_uint8) < 0) __PYX_ERR(0, 913, __pyx_L1_error)
16288   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
16289   __Pyx_GOTREF(__pyx_t_2);
16290   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16291   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16292   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16293   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 913, __pyx_L1_error)
16294   __pyx_t_13 = ((PyArrayObject *)__pyx_t_2);
16295   {
16296     __Pyx_BufFmt_StackElem __pyx_stack[1];
16297     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
16298     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16299     if (unlikely(__pyx_t_6 < 0)) {
16300       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
16301       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16302         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
16303         __Pyx_RaiseBufferFallbackError();
16304       } else {
16305         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
16306       }
16307       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
16308     }
16309     __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0];
16310     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 913, __pyx_L1_error)
16311   }
16312   __pyx_t_13 = 0;
16313   __pyx_v_cell_inds = ((PyArrayObject *)__pyx_t_2);
16314   __pyx_t_2 = 0;
16315 
16316   /* "yt/geometry/oct_container.pyx":914
16317  *         file_inds = np.full(num_cells, -1, dtype="int64")
16318  *         cell_inds = np.full(num_cells, 8, dtype="uint8")
16319  *         domains = np.full(num_cells, -1, dtype="int32")             # <<<<<<<<<<<<<<
16320  *
16321  *         visitor = NeighbourCellVisitor(self, -1, n_ghost_zones)
16322  */
16323   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
16324   __Pyx_GOTREF(__pyx_t_2);
16325   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
16326   __Pyx_GOTREF(__pyx_t_3);
16327   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16328   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
16329   __Pyx_GOTREF(__pyx_t_2);
16330   __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 914, __pyx_L1_error)
16331   __Pyx_GOTREF(__pyx_t_7);
16332   __Pyx_GIVEREF(__pyx_t_2);
16333   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
16334   __Pyx_INCREF(__pyx_int_neg_1);
16335   __Pyx_GIVEREF(__pyx_int_neg_1);
16336   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_neg_1);
16337   __pyx_t_2 = 0;
16338   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
16339   __Pyx_GOTREF(__pyx_t_2);
16340   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 914, __pyx_L1_error)
16341   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 914, __pyx_L1_error)
16342   __Pyx_GOTREF(__pyx_t_4);
16343   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16344   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16345   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16346   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 914, __pyx_L1_error)
16347   __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
16348   {
16349     __Pyx_BufFmt_StackElem __pyx_stack[1];
16350     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domains.rcbuffer->pybuffer);
16351     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domains.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16352     if (unlikely(__pyx_t_6 < 0)) {
16353       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
16354       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domains.rcbuffer->pybuffer, (PyObject*)__pyx_v_domains, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16355         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
16356         __Pyx_RaiseBufferFallbackError();
16357       } else {
16358         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
16359       }
16360       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
16361     }
16362     __pyx_pybuffernd_domains.diminfo[0].strides = __pyx_pybuffernd_domains.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domains.diminfo[0].shape = __pyx_pybuffernd_domains.rcbuffer->pybuffer.shape[0];
16363     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 914, __pyx_L1_error)
16364   }
16365   __pyx_t_14 = 0;
16366   __pyx_v_domains = ((PyArrayObject *)__pyx_t_4);
16367   __pyx_t_4 = 0;
16368 
16369   /* "yt/geometry/oct_container.pyx":916
16370  *         domains = np.full(num_cells, -1, dtype="int32")
16371  *
16372  *         visitor = NeighbourCellVisitor(self, -1, n_ghost_zones)             # <<<<<<<<<<<<<<
16373  *         # output: level, file_ind and cell_ind of the neighbouring cells
16374  *         visitor.levels = levels
16375  */
16376   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_ghost_zones); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error)
16377   __Pyx_GOTREF(__pyx_t_4);
16378   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
16379   __Pyx_GOTREF(__pyx_t_2);
16380   __Pyx_INCREF(((PyObject *)__pyx_v_self));
16381   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16382   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
16383   __Pyx_INCREF(__pyx_int_neg_1);
16384   __Pyx_GIVEREF(__pyx_int_neg_1);
16385   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1);
16386   __Pyx_GIVEREF(__pyx_t_4);
16387   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
16388   __pyx_t_4 = 0;
16389   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error)
16390   __Pyx_GOTREF(__pyx_t_4);
16391   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16392   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *)__pyx_t_4);
16393   __pyx_t_4 = 0;
16394 
16395   /* "yt/geometry/oct_container.pyx":918
16396  *         visitor = NeighbourCellVisitor(self, -1, n_ghost_zones)
16397  *         # output: level, file_ind and cell_ind of the neighbouring cells
16398  *         visitor.levels = levels             # <<<<<<<<<<<<<<
16399  *         visitor.file_inds = file_inds
16400  *         visitor.cell_inds = cell_inds
16401  */
16402   __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_levels), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 918, __pyx_L1_error)
16403   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->levels, 0);
16404   __pyx_v_visitor->levels = __pyx_t_15;
16405   __pyx_t_15.memview = NULL;
16406   __pyx_t_15.data = NULL;
16407 
16408   /* "yt/geometry/oct_container.pyx":919
16409  *         # output: level, file_ind and cell_ind of the neighbouring cells
16410  *         visitor.levels = levels
16411  *         visitor.file_inds = file_inds             # <<<<<<<<<<<<<<
16412  *         visitor.cell_inds = cell_inds
16413  *         visitor.domains = domains
16414  */
16415   __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_file_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 919, __pyx_L1_error)
16416   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->file_inds, 0);
16417   __pyx_v_visitor->file_inds = __pyx_t_16;
16418   __pyx_t_16.memview = NULL;
16419   __pyx_t_16.data = NULL;
16420 
16421   /* "yt/geometry/oct_container.pyx":920
16422  *         visitor.levels = levels
16423  *         visitor.file_inds = file_inds
16424  *         visitor.cell_inds = cell_inds             # <<<<<<<<<<<<<<
16425  *         visitor.domains = domains
16426  *         # direction to explore and extra parameters of the visitor
16427  */
16428   __pyx_t_15 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(((PyObject *)__pyx_v_cell_inds), PyBUF_WRITABLE); if (unlikely(!__pyx_t_15.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
16429   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->cell_inds, 0);
16430   __pyx_v_visitor->cell_inds = __pyx_t_15;
16431   __pyx_t_15.memview = NULL;
16432   __pyx_t_15.data = NULL;
16433 
16434   /* "yt/geometry/oct_container.pyx":921
16435  *         visitor.file_inds = file_inds
16436  *         visitor.cell_inds = cell_inds
16437  *         visitor.domains = domains             # <<<<<<<<<<<<<<
16438  *         # direction to explore and extra parameters of the visitor
16439  *         visitor.octree = self
16440  */
16441   __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(((PyObject *)__pyx_v_domains), PyBUF_WRITABLE); if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 921, __pyx_L1_error)
16442   __PYX_XDEC_MEMVIEW(&__pyx_v_visitor->domains, 0);
16443   __pyx_v_visitor->domains = __pyx_t_17;
16444   __pyx_t_17.memview = NULL;
16445   __pyx_t_17.data = NULL;
16446 
16447   /* "yt/geometry/oct_container.pyx":923
16448  *         visitor.domains = domains
16449  *         # direction to explore and extra parameters of the visitor
16450  *         visitor.octree = self             # <<<<<<<<<<<<<<
16451  *         visitor.last = -1
16452  *
16453  */
16454   __Pyx_INCREF(((PyObject *)__pyx_v_self));
16455   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16456   __Pyx_GOTREF(__pyx_v_visitor->__pyx_base.octree);
16457   __Pyx_DECREF(((PyObject *)__pyx_v_visitor->__pyx_base.octree));
16458   __pyx_v_visitor->__pyx_base.octree = __pyx_v_self;
16459 
16460   /* "yt/geometry/oct_container.pyx":924
16461  *         # direction to explore and extra parameters of the visitor
16462  *         visitor.octree = self
16463  *         visitor.last = -1             # <<<<<<<<<<<<<<
16464  *
16465  *         # Compute indices
16466  */
16467   __pyx_v_visitor->__pyx_base.__pyx_base.last = -1LL;
16468 
16469   /* "yt/geometry/oct_container.pyx":927
16470  *
16471  *         # Compute indices
16472  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
16473  *
16474  *         return levels, cell_inds, file_inds, domains
16475  */
16476   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
16477 
16478   /* "yt/geometry/oct_container.pyx":929
16479  *         self.visit_all_octs(selector, visitor)
16480  *
16481  *         return levels, cell_inds, file_inds, domains             # <<<<<<<<<<<<<<
16482  *
16483  *     def finalize(self):
16484  */
16485   __Pyx_XDECREF(__pyx_r);
16486   __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error)
16487   __Pyx_GOTREF(__pyx_t_4);
16488   __Pyx_INCREF(((PyObject *)__pyx_v_levels));
16489   __Pyx_GIVEREF(((PyObject *)__pyx_v_levels));
16490   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_levels));
16491   __Pyx_INCREF(((PyObject *)__pyx_v_cell_inds));
16492   __Pyx_GIVEREF(((PyObject *)__pyx_v_cell_inds));
16493   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_cell_inds));
16494   __Pyx_INCREF(((PyObject *)__pyx_v_file_inds));
16495   __Pyx_GIVEREF(((PyObject *)__pyx_v_file_inds));
16496   PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_file_inds));
16497   __Pyx_INCREF(((PyObject *)__pyx_v_domains));
16498   __Pyx_GIVEREF(((PyObject *)__pyx_v_domains));
16499   PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_domains));
16500   __pyx_r = __pyx_t_4;
16501   __pyx_t_4 = 0;
16502   goto __pyx_L0;
16503 
16504   /* "yt/geometry/oct_container.pyx":851
16505  *     @cython.wraparound(False)
16506  *     @cython.cdivision(True)
16507  *     def file_index_octs_with_ghost_zones(             # <<<<<<<<<<<<<<
16508  *             self, SelectorObject selector, int domain_id,
16509  *             int num_cells=1, int n_ghost_zones=1):
16510  */
16511 
16512   /* function exit code */
16513   __pyx_L1_error:;
16514   __Pyx_XDECREF(__pyx_t_2);
16515   __Pyx_XDECREF(__pyx_t_3);
16516   __Pyx_XDECREF(__pyx_t_4);
16517   __Pyx_XDECREF(__pyx_t_5);
16518   __Pyx_XDECREF(__pyx_t_7);
16519   __PYX_XDEC_MEMVIEW(&__pyx_t_15, 1);
16520   __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
16521   __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
16522   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16523     __Pyx_PyThreadState_declare
16524     __Pyx_PyThreadState_assign
16525     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16526     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
16527     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domains.rcbuffer->pybuffer);
16528     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
16529     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
16530   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16531   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.file_index_octs_with_ghost_zones", __pyx_clineno, __pyx_lineno, __pyx_filename);
16532   __pyx_r = NULL;
16533   goto __pyx_L2;
16534   __pyx_L0:;
16535   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
16536   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domains.rcbuffer->pybuffer);
16537   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
16538   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
16539   __pyx_L2:;
16540   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
16541   __Pyx_XDECREF((PyObject *)__pyx_v_levels);
16542   __Pyx_XDECREF((PyObject *)__pyx_v_cell_inds);
16543   __Pyx_XDECREF((PyObject *)__pyx_v_file_inds);
16544   __Pyx_XDECREF((PyObject *)__pyx_v_domains);
16545   __Pyx_XGIVEREF(__pyx_r);
16546   __Pyx_RefNannyFinishContext();
16547   return __pyx_r;
16548 }
16549 
16550 /* "yt/geometry/oct_container.pyx":931
16551  *         return levels, cell_inds, file_inds, domains
16552  *
16553  *     def finalize(self):             # <<<<<<<<<<<<<<
16554  *         cdef SelectorObject selector = AlwaysSelector(None)
16555  *         cdef oct_visitors.AssignDomainInd visitor
16556  */
16557 
16558 /* Python wrapper */
16559 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_49finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_49finalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)16560 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_49finalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16561   PyObject *__pyx_r = 0;
16562   __Pyx_RefNannyDeclarations
16563   __Pyx_RefNannySetupContext("finalize (wrapper)", 0);
16564   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_48finalize(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16565 
16566   /* function exit code */
16567   __Pyx_RefNannyFinishContext();
16568   return __pyx_r;
16569 }
16570 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_48finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16571 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_48finalize(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16572   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
16573   struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_v_visitor = 0;
16574   PyObject *__pyx_r = NULL;
16575   __Pyx_RefNannyDeclarations
16576   PyObject *__pyx_t_1 = NULL;
16577   PyObject *__pyx_t_2 = NULL;
16578   __Pyx_RefNannySetupContext("finalize", 0);
16579 
16580   /* "yt/geometry/oct_container.pyx":932
16581  *
16582  *     def finalize(self):
16583  *         cdef SelectorObject selector = AlwaysSelector(None)             # <<<<<<<<<<<<<<
16584  *         cdef oct_visitors.AssignDomainInd visitor
16585  *         visitor = oct_visitors.AssignDomainInd(self, 1)
16586  */
16587   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
16588   __Pyx_GOTREF(__pyx_t_1);
16589   __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_1);
16590   __pyx_t_1 = 0;
16591 
16592   /* "yt/geometry/oct_container.pyx":934
16593  *         cdef SelectorObject selector = AlwaysSelector(None)
16594  *         cdef oct_visitors.AssignDomainInd visitor
16595  *         visitor = oct_visitors.AssignDomainInd(self, 1)             # <<<<<<<<<<<<<<
16596  *         self.visit_all_octs(selector, visitor)
16597  *         assert ((visitor.global_index+1)*visitor.nz == visitor.index)
16598  */
16599   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
16600   __Pyx_GOTREF(__pyx_t_1);
16601   __Pyx_INCREF(((PyObject *)__pyx_v_self));
16602   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16603   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
16604   __Pyx_INCREF(__pyx_int_1);
16605   __Pyx_GIVEREF(__pyx_int_1);
16606   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_1);
16607   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 934, __pyx_L1_error)
16608   __Pyx_GOTREF(__pyx_t_2);
16609   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16610   __pyx_v_visitor = ((struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd *)__pyx_t_2);
16611   __pyx_t_2 = 0;
16612 
16613   /* "yt/geometry/oct_container.pyx":935
16614  *         cdef oct_visitors.AssignDomainInd visitor
16615  *         visitor = oct_visitors.AssignDomainInd(self, 1)
16616  *         self.visit_all_octs(selector, visitor)             # <<<<<<<<<<<<<<
16617  *         assert ((visitor.global_index+1)*visitor.nz == visitor.index)
16618  *
16619  */
16620   ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self->__pyx_vtab)->visit_all_octs(__pyx_v_self, __pyx_v_selector, ((struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *)__pyx_v_visitor), NULL);
16621 
16622   /* "yt/geometry/oct_container.pyx":936
16623  *         visitor = oct_visitors.AssignDomainInd(self, 1)
16624  *         self.visit_all_octs(selector, visitor)
16625  *         assert ((visitor.global_index+1)*visitor.nz == visitor.index)             # <<<<<<<<<<<<<<
16626  *
16627  * cdef int root_node_compare(const void *a, const void *b) nogil:
16628  */
16629   #ifndef CYTHON_WITHOUT_ASSERTIONS
16630   if (unlikely(!Py_OptimizeFlag)) {
16631     if (unlikely(!((((__pyx_v_visitor->__pyx_base.global_index + 1) * __pyx_v_visitor->__pyx_base.nz) == __pyx_v_visitor->__pyx_base.index) != 0))) {
16632       PyErr_SetNone(PyExc_AssertionError);
16633       __PYX_ERR(0, 936, __pyx_L1_error)
16634     }
16635   }
16636   #endif
16637 
16638   /* "yt/geometry/oct_container.pyx":931
16639  *         return levels, cell_inds, file_inds, domains
16640  *
16641  *     def finalize(self):             # <<<<<<<<<<<<<<
16642  *         cdef SelectorObject selector = AlwaysSelector(None)
16643  *         cdef oct_visitors.AssignDomainInd visitor
16644  */
16645 
16646   /* function exit code */
16647   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16648   goto __pyx_L0;
16649   __pyx_L1_error:;
16650   __Pyx_XDECREF(__pyx_t_1);
16651   __Pyx_XDECREF(__pyx_t_2);
16652   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.finalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
16653   __pyx_r = NULL;
16654   __pyx_L0:;
16655   __Pyx_XDECREF((PyObject *)__pyx_v_selector);
16656   __Pyx_XDECREF((PyObject *)__pyx_v_visitor);
16657   __Pyx_XGIVEREF(__pyx_r);
16658   __Pyx_RefNannyFinishContext();
16659   return __pyx_r;
16660 }
16661 
16662 /* "yt/geometry/oct_container.pxd":56
16663  *
16664  * cdef class OctreeContainer:
16665  *     cdef public OctObjectPool domains             # <<<<<<<<<<<<<<
16666  *     cdef Oct ****root_mesh
16667  *     cdef int partial_coverage
16668  */
16669 
16670 /* Python wrapper */
16671 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(PyObject * __pyx_v_self)16672 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(PyObject *__pyx_v_self) {
16673   PyObject *__pyx_r = 0;
16674   __Pyx_RefNannyDeclarations
16675   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16676   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16677 
16678   /* function exit code */
16679   __Pyx_RefNannyFinishContext();
16680   return __pyx_r;
16681 }
16682 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16683 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16684   PyObject *__pyx_r = NULL;
16685   __Pyx_RefNannyDeclarations
16686   __Pyx_RefNannySetupContext("__get__", 0);
16687   __Pyx_XDECREF(__pyx_r);
16688   __Pyx_INCREF(((PyObject *)__pyx_v_self->domains));
16689   __pyx_r = ((PyObject *)__pyx_v_self->domains);
16690   goto __pyx_L0;
16691 
16692   /* function exit code */
16693   __pyx_L0:;
16694   __Pyx_XGIVEREF(__pyx_r);
16695   __Pyx_RefNannyFinishContext();
16696   return __pyx_r;
16697 }
16698 
16699 /* Python wrapper */
16700 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)16701 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
16702   int __pyx_r;
16703   __Pyx_RefNannyDeclarations
16704   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16705   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));
16706 
16707   /* function exit code */
16708   __Pyx_RefNannyFinishContext();
16709   return __pyx_r;
16710 }
16711 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_value)16712 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) {
16713   int __pyx_r;
16714   __Pyx_RefNannyDeclarations
16715   PyObject *__pyx_t_1 = NULL;
16716   __Pyx_RefNannySetupContext("__set__", 0);
16717   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool))))) __PYX_ERR(2, 56, __pyx_L1_error)
16718   __pyx_t_1 = __pyx_v_value;
16719   __Pyx_INCREF(__pyx_t_1);
16720   __Pyx_GIVEREF(__pyx_t_1);
16721   __Pyx_GOTREF(__pyx_v_self->domains);
16722   __Pyx_DECREF(((PyObject *)__pyx_v_self->domains));
16723   __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_1);
16724   __pyx_t_1 = 0;
16725 
16726   /* function exit code */
16727   __pyx_r = 0;
16728   goto __pyx_L0;
16729   __pyx_L1_error:;
16730   __Pyx_XDECREF(__pyx_t_1);
16731   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.domains.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16732   __pyx_r = -1;
16733   __pyx_L0:;
16734   __Pyx_RefNannyFinishContext();
16735   return __pyx_r;
16736 }
16737 
16738 /* Python wrapper */
16739 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(PyObject * __pyx_v_self)16740 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(PyObject *__pyx_v_self) {
16741   int __pyx_r;
16742   __Pyx_RefNannyDeclarations
16743   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
16744   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16745 
16746   /* function exit code */
16747   __Pyx_RefNannyFinishContext();
16748   return __pyx_r;
16749 }
16750 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16751 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_7domains_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16752   int __pyx_r;
16753   __Pyx_RefNannyDeclarations
16754   __Pyx_RefNannySetupContext("__del__", 0);
16755   __Pyx_INCREF(Py_None);
16756   __Pyx_GIVEREF(Py_None);
16757   __Pyx_GOTREF(__pyx_v_self->domains);
16758   __Pyx_DECREF(((PyObject *)__pyx_v_self->domains));
16759   __pyx_v_self->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None);
16760 
16761   /* function exit code */
16762   __pyx_r = 0;
16763   __Pyx_RefNannyFinishContext();
16764   return __pyx_r;
16765 }
16766 
16767 /* "yt/geometry/oct_container.pxd":64
16768  *     cdef np.float64_t DLE[3]
16769  *     cdef np.float64_t DRE[3]
16770  *     cdef public np.int64_t nocts             # <<<<<<<<<<<<<<
16771  *     cdef public int num_domains
16772  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,
16773  */
16774 
16775 /* Python wrapper */
16776 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_1__get__(PyObject * __pyx_v_self)16777 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_1__get__(PyObject *__pyx_v_self) {
16778   PyObject *__pyx_r = 0;
16779   __Pyx_RefNannyDeclarations
16780   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16781   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16782 
16783   /* function exit code */
16784   __Pyx_RefNannyFinishContext();
16785   return __pyx_r;
16786 }
16787 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16788 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16789   PyObject *__pyx_r = NULL;
16790   __Pyx_RefNannyDeclarations
16791   PyObject *__pyx_t_1 = NULL;
16792   __Pyx_RefNannySetupContext("__get__", 0);
16793   __Pyx_XDECREF(__pyx_r);
16794   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_self->nocts); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 64, __pyx_L1_error)
16795   __Pyx_GOTREF(__pyx_t_1);
16796   __pyx_r = __pyx_t_1;
16797   __pyx_t_1 = 0;
16798   goto __pyx_L0;
16799 
16800   /* function exit code */
16801   __pyx_L1_error:;
16802   __Pyx_XDECREF(__pyx_t_1);
16803   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.nocts.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16804   __pyx_r = NULL;
16805   __pyx_L0:;
16806   __Pyx_XGIVEREF(__pyx_r);
16807   __Pyx_RefNannyFinishContext();
16808   return __pyx_r;
16809 }
16810 
16811 /* Python wrapper */
16812 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)16813 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
16814   int __pyx_r;
16815   __Pyx_RefNannyDeclarations
16816   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16817   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_2__set__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));
16818 
16819   /* function exit code */
16820   __Pyx_RefNannyFinishContext();
16821   return __pyx_r;
16822 }
16823 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_value)16824 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) {
16825   int __pyx_r;
16826   __Pyx_RefNannyDeclarations
16827   __pyx_t_5numpy_int64_t __pyx_t_1;
16828   __Pyx_RefNannySetupContext("__set__", 0);
16829   __pyx_t_1 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_1 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(2, 64, __pyx_L1_error)
16830   __pyx_v_self->nocts = __pyx_t_1;
16831 
16832   /* function exit code */
16833   __pyx_r = 0;
16834   goto __pyx_L0;
16835   __pyx_L1_error:;
16836   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.nocts.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16837   __pyx_r = -1;
16838   __pyx_L0:;
16839   __Pyx_RefNannyFinishContext();
16840   return __pyx_r;
16841 }
16842 
16843 /* "yt/geometry/oct_container.pxd":65
16844  *     cdef np.float64_t DRE[3]
16845  *     cdef public np.int64_t nocts
16846  *     cdef public int num_domains             # <<<<<<<<<<<<<<
16847  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,
16848  *                   int max_level = ?) nogil
16849  */
16850 
16851 /* Python wrapper */
16852 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_1__get__(PyObject * __pyx_v_self)16853 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_1__get__(PyObject *__pyx_v_self) {
16854   PyObject *__pyx_r = 0;
16855   __Pyx_RefNannyDeclarations
16856   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16857   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16858 
16859   /* function exit code */
16860   __Pyx_RefNannyFinishContext();
16861   return __pyx_r;
16862 }
16863 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16864 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16865   PyObject *__pyx_r = NULL;
16866   __Pyx_RefNannyDeclarations
16867   PyObject *__pyx_t_1 = NULL;
16868   __Pyx_RefNannySetupContext("__get__", 0);
16869   __Pyx_XDECREF(__pyx_r);
16870   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
16871   __Pyx_GOTREF(__pyx_t_1);
16872   __pyx_r = __pyx_t_1;
16873   __pyx_t_1 = 0;
16874   goto __pyx_L0;
16875 
16876   /* function exit code */
16877   __pyx_L1_error:;
16878   __Pyx_XDECREF(__pyx_t_1);
16879   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.num_domains.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16880   __pyx_r = NULL;
16881   __pyx_L0:;
16882   __Pyx_XGIVEREF(__pyx_r);
16883   __Pyx_RefNannyFinishContext();
16884   return __pyx_r;
16885 }
16886 
16887 /* Python wrapper */
16888 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)16889 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
16890   int __pyx_r;
16891   __Pyx_RefNannyDeclarations
16892   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16893   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_2__set__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));
16894 
16895   /* function exit code */
16896   __Pyx_RefNannyFinishContext();
16897   return __pyx_r;
16898 }
16899 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_value)16900 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) {
16901   int __pyx_r;
16902   __Pyx_RefNannyDeclarations
16903   int __pyx_t_1;
16904   __Pyx_RefNannySetupContext("__set__", 0);
16905   __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 65, __pyx_L1_error)
16906   __pyx_v_self->num_domains = __pyx_t_1;
16907 
16908   /* function exit code */
16909   __pyx_r = 0;
16910   goto __pyx_L0;
16911   __pyx_L1_error:;
16912   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.num_domains.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16913   __pyx_r = -1;
16914   __pyx_L0:;
16915   __Pyx_RefNannyFinishContext();
16916   return __pyx_r;
16917 }
16918 
16919 /* "yt/geometry/oct_container.pxd":83
16920  *     # The fill_style is the ordering, C or F, of the octs in the file.  "o"
16921  *     # corresponds to C, and "r" is for Fortran.
16922  *     cdef public object fill_style             # <<<<<<<<<<<<<<
16923  *
16924  * cdef class SparseOctreeContainer(OctreeContainer):
16925  */
16926 
16927 /* Python wrapper */
16928 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_1__get__(PyObject * __pyx_v_self)16929 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_1__get__(PyObject *__pyx_v_self) {
16930   PyObject *__pyx_r = 0;
16931   __Pyx_RefNannyDeclarations
16932   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16933   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style___get__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16934 
16935   /* function exit code */
16936   __Pyx_RefNannyFinishContext();
16937   return __pyx_r;
16938 }
16939 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16940 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style___get__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16941   PyObject *__pyx_r = NULL;
16942   __Pyx_RefNannyDeclarations
16943   __Pyx_RefNannySetupContext("__get__", 0);
16944   __Pyx_XDECREF(__pyx_r);
16945   __Pyx_INCREF(__pyx_v_self->fill_style);
16946   __pyx_r = __pyx_v_self->fill_style;
16947   goto __pyx_L0;
16948 
16949   /* function exit code */
16950   __pyx_L0:;
16951   __Pyx_XGIVEREF(__pyx_r);
16952   __Pyx_RefNannyFinishContext();
16953   return __pyx_r;
16954 }
16955 
16956 /* Python wrapper */
16957 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)16958 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
16959   int __pyx_r;
16960   __Pyx_RefNannyDeclarations
16961   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16962   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_2__set__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v_value));
16963 
16964   /* function exit code */
16965   __Pyx_RefNannyFinishContext();
16966   return __pyx_r;
16967 }
16968 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,PyObject * __pyx_v_value)16969 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_2__set__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, PyObject *__pyx_v_value) {
16970   int __pyx_r;
16971   __Pyx_RefNannyDeclarations
16972   __Pyx_RefNannySetupContext("__set__", 0);
16973   __Pyx_INCREF(__pyx_v_value);
16974   __Pyx_GIVEREF(__pyx_v_value);
16975   __Pyx_GOTREF(__pyx_v_self->fill_style);
16976   __Pyx_DECREF(__pyx_v_self->fill_style);
16977   __pyx_v_self->fill_style = __pyx_v_value;
16978 
16979   /* function exit code */
16980   __pyx_r = 0;
16981   __Pyx_RefNannyFinishContext();
16982   return __pyx_r;
16983 }
16984 
16985 /* Python wrapper */
16986 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_5__del__(PyObject * __pyx_v_self)16987 static int __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_5__del__(PyObject *__pyx_v_self) {
16988   int __pyx_r;
16989   __Pyx_RefNannyDeclarations
16990   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
16991   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_4__del__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
16992 
16993   /* function exit code */
16994   __Pyx_RefNannyFinishContext();
16995   return __pyx_r;
16996 }
16997 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)16998 static int __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_4__del__(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
16999   int __pyx_r;
17000   __Pyx_RefNannyDeclarations
17001   __Pyx_RefNannySetupContext("__del__", 0);
17002   __Pyx_INCREF(Py_None);
17003   __Pyx_GIVEREF(Py_None);
17004   __Pyx_GOTREF(__pyx_v_self->fill_style);
17005   __Pyx_DECREF(__pyx_v_self->fill_style);
17006   __pyx_v_self->fill_style = Py_None;
17007 
17008   /* function exit code */
17009   __pyx_r = 0;
17010   __Pyx_RefNannyFinishContext();
17011   return __pyx_r;
17012 }
17013 
17014 /* "(tree fragment)":1
17015  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17016  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17017  * def __setstate_cython__(self, __pyx_state):
17018  */
17019 
17020 /* Python wrapper */
17021 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_51__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_51__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17022 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_51__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17023   PyObject *__pyx_r = 0;
17024   __Pyx_RefNannyDeclarations
17025   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17026   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_50__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self));
17027 
17028   /* function exit code */
17029   __Pyx_RefNannyFinishContext();
17030   return __pyx_r;
17031 }
17032 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_50__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self)17033 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_50__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self) {
17034   PyObject *__pyx_r = NULL;
17035   __Pyx_RefNannyDeclarations
17036   PyObject *__pyx_t_1 = NULL;
17037   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17038 
17039   /* "(tree fragment)":2
17040  * def __reduce_cython__(self):
17041  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
17042  * def __setstate_cython__(self, __pyx_state):
17043  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17044  */
17045   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17046   __Pyx_GOTREF(__pyx_t_1);
17047   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17048   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17049   __PYX_ERR(1, 2, __pyx_L1_error)
17050 
17051   /* "(tree fragment)":1
17052  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17053  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17054  * def __setstate_cython__(self, __pyx_state):
17055  */
17056 
17057   /* function exit code */
17058   __pyx_L1_error:;
17059   __Pyx_XDECREF(__pyx_t_1);
17060   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17061   __pyx_r = NULL;
17062   __Pyx_XGIVEREF(__pyx_r);
17063   __Pyx_RefNannyFinishContext();
17064   return __pyx_r;
17065 }
17066 
17067 /* "(tree fragment)":3
17068  * def __reduce_cython__(self):
17069  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17070  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17071  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17072  */
17073 
17074 /* Python wrapper */
17075 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_53__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_53__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)17076 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_53__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17077   PyObject *__pyx_r = 0;
17078   __Pyx_RefNannyDeclarations
17079   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17080   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_52__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17081 
17082   /* function exit code */
17083   __Pyx_RefNannyFinishContext();
17084   return __pyx_r;
17085 }
17086 
__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_52__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)17087 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_15OctreeContainer_52__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17088   PyObject *__pyx_r = NULL;
17089   __Pyx_RefNannyDeclarations
17090   PyObject *__pyx_t_1 = NULL;
17091   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17092 
17093   /* "(tree fragment)":4
17094  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17095  * def __setstate_cython__(self, __pyx_state):
17096  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
17097  */
17098   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17099   __Pyx_GOTREF(__pyx_t_1);
17100   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17101   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17102   __PYX_ERR(1, 4, __pyx_L1_error)
17103 
17104   /* "(tree fragment)":3
17105  * def __reduce_cython__(self):
17106  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17107  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17108  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
17109  */
17110 
17111   /* function exit code */
17112   __pyx_L1_error:;
17113   __Pyx_XDECREF(__pyx_t_1);
17114   __Pyx_AddTraceback("yt.geometry.oct_container.OctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17115   __pyx_r = NULL;
17116   __Pyx_XGIVEREF(__pyx_r);
17117   __Pyx_RefNannyFinishContext();
17118   return __pyx_r;
17119 }
17120 
17121 /* "yt/geometry/oct_container.pyx":938
17122  *         assert ((visitor.global_index+1)*visitor.nz == visitor.index)
17123  *
17124  * cdef int root_node_compare(const void *a, const void *b) nogil:             # <<<<<<<<<<<<<<
17125  *     cdef OctKey *ao
17126  *     cdef OctKey *bo
17127  */
17128 
__pyx_f_2yt_8geometry_13oct_container_root_node_compare(void const * __pyx_v_a,void const * __pyx_v_b)17129 static int __pyx_f_2yt_8geometry_13oct_container_root_node_compare(void const *__pyx_v_a, void const *__pyx_v_b) {
17130   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *__pyx_v_ao;
17131   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *__pyx_v_bo;
17132   int __pyx_r;
17133   int __pyx_t_1;
17134 
17135   /* "yt/geometry/oct_container.pyx":941
17136  *     cdef OctKey *ao
17137  *     cdef OctKey *bo
17138  *     ao = <OctKey *>a             # <<<<<<<<<<<<<<
17139  *     bo = <OctKey *>b
17140  *     if ao.key < bo.key:
17141  */
17142   __pyx_v_ao = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)__pyx_v_a);
17143 
17144   /* "yt/geometry/oct_container.pyx":942
17145  *     cdef OctKey *bo
17146  *     ao = <OctKey *>a
17147  *     bo = <OctKey *>b             # <<<<<<<<<<<<<<
17148  *     if ao.key < bo.key:
17149  *         return -1
17150  */
17151   __pyx_v_bo = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)__pyx_v_b);
17152 
17153   /* "yt/geometry/oct_container.pyx":943
17154  *     ao = <OctKey *>a
17155  *     bo = <OctKey *>b
17156  *     if ao.key < bo.key:             # <<<<<<<<<<<<<<
17157  *         return -1
17158  *     elif ao.key == bo.key:
17159  */
17160   __pyx_t_1 = ((__pyx_v_ao->key < __pyx_v_bo->key) != 0);
17161   if (__pyx_t_1) {
17162 
17163     /* "yt/geometry/oct_container.pyx":944
17164  *     bo = <OctKey *>b
17165  *     if ao.key < bo.key:
17166  *         return -1             # <<<<<<<<<<<<<<
17167  *     elif ao.key == bo.key:
17168  *         return 0
17169  */
17170     __pyx_r = -1;
17171     goto __pyx_L0;
17172 
17173     /* "yt/geometry/oct_container.pyx":943
17174  *     ao = <OctKey *>a
17175  *     bo = <OctKey *>b
17176  *     if ao.key < bo.key:             # <<<<<<<<<<<<<<
17177  *         return -1
17178  *     elif ao.key == bo.key:
17179  */
17180   }
17181 
17182   /* "yt/geometry/oct_container.pyx":945
17183  *     if ao.key < bo.key:
17184  *         return -1
17185  *     elif ao.key == bo.key:             # <<<<<<<<<<<<<<
17186  *         return 0
17187  *     else:
17188  */
17189   __pyx_t_1 = ((__pyx_v_ao->key == __pyx_v_bo->key) != 0);
17190   if (__pyx_t_1) {
17191 
17192     /* "yt/geometry/oct_container.pyx":946
17193  *         return -1
17194  *     elif ao.key == bo.key:
17195  *         return 0             # <<<<<<<<<<<<<<
17196  *     else:
17197  *         return 1
17198  */
17199     __pyx_r = 0;
17200     goto __pyx_L0;
17201 
17202     /* "yt/geometry/oct_container.pyx":945
17203  *     if ao.key < bo.key:
17204  *         return -1
17205  *     elif ao.key == bo.key:             # <<<<<<<<<<<<<<
17206  *         return 0
17207  *     else:
17208  */
17209   }
17210 
17211   /* "yt/geometry/oct_container.pyx":948
17212  *         return 0
17213  *     else:
17214  *         return 1             # <<<<<<<<<<<<<<
17215  *
17216  * cdef class SparseOctreeContainer(OctreeContainer):
17217  */
17218   /*else*/ {
17219     __pyx_r = 1;
17220     goto __pyx_L0;
17221   }
17222 
17223   /* "yt/geometry/oct_container.pyx":938
17224  *         assert ((visitor.global_index+1)*visitor.nz == visitor.index)
17225  *
17226  * cdef int root_node_compare(const void *a, const void *b) nogil:             # <<<<<<<<<<<<<<
17227  *     cdef OctKey *ao
17228  *     cdef OctKey *bo
17229  */
17230 
17231   /* function exit code */
17232   __pyx_L0:;
17233   return __pyx_r;
17234 }
17235 
17236 /* "yt/geometry/oct_container.pyx":952
17237  * cdef class SparseOctreeContainer(OctreeContainer):
17238  *
17239  *     def __init__(self, domain_dimensions, domain_left_edge, domain_right_edge,             # <<<<<<<<<<<<<<
17240  *                  over_refine = 1):
17241  *         cdef int i
17242  */
17243 
17244 /* Python wrapper */
17245 static int __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17246 static int __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17247   PyObject *__pyx_v_domain_dimensions = 0;
17248   PyObject *__pyx_v_domain_left_edge = 0;
17249   PyObject *__pyx_v_domain_right_edge = 0;
17250   PyObject *__pyx_v_over_refine = 0;
17251   int __pyx_r;
17252   __Pyx_RefNannyDeclarations
17253   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
17254   {
17255     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_dimensions,&__pyx_n_s_domain_left_edge,&__pyx_n_s_domain_right_edge,&__pyx_n_s_over_refine,0};
17256     PyObject* values[4] = {0,0,0,0};
17257     values[3] = ((PyObject *)__pyx_int_1);
17258     if (unlikely(__pyx_kwds)) {
17259       Py_ssize_t kw_args;
17260       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17261       switch (pos_args) {
17262         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17263         CYTHON_FALLTHROUGH;
17264         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17265         CYTHON_FALLTHROUGH;
17266         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17267         CYTHON_FALLTHROUGH;
17268         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17269         CYTHON_FALLTHROUGH;
17270         case  0: break;
17271         default: goto __pyx_L5_argtuple_error;
17272       }
17273       kw_args = PyDict_Size(__pyx_kwds);
17274       switch (pos_args) {
17275         case  0:
17276         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_dimensions)) != 0)) kw_args--;
17277         else goto __pyx_L5_argtuple_error;
17278         CYTHON_FALLTHROUGH;
17279         case  1:
17280         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--;
17281         else {
17282           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 952, __pyx_L3_error)
17283         }
17284         CYTHON_FALLTHROUGH;
17285         case  2:
17286         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--;
17287         else {
17288           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 952, __pyx_L3_error)
17289         }
17290         CYTHON_FALLTHROUGH;
17291         case  3:
17292         if (kw_args > 0) {
17293           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_over_refine);
17294           if (value) { values[3] = value; kw_args--; }
17295         }
17296       }
17297       if (unlikely(kw_args > 0)) {
17298         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 952, __pyx_L3_error)
17299       }
17300     } else {
17301       switch (PyTuple_GET_SIZE(__pyx_args)) {
17302         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17303         CYTHON_FALLTHROUGH;
17304         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17305         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17306         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17307         break;
17308         default: goto __pyx_L5_argtuple_error;
17309       }
17310     }
17311     __pyx_v_domain_dimensions = values[0];
17312     __pyx_v_domain_left_edge = values[1];
17313     __pyx_v_domain_right_edge = values[2];
17314     __pyx_v_over_refine = values[3];
17315   }
17316   goto __pyx_L4_argument_unpacking_done;
17317   __pyx_L5_argtuple_error:;
17318   __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 952, __pyx_L3_error)
17319   __pyx_L3_error:;
17320   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17321   __Pyx_RefNannyFinishContext();
17322   return -1;
17323   __pyx_L4_argument_unpacking_done:;
17324   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer___init__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self), __pyx_v_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_over_refine);
17325 
17326   /* function exit code */
17327   __Pyx_RefNannyFinishContext();
17328   return __pyx_r;
17329 }
17330 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,PyObject * __pyx_v_domain_dimensions,PyObject * __pyx_v_domain_left_edge,PyObject * __pyx_v_domain_right_edge,PyObject * __pyx_v_over_refine)17331 static int __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_over_refine) {
17332   int __pyx_v_i;
17333   int __pyx_r;
17334   __Pyx_RefNannyDeclarations
17335   __pyx_t_5numpy_uint8_t __pyx_t_1;
17336   int __pyx_t_2;
17337   PyObject *__pyx_t_3 = NULL;
17338   int __pyx_t_4;
17339   __pyx_t_5numpy_float64_t __pyx_t_5;
17340   __Pyx_RefNannySetupContext("__init__", 0);
17341 
17342   /* "yt/geometry/oct_container.pyx":955
17343  *                  over_refine = 1):
17344  *         cdef int i
17345  *         self.partial_coverage = 1             # <<<<<<<<<<<<<<
17346  *         self.oref = over_refine
17347  *         for i in range(3):
17348  */
17349   __pyx_v_self->__pyx_base.partial_coverage = 1;
17350 
17351   /* "yt/geometry/oct_container.pyx":956
17352  *         cdef int i
17353  *         self.partial_coverage = 1
17354  *         self.oref = over_refine             # <<<<<<<<<<<<<<
17355  *         for i in range(3):
17356  *             self.nn[i] = domain_dimensions[i]
17357  */
17358   __pyx_t_1 = __Pyx_PyInt_As_npy_uint8(__pyx_v_over_refine); if (unlikely((__pyx_t_1 == ((npy_uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L1_error)
17359   __pyx_v_self->__pyx_base.oref = __pyx_t_1;
17360 
17361   /* "yt/geometry/oct_container.pyx":957
17362  *         self.partial_coverage = 1
17363  *         self.oref = over_refine
17364  *         for i in range(3):             # <<<<<<<<<<<<<<
17365  *             self.nn[i] = domain_dimensions[i]
17366  *         self.domains = OctObjectPool()
17367  */
17368   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
17369     __pyx_v_i = __pyx_t_2;
17370 
17371     /* "yt/geometry/oct_container.pyx":958
17372  *         self.oref = over_refine
17373  *         for i in range(3):
17374  *             self.nn[i] = domain_dimensions[i]             # <<<<<<<<<<<<<<
17375  *         self.domains = OctObjectPool()
17376  *         self.num_domains = 0
17377  */
17378     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_dimensions, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error)
17379     __Pyx_GOTREF(__pyx_t_3);
17380     __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error)
17381     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17382     (__pyx_v_self->__pyx_base.nn[__pyx_v_i]) = __pyx_t_4;
17383   }
17384 
17385   /* "yt/geometry/oct_container.pyx":959
17386  *         for i in range(3):
17387  *             self.nn[i] = domain_dimensions[i]
17388  *         self.domains = OctObjectPool()             # <<<<<<<<<<<<<<
17389  *         self.num_domains = 0
17390  *         self.level_offset = 0
17391  */
17392   __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
17393   __Pyx_GOTREF(__pyx_t_3);
17394   __Pyx_GIVEREF(__pyx_t_3);
17395   __Pyx_GOTREF(__pyx_v_self->__pyx_base.domains);
17396   __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.domains));
17397   __pyx_v_self->__pyx_base.domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_t_3);
17398   __pyx_t_3 = 0;
17399 
17400   /* "yt/geometry/oct_container.pyx":960
17401  *             self.nn[i] = domain_dimensions[i]
17402  *         self.domains = OctObjectPool()
17403  *         self.num_domains = 0             # <<<<<<<<<<<<<<
17404  *         self.level_offset = 0
17405  *         self.nocts = 0 # Increment when initialized
17406  */
17407   __pyx_v_self->__pyx_base.num_domains = 0;
17408 
17409   /* "yt/geometry/oct_container.pyx":961
17410  *         self.domains = OctObjectPool()
17411  *         self.num_domains = 0
17412  *         self.level_offset = 0             # <<<<<<<<<<<<<<
17413  *         self.nocts = 0 # Increment when initialized
17414  *         self.root_mesh = NULL
17415  */
17416   __pyx_v_self->__pyx_base.level_offset = 0;
17417 
17418   /* "yt/geometry/oct_container.pyx":962
17419  *         self.num_domains = 0
17420  *         self.level_offset = 0
17421  *         self.nocts = 0 # Increment when initialized             # <<<<<<<<<<<<<<
17422  *         self.root_mesh = NULL
17423  *         self.root_nodes = NULL
17424  */
17425   __pyx_v_self->__pyx_base.nocts = 0;
17426 
17427   /* "yt/geometry/oct_container.pyx":963
17428  *         self.level_offset = 0
17429  *         self.nocts = 0 # Increment when initialized
17430  *         self.root_mesh = NULL             # <<<<<<<<<<<<<<
17431  *         self.root_nodes = NULL
17432  *         self.tree_root = NULL
17433  */
17434   __pyx_v_self->__pyx_base.root_mesh = NULL;
17435 
17436   /* "yt/geometry/oct_container.pyx":964
17437  *         self.nocts = 0 # Increment when initialized
17438  *         self.root_mesh = NULL
17439  *         self.root_nodes = NULL             # <<<<<<<<<<<<<<
17440  *         self.tree_root = NULL
17441  *         self.num_root = 0
17442  */
17443   __pyx_v_self->root_nodes = NULL;
17444 
17445   /* "yt/geometry/oct_container.pyx":965
17446  *         self.root_mesh = NULL
17447  *         self.root_nodes = NULL
17448  *         self.tree_root = NULL             # <<<<<<<<<<<<<<
17449  *         self.num_root = 0
17450  *         self.max_root = 0
17451  */
17452   __pyx_v_self->tree_root = NULL;
17453 
17454   /* "yt/geometry/oct_container.pyx":966
17455  *         self.root_nodes = NULL
17456  *         self.tree_root = NULL
17457  *         self.num_root = 0             # <<<<<<<<<<<<<<
17458  *         self.max_root = 0
17459  *         # We don't initialize the octs yet
17460  */
17461   __pyx_v_self->num_root = 0;
17462 
17463   /* "yt/geometry/oct_container.pyx":967
17464  *         self.tree_root = NULL
17465  *         self.num_root = 0
17466  *         self.max_root = 0             # <<<<<<<<<<<<<<
17467  *         # We don't initialize the octs yet
17468  *         for i in range(3):
17469  */
17470   __pyx_v_self->max_root = 0;
17471 
17472   /* "yt/geometry/oct_container.pyx":969
17473  *         self.max_root = 0
17474  *         # We don't initialize the octs yet
17475  *         for i in range(3):             # <<<<<<<<<<<<<<
17476  *             self.DLE[i] = domain_left_edge[i] #0
17477  *             self.DRE[i] = domain_right_edge[i] #num_grid
17478  */
17479   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
17480     __pyx_v_i = __pyx_t_2;
17481 
17482     /* "yt/geometry/oct_container.pyx":970
17483  *         # We don't initialize the octs yet
17484  *         for i in range(3):
17485  *             self.DLE[i] = domain_left_edge[i] #0             # <<<<<<<<<<<<<<
17486  *             self.DRE[i] = domain_right_edge[i] #num_grid
17487  *         self.fill_style = "r"
17488  */
17489     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_left_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
17490     __Pyx_GOTREF(__pyx_t_3);
17491     __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L1_error)
17492     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17493     (__pyx_v_self->__pyx_base.DLE[__pyx_v_i]) = __pyx_t_5;
17494 
17495     /* "yt/geometry/oct_container.pyx":971
17496  *         for i in range(3):
17497  *             self.DLE[i] = domain_left_edge[i] #0
17498  *             self.DRE[i] = domain_right_edge[i] #num_grid             # <<<<<<<<<<<<<<
17499  *         self.fill_style = "r"
17500  *
17501  */
17502     __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_domain_right_edge, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error)
17503     __Pyx_GOTREF(__pyx_t_3);
17504     __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error)
17505     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17506     (__pyx_v_self->__pyx_base.DRE[__pyx_v_i]) = __pyx_t_5;
17507   }
17508 
17509   /* "yt/geometry/oct_container.pyx":972
17510  *             self.DLE[i] = domain_left_edge[i] #0
17511  *             self.DRE[i] = domain_right_edge[i] #num_grid
17512  *         self.fill_style = "r"             # <<<<<<<<<<<<<<
17513  *
17514  *     @classmethod
17515  */
17516   __Pyx_INCREF(__pyx_n_s_r);
17517   __Pyx_GIVEREF(__pyx_n_s_r);
17518   __Pyx_GOTREF(__pyx_v_self->__pyx_base.fill_style);
17519   __Pyx_DECREF(__pyx_v_self->__pyx_base.fill_style);
17520   __pyx_v_self->__pyx_base.fill_style = __pyx_n_s_r;
17521 
17522   /* "yt/geometry/oct_container.pyx":952
17523  * cdef class SparseOctreeContainer(OctreeContainer):
17524  *
17525  *     def __init__(self, domain_dimensions, domain_left_edge, domain_right_edge,             # <<<<<<<<<<<<<<
17526  *                  over_refine = 1):
17527  *         cdef int i
17528  */
17529 
17530   /* function exit code */
17531   __pyx_r = 0;
17532   goto __pyx_L0;
17533   __pyx_L1_error:;
17534   __Pyx_XDECREF(__pyx_t_3);
17535   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17536   __pyx_r = -1;
17537   __pyx_L0:;
17538   __Pyx_RefNannyFinishContext();
17539   return __pyx_r;
17540 }
17541 
17542 /* "yt/geometry/oct_container.pyx":975
17543  *
17544  *     @classmethod
17545  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
17546  *         raise NotImplementedError
17547  *
17548  */
17549 
17550 /* Python wrapper */
17551 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_3load_octree(PyObject *__pyx_v_cls, PyObject *__pyx_v_header); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_3load_octree(PyObject * __pyx_v_cls,PyObject * __pyx_v_header)17552 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_3load_octree(PyObject *__pyx_v_cls, PyObject *__pyx_v_header) {
17553   PyObject *__pyx_r = 0;
17554   __Pyx_RefNannyDeclarations
17555   __Pyx_RefNannySetupContext("load_octree (wrapper)", 0);
17556   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_2load_octree(((PyTypeObject*)__pyx_v_cls), ((PyObject *)__pyx_v_header));
17557 
17558   /* function exit code */
17559   __Pyx_RefNannyFinishContext();
17560   return __pyx_r;
17561 }
17562 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_2load_octree(CYTHON_UNUSED PyTypeObject * __pyx_v_cls,CYTHON_UNUSED PyObject * __pyx_v_header)17563 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_2load_octree(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, CYTHON_UNUSED PyObject *__pyx_v_header) {
17564   PyObject *__pyx_r = NULL;
17565   __Pyx_RefNannyDeclarations
17566   __Pyx_RefNannySetupContext("load_octree", 0);
17567 
17568   /* "yt/geometry/oct_container.pyx":976
17569  *     @classmethod
17570  *     def load_octree(cls, header):
17571  *         raise NotImplementedError             # <<<<<<<<<<<<<<
17572  *
17573  *     def save_octree(self):
17574  */
17575   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
17576   __PYX_ERR(0, 976, __pyx_L1_error)
17577 
17578   /* "yt/geometry/oct_container.pyx":975
17579  *
17580  *     @classmethod
17581  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
17582  *         raise NotImplementedError
17583  *
17584  */
17585 
17586   /* function exit code */
17587   __pyx_L1_error:;
17588   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.load_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
17589   __pyx_r = NULL;
17590   __Pyx_XGIVEREF(__pyx_r);
17591   __Pyx_RefNannyFinishContext();
17592   return __pyx_r;
17593 }
17594 
17595 /* "yt/geometry/oct_container.pyx":978
17596  *         raise NotImplementedError
17597  *
17598  *     def save_octree(self):             # <<<<<<<<<<<<<<
17599  *         raise NotImplementedError
17600  *
17601  */
17602 
17603 /* Python wrapper */
17604 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_5save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_5save_octree(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17605 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_5save_octree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17606   PyObject *__pyx_r = 0;
17607   __Pyx_RefNannyDeclarations
17608   __Pyx_RefNannySetupContext("save_octree (wrapper)", 0);
17609   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_4save_octree(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self));
17610 
17611   /* function exit code */
17612   __Pyx_RefNannyFinishContext();
17613   return __pyx_r;
17614 }
17615 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_4save_octree(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self)17616 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_4save_octree(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self) {
17617   PyObject *__pyx_r = NULL;
17618   __Pyx_RefNannyDeclarations
17619   __Pyx_RefNannySetupContext("save_octree", 0);
17620 
17621   /* "yt/geometry/oct_container.pyx":979
17622  *
17623  *     def save_octree(self):
17624  *         raise NotImplementedError             # <<<<<<<<<<<<<<
17625  *
17626  *     cdef int get_root(self, int ind[3], Oct **o) nogil:
17627  */
17628   __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
17629   __PYX_ERR(0, 979, __pyx_L1_error)
17630 
17631   /* "yt/geometry/oct_container.pyx":978
17632  *         raise NotImplementedError
17633  *
17634  *     def save_octree(self):             # <<<<<<<<<<<<<<
17635  *         raise NotImplementedError
17636  *
17637  */
17638 
17639   /* function exit code */
17640   __pyx_L1_error:;
17641   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.save_octree", __pyx_clineno, __pyx_lineno, __pyx_filename);
17642   __pyx_r = NULL;
17643   __Pyx_XGIVEREF(__pyx_r);
17644   __Pyx_RefNannyFinishContext();
17645   return __pyx_r;
17646 }
17647 
17648 /* "yt/geometry/oct_container.pyx":981
17649  *         raise NotImplementedError
17650  *
17651  *     cdef int get_root(self, int ind[3], Oct **o) nogil:             # <<<<<<<<<<<<<<
17652  *         o[0] = NULL
17653  *         cdef np.int64_t key = self.ipos_to_key(ind)
17654  */
17655 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,int * __pyx_v_ind,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ** __pyx_v_o)17656 static int __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int *__pyx_v_ind, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **__pyx_v_o) {
17657   __pyx_t_5numpy_int64_t __pyx_v_key;
17658   struct __pyx_t_2yt_8geometry_13oct_container_OctKey __pyx_v_okey;
17659   struct __pyx_t_2yt_8geometry_13oct_container_OctKey **__pyx_v_oresult;
17660   int __pyx_r;
17661   int __pyx_t_1;
17662   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_2;
17663 
17664   /* "yt/geometry/oct_container.pyx":982
17665  *
17666  *     cdef int get_root(self, int ind[3], Oct **o) nogil:
17667  *         o[0] = NULL             # <<<<<<<<<<<<<<
17668  *         cdef np.int64_t key = self.ipos_to_key(ind)
17669  *         cdef OctKey okey
17670  */
17671   (__pyx_v_o[0]) = NULL;
17672 
17673   /* "yt/geometry/oct_container.pyx":983
17674  *     cdef int get_root(self, int ind[3], Oct **o) nogil:
17675  *         o[0] = NULL
17676  *         cdef np.int64_t key = self.ipos_to_key(ind)             # <<<<<<<<<<<<<<
17677  *         cdef OctKey okey
17678  *         cdef OctKey **oresult = NULL
17679  */
17680   __pyx_v_key = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->ipos_to_key(__pyx_v_self, __pyx_v_ind);
17681 
17682   /* "yt/geometry/oct_container.pyx":985
17683  *         cdef np.int64_t key = self.ipos_to_key(ind)
17684  *         cdef OctKey okey
17685  *         cdef OctKey **oresult = NULL             # <<<<<<<<<<<<<<
17686  *         okey.key = key
17687  *         okey.node = NULL
17688  */
17689   __pyx_v_oresult = NULL;
17690 
17691   /* "yt/geometry/oct_container.pyx":986
17692  *         cdef OctKey okey
17693  *         cdef OctKey **oresult = NULL
17694  *         okey.key = key             # <<<<<<<<<<<<<<
17695  *         okey.node = NULL
17696  *         oresult = <OctKey **> tfind(<void*>&okey,
17697  */
17698   __pyx_v_okey.key = __pyx_v_key;
17699 
17700   /* "yt/geometry/oct_container.pyx":987
17701  *         cdef OctKey **oresult = NULL
17702  *         okey.key = key
17703  *         okey.node = NULL             # <<<<<<<<<<<<<<
17704  *         oresult = <OctKey **> tfind(<void*>&okey,
17705  *             &self.tree_root, root_node_compare)
17706  */
17707   __pyx_v_okey.node = NULL;
17708 
17709   /* "yt/geometry/oct_container.pyx":988
17710  *         okey.key = key
17711  *         okey.node = NULL
17712  *         oresult = <OctKey **> tfind(<void*>&okey,             # <<<<<<<<<<<<<<
17713  *             &self.tree_root, root_node_compare)
17714  *         if oresult != NULL:
17715  */
17716   __pyx_v_oresult = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey **)tfind(((void *)(&__pyx_v_okey)), (&__pyx_v_self->tree_root), __pyx_f_2yt_8geometry_13oct_container_root_node_compare));
17717 
17718   /* "yt/geometry/oct_container.pyx":990
17719  *         oresult = <OctKey **> tfind(<void*>&okey,
17720  *             &self.tree_root, root_node_compare)
17721  *         if oresult != NULL:             # <<<<<<<<<<<<<<
17722  *             o[0] = oresult[0].node
17723  *             return 1
17724  */
17725   __pyx_t_1 = ((__pyx_v_oresult != NULL) != 0);
17726   if (__pyx_t_1) {
17727 
17728     /* "yt/geometry/oct_container.pyx":991
17729  *             &self.tree_root, root_node_compare)
17730  *         if oresult != NULL:
17731  *             o[0] = oresult[0].node             # <<<<<<<<<<<<<<
17732  *             return 1
17733  *         return 0
17734  */
17735     __pyx_t_2 = (__pyx_v_oresult[0])->node;
17736     (__pyx_v_o[0]) = __pyx_t_2;
17737 
17738     /* "yt/geometry/oct_container.pyx":992
17739  *         if oresult != NULL:
17740  *             o[0] = oresult[0].node
17741  *             return 1             # <<<<<<<<<<<<<<
17742  *         return 0
17743  *
17744  */
17745     __pyx_r = 1;
17746     goto __pyx_L0;
17747 
17748     /* "yt/geometry/oct_container.pyx":990
17749  *         oresult = <OctKey **> tfind(<void*>&okey,
17750  *             &self.tree_root, root_node_compare)
17751  *         if oresult != NULL:             # <<<<<<<<<<<<<<
17752  *             o[0] = oresult[0].node
17753  *             return 1
17754  */
17755   }
17756 
17757   /* "yt/geometry/oct_container.pyx":993
17758  *             o[0] = oresult[0].node
17759  *             return 1
17760  *         return 0             # <<<<<<<<<<<<<<
17761  *
17762  *     cdef void key_to_ipos(self, np.int64_t key, np.int64_t pos[3]):
17763  */
17764   __pyx_r = 0;
17765   goto __pyx_L0;
17766 
17767   /* "yt/geometry/oct_container.pyx":981
17768  *         raise NotImplementedError
17769  *
17770  *     cdef int get_root(self, int ind[3], Oct **o) nogil:             # <<<<<<<<<<<<<<
17771  *         o[0] = NULL
17772  *         cdef np.int64_t key = self.ipos_to_key(ind)
17773  */
17774 
17775   /* function exit code */
17776   __pyx_L0:;
17777   return __pyx_r;
17778 }
17779 
17780 /* "yt/geometry/oct_container.pyx":995
17781  *         return 0
17782  *
17783  *     cdef void key_to_ipos(self, np.int64_t key, np.int64_t pos[3]):             # <<<<<<<<<<<<<<
17784  *         # Note: this is the result of doing
17785  *         # for i in range(20):
17786  */
17787 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_key_to_ipos(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_key,__pyx_t_5numpy_int64_t * __pyx_v_pos)17788 static void __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_key_to_ipos(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, __pyx_t_5numpy_int64_t *__pyx_v_pos) {
17789   __pyx_t_5numpy_int64_t __pyx_v_ukey;
17790   int __pyx_v_j;
17791   __Pyx_RefNannyDeclarations
17792   int __pyx_t_1;
17793   __Pyx_RefNannySetupContext("key_to_ipos", 0);
17794 
17795   /* "yt/geometry/oct_container.pyx":999
17796  *         # for i in range(20):
17797  *         #     ukey |= (1 << i)
17798  *         cdef np.int64_t ukey = 1048575             # <<<<<<<<<<<<<<
17799  *         cdef int j
17800  *         for j in range(3):
17801  */
17802   __pyx_v_ukey = 0xFFFFF;
17803 
17804   /* "yt/geometry/oct_container.pyx":1001
17805  *         cdef np.int64_t ukey = 1048575
17806  *         cdef int j
17807  *         for j in range(3):             # <<<<<<<<<<<<<<
17808  *             pos[2 - j] = (<np.int64_t>(key & ukey))
17809  *             key = key >> 20
17810  */
17811   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
17812     __pyx_v_j = __pyx_t_1;
17813 
17814     /* "yt/geometry/oct_container.pyx":1002
17815  *         cdef int j
17816  *         for j in range(3):
17817  *             pos[2 - j] = (<np.int64_t>(key & ukey))             # <<<<<<<<<<<<<<
17818  *             key = key >> 20
17819  *
17820  */
17821     (__pyx_v_pos[(2 - __pyx_v_j)]) = ((__pyx_t_5numpy_int64_t)(__pyx_v_key & __pyx_v_ukey));
17822 
17823     /* "yt/geometry/oct_container.pyx":1003
17824  *         for j in range(3):
17825  *             pos[2 - j] = (<np.int64_t>(key & ukey))
17826  *             key = key >> 20             # <<<<<<<<<<<<<<
17827  *
17828  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil:
17829  */
17830     __pyx_v_key = (__pyx_v_key >> 20);
17831   }
17832 
17833   /* "yt/geometry/oct_container.pyx":995
17834  *         return 0
17835  *
17836  *     cdef void key_to_ipos(self, np.int64_t key, np.int64_t pos[3]):             # <<<<<<<<<<<<<<
17837  *         # Note: this is the result of doing
17838  *         # for i in range(20):
17839  */
17840 
17841   /* function exit code */
17842   __Pyx_RefNannyFinishContext();
17843 }
17844 
17845 /* "yt/geometry/oct_container.pyx":1005
17846  *             key = key >> 20
17847  *
17848  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil:             # <<<<<<<<<<<<<<
17849  *         # We (hope) that 20 bits is enough for each index.
17850  *         cdef int i
17851  */
17852 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_ipos_to_key(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,int * __pyx_v_pos)17853 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_ipos_to_key(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int *__pyx_v_pos) {
17854   int __pyx_v_i;
17855   __pyx_t_5numpy_int64_t __pyx_v_key;
17856   __pyx_t_5numpy_int64_t __pyx_r;
17857   int __pyx_t_1;
17858 
17859   /* "yt/geometry/oct_container.pyx":1008
17860  *         # We (hope) that 20 bits is enough for each index.
17861  *         cdef int i
17862  *         cdef np.int64_t key = 0             # <<<<<<<<<<<<<<
17863  *         for i in range(3):
17864  *             # Note the casting here.  Bitshifting can cause issues otherwise.
17865  */
17866   __pyx_v_key = 0;
17867 
17868   /* "yt/geometry/oct_container.pyx":1009
17869  *         cdef int i
17870  *         cdef np.int64_t key = 0
17871  *         for i in range(3):             # <<<<<<<<<<<<<<
17872  *             # Note the casting here.  Bitshifting can cause issues otherwise.
17873  *             key |= ((<np.int64_t>pos[i]) << 20 * (2 - i))
17874  */
17875   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
17876     __pyx_v_i = __pyx_t_1;
17877 
17878     /* "yt/geometry/oct_container.pyx":1011
17879  *         for i in range(3):
17880  *             # Note the casting here.  Bitshifting can cause issues otherwise.
17881  *             key |= ((<np.int64_t>pos[i]) << 20 * (2 - i))             # <<<<<<<<<<<<<<
17882  *         return key
17883  *
17884  */
17885     __pyx_v_key = (__pyx_v_key | (((__pyx_t_5numpy_int64_t)(__pyx_v_pos[__pyx_v_i])) << (20 * (2 - __pyx_v_i))));
17886   }
17887 
17888   /* "yt/geometry/oct_container.pyx":1012
17889  *             # Note the casting here.  Bitshifting can cause issues otherwise.
17890  *             key |= ((<np.int64_t>pos[i]) << 20 * (2 - i))
17891  *         return key             # <<<<<<<<<<<<<<
17892  *
17893  *     @cython.cdivision(True)
17894  */
17895   __pyx_r = __pyx_v_key;
17896   goto __pyx_L0;
17897 
17898   /* "yt/geometry/oct_container.pyx":1005
17899  *             key = key >> 20
17900  *
17901  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil:             # <<<<<<<<<<<<<<
17902  *         # We (hope) that 20 bits is enough for each index.
17903  *         cdef int i
17904  */
17905 
17906   /* function exit code */
17907   __pyx_L0:;
17908   return __pyx_r;
17909 }
17910 
17911 /* "yt/geometry/oct_container.pyx":1015
17912  *
17913  *     @cython.cdivision(True)
17914  *     cdef void visit_all_octs(self, SelectorObject selector,             # <<<<<<<<<<<<<<
17915  *                         OctVisitor visitor,
17916  *                         int vc = -1,
17917  */
17918 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_visitor,struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs * __pyx_optional_args)17919 static void __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_visitor, struct __pyx_opt_args_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs *__pyx_optional_args) {
17920   int __pyx_v_vc = ((int)-1);
17921 
17922   /* "yt/geometry/oct_container.pyx":1018
17923  *                         OctVisitor visitor,
17924  *                         int vc = -1,
17925  *                         np.int64_t *indices = NULL):             # <<<<<<<<<<<<<<
17926  *         cdef int i, j, k, n
17927  *         cdef np.int64_t key, ukey
17928  */
17929   __pyx_t_5numpy_int64_t *__pyx_v_indices = ((__pyx_t_5numpy_int64_t *)NULL);
17930   int __pyx_v_i;
17931   int __pyx_v_j;
17932   __pyx_t_5numpy_int64_t __pyx_v_key;
17933   __pyx_t_5numpy_float64_t __pyx_v_pos[3];
17934   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
17935   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o;
17936   __Pyx_RefNannyDeclarations
17937   int __pyx_t_1;
17938   int __pyx_t_2;
17939   int __pyx_t_3;
17940   int __pyx_t_4;
17941   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_t_5;
17942   __pyx_t_5numpy_int64_t __pyx_t_6;
17943   int __pyx_t_7;
17944   struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs __pyx_t_8;
17945   __pyx_t_5numpy_uint64_t __pyx_t_9;
17946   __Pyx_RefNannySetupContext("visit_all_octs", 0);
17947   if (__pyx_optional_args) {
17948     if (__pyx_optional_args->__pyx_n > 0) {
17949       __pyx_v_vc = __pyx_optional_args->vc;
17950       if (__pyx_optional_args->__pyx_n > 1) {
17951         __pyx_v_indices = __pyx_optional_args->indices;
17952       }
17953     }
17954   }
17955 
17956   /* "yt/geometry/oct_container.pyx":1021
17957  *         cdef int i, j, k, n
17958  *         cdef np.int64_t key, ukey
17959  *         visitor.global_index = -1             # <<<<<<<<<<<<<<
17960  *         visitor.level = 0
17961  *         if vc == -1:
17962  */
17963   __pyx_v_visitor->global_index = -1LL;
17964 
17965   /* "yt/geometry/oct_container.pyx":1022
17966  *         cdef np.int64_t key, ukey
17967  *         visitor.global_index = -1
17968  *         visitor.level = 0             # <<<<<<<<<<<<<<
17969  *         if vc == -1:
17970  *             vc = self.partial_coverage
17971  */
17972   __pyx_v_visitor->level = 0;
17973 
17974   /* "yt/geometry/oct_container.pyx":1023
17975  *         visitor.global_index = -1
17976  *         visitor.level = 0
17977  *         if vc == -1:             # <<<<<<<<<<<<<<
17978  *             vc = self.partial_coverage
17979  *         cdef np.float64_t pos[3]
17980  */
17981   __pyx_t_1 = ((__pyx_v_vc == -1L) != 0);
17982   if (__pyx_t_1) {
17983 
17984     /* "yt/geometry/oct_container.pyx":1024
17985  *         visitor.level = 0
17986  *         if vc == -1:
17987  *             vc = self.partial_coverage             # <<<<<<<<<<<<<<
17988  *         cdef np.float64_t pos[3]
17989  *         cdef np.float64_t dds[3]
17990  */
17991     __pyx_t_2 = __pyx_v_self->__pyx_base.partial_coverage;
17992     __pyx_v_vc = __pyx_t_2;
17993 
17994     /* "yt/geometry/oct_container.pyx":1023
17995  *         visitor.global_index = -1
17996  *         visitor.level = 0
17997  *         if vc == -1:             # <<<<<<<<<<<<<<
17998  *             vc = self.partial_coverage
17999  *         cdef np.float64_t pos[3]
18000  */
18001   }
18002 
18003   /* "yt/geometry/oct_container.pyx":1028
18004  *         cdef np.float64_t dds[3]
18005  *         # This dds is the oct-width
18006  *         for i in range(3):             # <<<<<<<<<<<<<<
18007  *             dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i]
18008  *         # Pos is the center of the octs
18009  */
18010   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
18011     __pyx_v_i = __pyx_t_2;
18012 
18013     /* "yt/geometry/oct_container.pyx":1029
18014  *         # This dds is the oct-width
18015  *         for i in range(3):
18016  *             dds[i] = (self.DRE[i] - self.DLE[i]) / self.nn[i]             # <<<<<<<<<<<<<<
18017  *         # Pos is the center of the octs
18018  *         cdef Oct *o
18019  */
18020     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_self->__pyx_base.DRE[__pyx_v_i]) - (__pyx_v_self->__pyx_base.DLE[__pyx_v_i])) / (__pyx_v_self->__pyx_base.nn[__pyx_v_i]));
18021   }
18022 
18023   /* "yt/geometry/oct_container.pyx":1032
18024  *         # Pos is the center of the octs
18025  *         cdef Oct *o
18026  *         for i in range(self.num_root):             # <<<<<<<<<<<<<<
18027  *             o = self.root_nodes[i].node
18028  *             key = self.root_nodes[i].key
18029  */
18030   __pyx_t_2 = __pyx_v_self->num_root;
18031   __pyx_t_3 = __pyx_t_2;
18032   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18033     __pyx_v_i = __pyx_t_4;
18034 
18035     /* "yt/geometry/oct_container.pyx":1033
18036  *         cdef Oct *o
18037  *         for i in range(self.num_root):
18038  *             o = self.root_nodes[i].node             # <<<<<<<<<<<<<<
18039  *             key = self.root_nodes[i].key
18040  *             self.key_to_ipos(key, visitor.pos)
18041  */
18042     __pyx_t_5 = (__pyx_v_self->root_nodes[__pyx_v_i]).node;
18043     __pyx_v_o = __pyx_t_5;
18044 
18045     /* "yt/geometry/oct_container.pyx":1034
18046  *         for i in range(self.num_root):
18047  *             o = self.root_nodes[i].node
18048  *             key = self.root_nodes[i].key             # <<<<<<<<<<<<<<
18049  *             self.key_to_ipos(key, visitor.pos)
18050  *             for j in range(3):
18051  */
18052     __pyx_t_6 = (__pyx_v_self->root_nodes[__pyx_v_i]).key;
18053     __pyx_v_key = __pyx_t_6;
18054 
18055     /* "yt/geometry/oct_container.pyx":1035
18056  *             o = self.root_nodes[i].node
18057  *             key = self.root_nodes[i].key
18058  *             self.key_to_ipos(key, visitor.pos)             # <<<<<<<<<<<<<<
18059  *             for j in range(3):
18060  *                 pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j]
18061  */
18062     ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->key_to_ipos(__pyx_v_self, __pyx_v_key, __pyx_v_visitor->pos);
18063 
18064     /* "yt/geometry/oct_container.pyx":1036
18065  *             key = self.root_nodes[i].key
18066  *             self.key_to_ipos(key, visitor.pos)
18067  *             for j in range(3):             # <<<<<<<<<<<<<<
18068  *                 pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j]
18069  *             selector.recursively_visit_octs(
18070  */
18071     for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
18072       __pyx_v_j = __pyx_t_7;
18073 
18074       /* "yt/geometry/oct_container.pyx":1037
18075  *             self.key_to_ipos(key, visitor.pos)
18076  *             for j in range(3):
18077  *                 pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j]             # <<<<<<<<<<<<<<
18078  *             selector.recursively_visit_octs(
18079  *                 o, pos, dds, 0, visitor, vc)
18080  */
18081       (__pyx_v_pos[__pyx_v_j]) = ((__pyx_v_self->__pyx_base.DLE[__pyx_v_j]) + (((__pyx_v_visitor->pos[__pyx_v_j]) + 0.5) * (__pyx_v_dds[__pyx_v_j])));
18082     }
18083 
18084     /* "yt/geometry/oct_container.pyx":1038
18085  *             for j in range(3):
18086  *                 pos[j] = self.DLE[j] + (visitor.pos[j] + 0.5) * dds[j]
18087  *             selector.recursively_visit_octs(             # <<<<<<<<<<<<<<
18088  *                 o, pos, dds, 0, visitor, vc)
18089  *             if indices != NULL:
18090  */
18091     __pyx_t_8.__pyx_n = 1;
18092     __pyx_t_8.visit_covered = __pyx_v_vc;
18093     ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->recursively_visit_octs(__pyx_v_selector, __pyx_v_o, __pyx_v_pos, __pyx_v_dds, 0, __pyx_v_visitor, &__pyx_t_8);
18094 
18095     /* "yt/geometry/oct_container.pyx":1040
18096  *             selector.recursively_visit_octs(
18097  *                 o, pos, dds, 0, visitor, vc)
18098  *             if indices != NULL:             # <<<<<<<<<<<<<<
18099  *                 indices[i] = visitor.index
18100  *
18101  */
18102     __pyx_t_1 = ((__pyx_v_indices != NULL) != 0);
18103     if (__pyx_t_1) {
18104 
18105       /* "yt/geometry/oct_container.pyx":1041
18106  *                 o, pos, dds, 0, visitor, vc)
18107  *             if indices != NULL:
18108  *                 indices[i] = visitor.index             # <<<<<<<<<<<<<<
18109  *
18110  *     cdef np.int64_t get_domain_offset(self, int domain_id):
18111  */
18112       __pyx_t_9 = __pyx_v_visitor->index;
18113       (__pyx_v_indices[__pyx_v_i]) = __pyx_t_9;
18114 
18115       /* "yt/geometry/oct_container.pyx":1040
18116  *             selector.recursively_visit_octs(
18117  *                 o, pos, dds, 0, visitor, vc)
18118  *             if indices != NULL:             # <<<<<<<<<<<<<<
18119  *                 indices[i] = visitor.index
18120  *
18121  */
18122     }
18123   }
18124 
18125   /* "yt/geometry/oct_container.pyx":1015
18126  *
18127  *     @cython.cdivision(True)
18128  *     cdef void visit_all_octs(self, SelectorObject selector,             # <<<<<<<<<<<<<<
18129  *                         OctVisitor visitor,
18130  *                         int vc = -1,
18131  */
18132 
18133   /* function exit code */
18134   __Pyx_RefNannyFinishContext();
18135 }
18136 
18137 /* "yt/geometry/oct_container.pyx":1043
18138  *                 indices[i] = visitor.index
18139  *
18140  *     cdef np.int64_t get_domain_offset(self, int domain_id):             # <<<<<<<<<<<<<<
18141  *         return 0 # We no longer have a domain offset.
18142  *
18143  */
18144 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,CYTHON_UNUSED int __pyx_v_domain_id)18145 static __pyx_t_5numpy_int64_t __pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_domain_offset(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED int __pyx_v_domain_id) {
18146   __pyx_t_5numpy_int64_t __pyx_r;
18147   __Pyx_RefNannyDeclarations
18148   __Pyx_RefNannySetupContext("get_domain_offset", 0);
18149 
18150   /* "yt/geometry/oct_container.pyx":1044
18151  *
18152  *     cdef np.int64_t get_domain_offset(self, int domain_id):
18153  *         return 0 # We no longer have a domain offset.             # <<<<<<<<<<<<<<
18154  *
18155  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
18156  */
18157   __pyx_r = 0;
18158   goto __pyx_L0;
18159 
18160   /* "yt/geometry/oct_container.pyx":1043
18161  *                 indices[i] = visitor.index
18162  *
18163  *     cdef np.int64_t get_domain_offset(self, int domain_id):             # <<<<<<<<<<<<<<
18164  *         return 0 # We no longer have a domain offset.
18165  *
18166  */
18167 
18168   /* function exit code */
18169   __pyx_L0:;
18170   __Pyx_RefNannyFinishContext();
18171   return __pyx_r;
18172 }
18173 
18174 /* "yt/geometry/oct_container.pyx":1046
18175  *         return 0 # We no longer have a domain offset.
18176  *
18177  *     cdef Oct* next_root(self, int domain_id, int ind[3]):             # <<<<<<<<<<<<<<
18178  *         cdef Oct *next = NULL
18179  *         self.get_root(ind, &next)
18180  */
18181 
__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,int __pyx_v_domain_id,int * __pyx_v_ind)18182 static struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_next_root(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, int __pyx_v_domain_id, int *__pyx_v_ind) {
18183   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_next;
18184   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_v_cont;
18185   __pyx_t_5numpy_int64_t __pyx_v_key;
18186   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *__pyx_v_ikey;
18187   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_r;
18188   __Pyx_RefNannyDeclarations
18189   int __pyx_t_1;
18190   __Pyx_RefNannySetupContext("next_root", 0);
18191 
18192   /* "yt/geometry/oct_container.pyx":1047
18193  *
18194  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
18195  *         cdef Oct *next = NULL             # <<<<<<<<<<<<<<
18196  *         self.get_root(ind, &next)
18197  *         if next != NULL: return next
18198  */
18199   __pyx_v_next = NULL;
18200 
18201   /* "yt/geometry/oct_container.pyx":1048
18202  *     cdef Oct* next_root(self, int domain_id, int ind[3]):
18203  *         cdef Oct *next = NULL
18204  *         self.get_root(ind, &next)             # <<<<<<<<<<<<<<
18205  *         if next != NULL: return next
18206  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
18207  */
18208   (void)(((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_root(((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)__pyx_v_self), __pyx_v_ind, (&__pyx_v_next)));
18209 
18210   /* "yt/geometry/oct_container.pyx":1049
18211  *         cdef Oct *next = NULL
18212  *         self.get_root(ind, &next)
18213  *         if next != NULL: return next             # <<<<<<<<<<<<<<
18214  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
18215  *         if cont.n_assigned >= cont.n:
18216  */
18217   __pyx_t_1 = ((__pyx_v_next != NULL) != 0);
18218   if (__pyx_t_1) {
18219     __pyx_r = __pyx_v_next;
18220     goto __pyx_L0;
18221   }
18222 
18223   /* "yt/geometry/oct_container.pyx":1050
18224  *         self.get_root(ind, &next)
18225  *         if next != NULL: return next
18226  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)             # <<<<<<<<<<<<<<
18227  *         if cont.n_assigned >= cont.n:
18228  *             print("Too many assigned.")
18229  */
18230   __pyx_v_cont = __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(__pyx_v_self->__pyx_base.domains, (__pyx_v_domain_id - 1));
18231 
18232   /* "yt/geometry/oct_container.pyx":1051
18233  *         if next != NULL: return next
18234  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
18235  *         if cont.n_assigned >= cont.n:             # <<<<<<<<<<<<<<
18236  *             print("Too many assigned.")
18237  *             return NULL
18238  */
18239   __pyx_t_1 = ((__pyx_v_cont->n_assigned >= __pyx_v_cont->n) != 0);
18240   if (__pyx_t_1) {
18241 
18242     /* "yt/geometry/oct_container.pyx":1052
18243  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
18244  *         if cont.n_assigned >= cont.n:
18245  *             print("Too many assigned.")             # <<<<<<<<<<<<<<
18246  *             return NULL
18247  *         if self.num_root >= self.max_root:
18248  */
18249     if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_assigned) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
18250 
18251     /* "yt/geometry/oct_container.pyx":1053
18252  *         if cont.n_assigned >= cont.n:
18253  *             print("Too many assigned.")
18254  *             return NULL             # <<<<<<<<<<<<<<
18255  *         if self.num_root >= self.max_root:
18256  *             print("Too many roots.")
18257  */
18258     __pyx_r = NULL;
18259     goto __pyx_L0;
18260 
18261     /* "yt/geometry/oct_container.pyx":1051
18262  *         if next != NULL: return next
18263  *         cdef OctAllocationContainer *cont = self.domains.get_cont(domain_id - 1)
18264  *         if cont.n_assigned >= cont.n:             # <<<<<<<<<<<<<<
18265  *             print("Too many assigned.")
18266  *             return NULL
18267  */
18268   }
18269 
18270   /* "yt/geometry/oct_container.pyx":1054
18271  *             print("Too many assigned.")
18272  *             return NULL
18273  *         if self.num_root >= self.max_root:             # <<<<<<<<<<<<<<
18274  *             print("Too many roots.")
18275  *             return NULL
18276  */
18277   __pyx_t_1 = ((__pyx_v_self->num_root >= __pyx_v_self->max_root) != 0);
18278   if (__pyx_t_1) {
18279 
18280     /* "yt/geometry/oct_container.pyx":1055
18281  *             return NULL
18282  *         if self.num_root >= self.max_root:
18283  *             print("Too many roots.")             # <<<<<<<<<<<<<<
18284  *             return NULL
18285  *         next = &cont.my_objs[cont.n_assigned]
18286  */
18287     if (__Pyx_PrintOne(0, __pyx_kp_s_Too_many_roots) < 0) __PYX_ERR(0, 1055, __pyx_L1_error)
18288 
18289     /* "yt/geometry/oct_container.pyx":1056
18290  *         if self.num_root >= self.max_root:
18291  *             print("Too many roots.")
18292  *             return NULL             # <<<<<<<<<<<<<<
18293  *         next = &cont.my_objs[cont.n_assigned]
18294  *         cont.n_assigned += 1
18295  */
18296     __pyx_r = NULL;
18297     goto __pyx_L0;
18298 
18299     /* "yt/geometry/oct_container.pyx":1054
18300  *             print("Too many assigned.")
18301  *             return NULL
18302  *         if self.num_root >= self.max_root:             # <<<<<<<<<<<<<<
18303  *             print("Too many roots.")
18304  *             return NULL
18305  */
18306   }
18307 
18308   /* "yt/geometry/oct_container.pyx":1057
18309  *             print("Too many roots.")
18310  *             return NULL
18311  *         next = &cont.my_objs[cont.n_assigned]             # <<<<<<<<<<<<<<
18312  *         cont.n_assigned += 1
18313  *         cdef np.int64_t key = 0
18314  */
18315   __pyx_v_next = (&(__pyx_v_cont->my_objs[__pyx_v_cont->n_assigned]));
18316 
18317   /* "yt/geometry/oct_container.pyx":1058
18318  *             return NULL
18319  *         next = &cont.my_objs[cont.n_assigned]
18320  *         cont.n_assigned += 1             # <<<<<<<<<<<<<<
18321  *         cdef np.int64_t key = 0
18322  *         cdef OctKey *ikey = &self.root_nodes[self.num_root]
18323  */
18324   __pyx_v_cont->n_assigned = (__pyx_v_cont->n_assigned + 1);
18325 
18326   /* "yt/geometry/oct_container.pyx":1059
18327  *         next = &cont.my_objs[cont.n_assigned]
18328  *         cont.n_assigned += 1
18329  *         cdef np.int64_t key = 0             # <<<<<<<<<<<<<<
18330  *         cdef OctKey *ikey = &self.root_nodes[self.num_root]
18331  *         key = self.ipos_to_key(ind)
18332  */
18333   __pyx_v_key = 0;
18334 
18335   /* "yt/geometry/oct_container.pyx":1060
18336  *         cont.n_assigned += 1
18337  *         cdef np.int64_t key = 0
18338  *         cdef OctKey *ikey = &self.root_nodes[self.num_root]             # <<<<<<<<<<<<<<
18339  *         key = self.ipos_to_key(ind)
18340  *         self.root_nodes[self.num_root].key = key
18341  */
18342   __pyx_v_ikey = (&(__pyx_v_self->root_nodes[__pyx_v_self->num_root]));
18343 
18344   /* "yt/geometry/oct_container.pyx":1061
18345  *         cdef np.int64_t key = 0
18346  *         cdef OctKey *ikey = &self.root_nodes[self.num_root]
18347  *         key = self.ipos_to_key(ind)             # <<<<<<<<<<<<<<
18348  *         self.root_nodes[self.num_root].key = key
18349  *         self.root_nodes[self.num_root].node = next
18350  */
18351   __pyx_v_key = ((struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self->__pyx_base.__pyx_vtab)->ipos_to_key(__pyx_v_self, __pyx_v_ind);
18352 
18353   /* "yt/geometry/oct_container.pyx":1062
18354  *         cdef OctKey *ikey = &self.root_nodes[self.num_root]
18355  *         key = self.ipos_to_key(ind)
18356  *         self.root_nodes[self.num_root].key = key             # <<<<<<<<<<<<<<
18357  *         self.root_nodes[self.num_root].node = next
18358  *         tsearch(<void*>ikey, &self.tree_root, root_node_compare)
18359  */
18360   (__pyx_v_self->root_nodes[__pyx_v_self->num_root]).key = __pyx_v_key;
18361 
18362   /* "yt/geometry/oct_container.pyx":1063
18363  *         key = self.ipos_to_key(ind)
18364  *         self.root_nodes[self.num_root].key = key
18365  *         self.root_nodes[self.num_root].node = next             # <<<<<<<<<<<<<<
18366  *         tsearch(<void*>ikey, &self.tree_root, root_node_compare)
18367  *         self.num_root += 1
18368  */
18369   (__pyx_v_self->root_nodes[__pyx_v_self->num_root]).node = __pyx_v_next;
18370 
18371   /* "yt/geometry/oct_container.pyx":1064
18372  *         self.root_nodes[self.num_root].key = key
18373  *         self.root_nodes[self.num_root].node = next
18374  *         tsearch(<void*>ikey, &self.tree_root, root_node_compare)             # <<<<<<<<<<<<<<
18375  *         self.num_root += 1
18376  *         self.nocts += 1
18377  */
18378   (void)(tsearch(((void *)__pyx_v_ikey), (&__pyx_v_self->tree_root), __pyx_f_2yt_8geometry_13oct_container_root_node_compare));
18379 
18380   /* "yt/geometry/oct_container.pyx":1065
18381  *         self.root_nodes[self.num_root].node = next
18382  *         tsearch(<void*>ikey, &self.tree_root, root_node_compare)
18383  *         self.num_root += 1             # <<<<<<<<<<<<<<
18384  *         self.nocts += 1
18385  *         return next
18386  */
18387   __pyx_v_self->num_root = (__pyx_v_self->num_root + 1);
18388 
18389   /* "yt/geometry/oct_container.pyx":1066
18390  *         tsearch(<void*>ikey, &self.tree_root, root_node_compare)
18391  *         self.num_root += 1
18392  *         self.nocts += 1             # <<<<<<<<<<<<<<
18393  *         return next
18394  *
18395  */
18396   __pyx_v_self->__pyx_base.nocts = (__pyx_v_self->__pyx_base.nocts + 1);
18397 
18398   /* "yt/geometry/oct_container.pyx":1067
18399  *         self.num_root += 1
18400  *         self.nocts += 1
18401  *         return next             # <<<<<<<<<<<<<<
18402  *
18403  *     def allocate_domains(self, domain_counts, int root_nodes):
18404  */
18405   __pyx_r = __pyx_v_next;
18406   goto __pyx_L0;
18407 
18408   /* "yt/geometry/oct_container.pyx":1046
18409  *         return 0 # We no longer have a domain offset.
18410  *
18411  *     cdef Oct* next_root(self, int domain_id, int ind[3]):             # <<<<<<<<<<<<<<
18412  *         cdef Oct *next = NULL
18413  *         self.get_root(ind, &next)
18414  */
18415 
18416   /* function exit code */
18417   __pyx_L1_error:;
18418   __Pyx_WriteUnraisable("yt.geometry.oct_container.SparseOctreeContainer.next_root", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18419   __pyx_r = 0;
18420   __pyx_L0:;
18421   __Pyx_RefNannyFinishContext();
18422   return __pyx_r;
18423 }
18424 
18425 /* "yt/geometry/oct_container.pyx":1069
18426  *         return next
18427  *
18428  *     def allocate_domains(self, domain_counts, int root_nodes):             # <<<<<<<<<<<<<<
18429  *         OctreeContainer.allocate_domains(self, domain_counts)
18430  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)
18431  */
18432 
18433 /* Python wrapper */
18434 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_7allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_7allocate_domains(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)18435 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_7allocate_domains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18436   PyObject *__pyx_v_domain_counts = 0;
18437   int __pyx_v_root_nodes;
18438   PyObject *__pyx_r = 0;
18439   __Pyx_RefNannyDeclarations
18440   __Pyx_RefNannySetupContext("allocate_domains (wrapper)", 0);
18441   {
18442     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domain_counts,&__pyx_n_s_root_nodes,0};
18443     PyObject* values[2] = {0,0};
18444     if (unlikely(__pyx_kwds)) {
18445       Py_ssize_t kw_args;
18446       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18447       switch (pos_args) {
18448         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18449         CYTHON_FALLTHROUGH;
18450         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18451         CYTHON_FALLTHROUGH;
18452         case  0: break;
18453         default: goto __pyx_L5_argtuple_error;
18454       }
18455       kw_args = PyDict_Size(__pyx_kwds);
18456       switch (pos_args) {
18457         case  0:
18458         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_counts)) != 0)) kw_args--;
18459         else goto __pyx_L5_argtuple_error;
18460         CYTHON_FALLTHROUGH;
18461         case  1:
18462         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root_nodes)) != 0)) kw_args--;
18463         else {
18464           __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, 1); __PYX_ERR(0, 1069, __pyx_L3_error)
18465         }
18466       }
18467       if (unlikely(kw_args > 0)) {
18468         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allocate_domains") < 0)) __PYX_ERR(0, 1069, __pyx_L3_error)
18469       }
18470     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18471       goto __pyx_L5_argtuple_error;
18472     } else {
18473       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18474       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18475     }
18476     __pyx_v_domain_counts = values[0];
18477     __pyx_v_root_nodes = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_root_nodes == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L3_error)
18478   }
18479   goto __pyx_L4_argument_unpacking_done;
18480   __pyx_L5_argtuple_error:;
18481   __Pyx_RaiseArgtupleInvalid("allocate_domains", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1069, __pyx_L3_error)
18482   __pyx_L3_error:;
18483   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.allocate_domains", __pyx_clineno, __pyx_lineno, __pyx_filename);
18484   __Pyx_RefNannyFinishContext();
18485   return NULL;
18486   __pyx_L4_argument_unpacking_done:;
18487   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_6allocate_domains(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self), __pyx_v_domain_counts, __pyx_v_root_nodes);
18488 
18489   /* function exit code */
18490   __Pyx_RefNannyFinishContext();
18491   return __pyx_r;
18492 }
18493 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_6allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,PyObject * __pyx_v_domain_counts,int __pyx_v_root_nodes)18494 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_6allocate_domains(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, PyObject *__pyx_v_domain_counts, int __pyx_v_root_nodes) {
18495   int __pyx_v_i;
18496   PyObject *__pyx_r = NULL;
18497   __Pyx_RefNannyDeclarations
18498   PyObject *__pyx_t_1 = NULL;
18499   PyObject *__pyx_t_2 = NULL;
18500   PyObject *__pyx_t_3 = NULL;
18501   int __pyx_t_4;
18502   PyObject *__pyx_t_5 = NULL;
18503   int __pyx_t_6;
18504   int __pyx_t_7;
18505   __Pyx_RefNannySetupContext("allocate_domains", 0);
18506 
18507   /* "yt/geometry/oct_container.pyx":1070
18508  *
18509  *     def allocate_domains(self, domain_counts, int root_nodes):
18510  *         OctreeContainer.allocate_domains(self, domain_counts)             # <<<<<<<<<<<<<<
18511  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)
18512  *         self.max_root = root_nodes
18513  */
18514   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_allocate_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error)
18515   __Pyx_GOTREF(__pyx_t_2);
18516   __pyx_t_3 = NULL;
18517   __pyx_t_4 = 0;
18518   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18519     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18520     if (likely(__pyx_t_3)) {
18521       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18522       __Pyx_INCREF(__pyx_t_3);
18523       __Pyx_INCREF(function);
18524       __Pyx_DECREF_SET(__pyx_t_2, function);
18525       __pyx_t_4 = 1;
18526     }
18527   }
18528   #if CYTHON_FAST_PYCALL
18529   if (PyFunction_Check(__pyx_t_2)) {
18530     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_domain_counts};
18531     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
18532     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18533     __Pyx_GOTREF(__pyx_t_1);
18534   } else
18535   #endif
18536   #if CYTHON_FAST_PYCCALL
18537   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18538     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_domain_counts};
18539     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
18540     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18541     __Pyx_GOTREF(__pyx_t_1);
18542   } else
18543   #endif
18544   {
18545     __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L1_error)
18546     __Pyx_GOTREF(__pyx_t_5);
18547     if (__pyx_t_3) {
18548       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
18549     }
18550     __Pyx_INCREF(((PyObject *)__pyx_v_self));
18551     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18552     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
18553     __Pyx_INCREF(__pyx_v_domain_counts);
18554     __Pyx_GIVEREF(__pyx_v_domain_counts);
18555     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_domain_counts);
18556     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
18557     __Pyx_GOTREF(__pyx_t_1);
18558     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18559   }
18560   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18561   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18562 
18563   /* "yt/geometry/oct_container.pyx":1071
18564  *     def allocate_domains(self, domain_counts, int root_nodes):
18565  *         OctreeContainer.allocate_domains(self, domain_counts)
18566  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)             # <<<<<<<<<<<<<<
18567  *         self.max_root = root_nodes
18568  *         for i in range(root_nodes):
18569  */
18570   __pyx_v_self->root_nodes = ((struct __pyx_t_2yt_8geometry_13oct_container_OctKey *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctKey)) * __pyx_v_root_nodes)));
18571 
18572   /* "yt/geometry/oct_container.pyx":1072
18573  *         OctreeContainer.allocate_domains(self, domain_counts)
18574  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)
18575  *         self.max_root = root_nodes             # <<<<<<<<<<<<<<
18576  *         for i in range(root_nodes):
18577  *             self.root_nodes[i].key = -1
18578  */
18579   __pyx_v_self->max_root = __pyx_v_root_nodes;
18580 
18581   /* "yt/geometry/oct_container.pyx":1073
18582  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)
18583  *         self.max_root = root_nodes
18584  *         for i in range(root_nodes):             # <<<<<<<<<<<<<<
18585  *             self.root_nodes[i].key = -1
18586  *             self.root_nodes[i].node = NULL
18587  */
18588   __pyx_t_4 = __pyx_v_root_nodes;
18589   __pyx_t_6 = __pyx_t_4;
18590   for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18591     __pyx_v_i = __pyx_t_7;
18592 
18593     /* "yt/geometry/oct_container.pyx":1074
18594  *         self.max_root = root_nodes
18595  *         for i in range(root_nodes):
18596  *             self.root_nodes[i].key = -1             # <<<<<<<<<<<<<<
18597  *             self.root_nodes[i].node = NULL
18598  *
18599  */
18600     (__pyx_v_self->root_nodes[__pyx_v_i]).key = -1LL;
18601 
18602     /* "yt/geometry/oct_container.pyx":1075
18603  *         for i in range(root_nodes):
18604  *             self.root_nodes[i].key = -1
18605  *             self.root_nodes[i].node = NULL             # <<<<<<<<<<<<<<
18606  *
18607  *     def __dealloc__(self):
18608  */
18609     (__pyx_v_self->root_nodes[__pyx_v_i]).node = NULL;
18610   }
18611 
18612   /* "yt/geometry/oct_container.pyx":1069
18613  *         return next
18614  *
18615  *     def allocate_domains(self, domain_counts, int root_nodes):             # <<<<<<<<<<<<<<
18616  *         OctreeContainer.allocate_domains(self, domain_counts)
18617  *         self.root_nodes = <OctKey*> malloc(sizeof(OctKey) * root_nodes)
18618  */
18619 
18620   /* function exit code */
18621   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18622   goto __pyx_L0;
18623   __pyx_L1_error:;
18624   __Pyx_XDECREF(__pyx_t_1);
18625   __Pyx_XDECREF(__pyx_t_2);
18626   __Pyx_XDECREF(__pyx_t_3);
18627   __Pyx_XDECREF(__pyx_t_5);
18628   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.allocate_domains", __pyx_clineno, __pyx_lineno, __pyx_filename);
18629   __pyx_r = NULL;
18630   __pyx_L0:;
18631   __Pyx_XGIVEREF(__pyx_r);
18632   __Pyx_RefNannyFinishContext();
18633   return __pyx_r;
18634 }
18635 
18636 /* "yt/geometry/oct_container.pyx":1077
18637  *             self.root_nodes[i].node = NULL
18638  *
18639  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
18640  *         # This gets called BEFORE the superclass deallocation.  But, both get
18641  *         # called.
18642  */
18643 
18644 /* Python wrapper */
18645 static void __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_9__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_9__dealloc__(PyObject * __pyx_v_self)18646 static void __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_9__dealloc__(PyObject *__pyx_v_self) {
18647   __Pyx_RefNannyDeclarations
18648   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
18649   __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_8__dealloc__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self));
18650 
18651   /* function exit code */
18652   __Pyx_RefNannyFinishContext();
18653 }
18654 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_8__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self)18655 static void __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_8__dealloc__(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self) {
18656   __Pyx_RefNannyDeclarations
18657   int __pyx_t_1;
18658   __Pyx_RefNannySetupContext("__dealloc__", 0);
18659 
18660   /* "yt/geometry/oct_container.pyx":1080
18661  *         # This gets called BEFORE the superclass deallocation.  But, both get
18662  *         # called.
18663  *         if self.root_nodes != NULL: free(self.root_nodes)             # <<<<<<<<<<<<<<
18664  *
18665  * cdef class ARTOctreeContainer(OctreeContainer):
18666  */
18667   __pyx_t_1 = ((__pyx_v_self->root_nodes != NULL) != 0);
18668   if (__pyx_t_1) {
18669     free(__pyx_v_self->root_nodes);
18670   }
18671 
18672   /* "yt/geometry/oct_container.pyx":1077
18673  *             self.root_nodes[i].node = NULL
18674  *
18675  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
18676  *         # This gets called BEFORE the superclass deallocation.  But, both get
18677  *         # called.
18678  */
18679 
18680   /* function exit code */
18681   __Pyx_RefNannyFinishContext();
18682 }
18683 
18684 /* "(tree fragment)":1
18685  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18686  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18687  * def __setstate_cython__(self, __pyx_state):
18688  */
18689 
18690 /* Python wrapper */
18691 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)18692 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18693   PyObject *__pyx_r = 0;
18694   __Pyx_RefNannyDeclarations
18695   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18696   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self));
18697 
18698   /* function exit code */
18699   __Pyx_RefNannyFinishContext();
18700   return __pyx_r;
18701 }
18702 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self)18703 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self) {
18704   PyObject *__pyx_r = NULL;
18705   __Pyx_RefNannyDeclarations
18706   PyObject *__pyx_t_1 = NULL;
18707   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18708 
18709   /* "(tree fragment)":2
18710  * def __reduce_cython__(self):
18711  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
18712  * def __setstate_cython__(self, __pyx_state):
18713  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18714  */
18715   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18716   __Pyx_GOTREF(__pyx_t_1);
18717   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18718   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18719   __PYX_ERR(1, 2, __pyx_L1_error)
18720 
18721   /* "(tree fragment)":1
18722  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18723  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18724  * def __setstate_cython__(self, __pyx_state):
18725  */
18726 
18727   /* function exit code */
18728   __pyx_L1_error:;
18729   __Pyx_XDECREF(__pyx_t_1);
18730   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18731   __pyx_r = NULL;
18732   __Pyx_XGIVEREF(__pyx_r);
18733   __Pyx_RefNannyFinishContext();
18734   return __pyx_r;
18735 }
18736 
18737 /* "(tree fragment)":3
18738  * def __reduce_cython__(self):
18739  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18740  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18741  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18742  */
18743 
18744 /* Python wrapper */
18745 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)18746 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18747   PyObject *__pyx_r = 0;
18748   __Pyx_RefNannyDeclarations
18749   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18750   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18751 
18752   /* function exit code */
18753   __Pyx_RefNannyFinishContext();
18754   return __pyx_r;
18755 }
18756 
__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)18757 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_21SparseOctreeContainer_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
18758   PyObject *__pyx_r = NULL;
18759   __Pyx_RefNannyDeclarations
18760   PyObject *__pyx_t_1 = NULL;
18761   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18762 
18763   /* "(tree fragment)":4
18764  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18765  * def __setstate_cython__(self, __pyx_state):
18766  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
18767  */
18768   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18769   __Pyx_GOTREF(__pyx_t_1);
18770   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18771   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18772   __PYX_ERR(1, 4, __pyx_L1_error)
18773 
18774   /* "(tree fragment)":3
18775  * def __reduce_cython__(self):
18776  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18777  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18778  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
18779  */
18780 
18781   /* function exit code */
18782   __pyx_L1_error:;
18783   __Pyx_XDECREF(__pyx_t_1);
18784   __Pyx_AddTraceback("yt.geometry.oct_container.SparseOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18785   __pyx_r = NULL;
18786   __Pyx_XGIVEREF(__pyx_r);
18787   __Pyx_RefNannyFinishContext();
18788   return __pyx_r;
18789 }
18790 
18791 /* "yt/geometry/oct_container.pyx":1083
18792  *
18793  * cdef class ARTOctreeContainer(OctreeContainer):
18794  *     def __init__(self, oct_domain_dimensions, domain_left_edge,             # <<<<<<<<<<<<<<
18795  *                  domain_right_edge, partial_coverage = 0,
18796  *                  over_refine = 1):
18797  */
18798 
18799 /* Python wrapper */
18800 static int __pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)18801 static int __pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18802   PyObject *__pyx_v_oct_domain_dimensions = 0;
18803   PyObject *__pyx_v_domain_left_edge = 0;
18804   PyObject *__pyx_v_domain_right_edge = 0;
18805   PyObject *__pyx_v_partial_coverage = 0;
18806   PyObject *__pyx_v_over_refine = 0;
18807   int __pyx_r;
18808   __Pyx_RefNannyDeclarations
18809   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
18810   {
18811     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oct_domain_dimensions,&__pyx_n_s_domain_left_edge,&__pyx_n_s_domain_right_edge,&__pyx_n_s_partial_coverage,&__pyx_n_s_over_refine,0};
18812     PyObject* values[5] = {0,0,0,0,0};
18813     values[3] = ((PyObject *)__pyx_int_0);
18814     values[4] = ((PyObject *)__pyx_int_1);
18815     if (unlikely(__pyx_kwds)) {
18816       Py_ssize_t kw_args;
18817       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18818       switch (pos_args) {
18819         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18820         CYTHON_FALLTHROUGH;
18821         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18822         CYTHON_FALLTHROUGH;
18823         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18824         CYTHON_FALLTHROUGH;
18825         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18826         CYTHON_FALLTHROUGH;
18827         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18828         CYTHON_FALLTHROUGH;
18829         case  0: break;
18830         default: goto __pyx_L5_argtuple_error;
18831       }
18832       kw_args = PyDict_Size(__pyx_kwds);
18833       switch (pos_args) {
18834         case  0:
18835         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oct_domain_dimensions)) != 0)) kw_args--;
18836         else goto __pyx_L5_argtuple_error;
18837         CYTHON_FALLTHROUGH;
18838         case  1:
18839         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_left_edge)) != 0)) kw_args--;
18840         else {
18841           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 1083, __pyx_L3_error)
18842         }
18843         CYTHON_FALLTHROUGH;
18844         case  2:
18845         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_right_edge)) != 0)) kw_args--;
18846         else {
18847           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 1083, __pyx_L3_error)
18848         }
18849         CYTHON_FALLTHROUGH;
18850         case  3:
18851         if (kw_args > 0) {
18852           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_partial_coverage);
18853           if (value) { values[3] = value; kw_args--; }
18854         }
18855         CYTHON_FALLTHROUGH;
18856         case  4:
18857         if (kw_args > 0) {
18858           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_over_refine);
18859           if (value) { values[4] = value; kw_args--; }
18860         }
18861       }
18862       if (unlikely(kw_args > 0)) {
18863         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1083, __pyx_L3_error)
18864       }
18865     } else {
18866       switch (PyTuple_GET_SIZE(__pyx_args)) {
18867         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18868         CYTHON_FALLTHROUGH;
18869         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18870         CYTHON_FALLTHROUGH;
18871         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18872         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18873         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18874         break;
18875         default: goto __pyx_L5_argtuple_error;
18876       }
18877     }
18878     __pyx_v_oct_domain_dimensions = values[0];
18879     __pyx_v_domain_left_edge = values[1];
18880     __pyx_v_domain_right_edge = values[2];
18881     __pyx_v_partial_coverage = values[3];
18882     __pyx_v_over_refine = values[4];
18883   }
18884   goto __pyx_L4_argument_unpacking_done;
18885   __pyx_L5_argtuple_error:;
18886   __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1083, __pyx_L3_error)
18887   __pyx_L3_error:;
18888   __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18889   __Pyx_RefNannyFinishContext();
18890   return -1;
18891   __pyx_L4_argument_unpacking_done:;
18892   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer___init__(((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine);
18893 
18894   /* function exit code */
18895   __Pyx_RefNannyFinishContext();
18896   return __pyx_r;
18897 }
18898 
__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer * __pyx_v_self,PyObject * __pyx_v_oct_domain_dimensions,PyObject * __pyx_v_domain_left_edge,PyObject * __pyx_v_domain_right_edge,PyObject * __pyx_v_partial_coverage,PyObject * __pyx_v_over_refine)18899 static int __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer___init__(struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, PyObject *__pyx_v_oct_domain_dimensions, PyObject *__pyx_v_domain_left_edge, PyObject *__pyx_v_domain_right_edge, PyObject *__pyx_v_partial_coverage, PyObject *__pyx_v_over_refine) {
18900   int __pyx_r;
18901   __Pyx_RefNannyDeclarations
18902   PyObject *__pyx_t_1 = NULL;
18903   PyObject *__pyx_t_2 = NULL;
18904   PyObject *__pyx_t_3 = NULL;
18905   int __pyx_t_4;
18906   PyObject *__pyx_t_5 = NULL;
18907   __Pyx_RefNannySetupContext("__init__", 0);
18908 
18909   /* "yt/geometry/oct_container.pyx":1086
18910  *                  domain_right_edge, partial_coverage = 0,
18911  *                  over_refine = 1):
18912  *         OctreeContainer.__init__(self, oct_domain_dimensions,             # <<<<<<<<<<<<<<
18913  *                 domain_left_edge, domain_right_edge, partial_coverage,
18914  *                  over_refine)
18915  */
18916   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error)
18917   __Pyx_GOTREF(__pyx_t_2);
18918 
18919   /* "yt/geometry/oct_container.pyx":1088
18920  *         OctreeContainer.__init__(self, oct_domain_dimensions,
18921  *                 domain_left_edge, domain_right_edge, partial_coverage,
18922  *                  over_refine)             # <<<<<<<<<<<<<<
18923  *         self.fill_style = "r"
18924  *
18925  */
18926   __pyx_t_3 = NULL;
18927   __pyx_t_4 = 0;
18928   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
18929     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18930     if (likely(__pyx_t_3)) {
18931       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18932       __Pyx_INCREF(__pyx_t_3);
18933       __Pyx_INCREF(function);
18934       __Pyx_DECREF_SET(__pyx_t_2, function);
18935       __pyx_t_4 = 1;
18936     }
18937   }
18938   #if CYTHON_FAST_PYCALL
18939   if (PyFunction_Check(__pyx_t_2)) {
18940     PyObject *__pyx_temp[7] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine};
18941     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
18942     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18943     __Pyx_GOTREF(__pyx_t_1);
18944   } else
18945   #endif
18946   #if CYTHON_FAST_PYCCALL
18947   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
18948     PyObject *__pyx_temp[7] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_oct_domain_dimensions, __pyx_v_domain_left_edge, __pyx_v_domain_right_edge, __pyx_v_partial_coverage, __pyx_v_over_refine};
18949     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 6+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
18950     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18951     __Pyx_GOTREF(__pyx_t_1);
18952   } else
18953   #endif
18954   {
18955     __pyx_t_5 = PyTuple_New(6+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
18956     __Pyx_GOTREF(__pyx_t_5);
18957     if (__pyx_t_3) {
18958       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
18959     }
18960     __Pyx_INCREF(((PyObject *)__pyx_v_self));
18961     __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18962     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
18963     __Pyx_INCREF(__pyx_v_oct_domain_dimensions);
18964     __Pyx_GIVEREF(__pyx_v_oct_domain_dimensions);
18965     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_oct_domain_dimensions);
18966     __Pyx_INCREF(__pyx_v_domain_left_edge);
18967     __Pyx_GIVEREF(__pyx_v_domain_left_edge);
18968     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_domain_left_edge);
18969     __Pyx_INCREF(__pyx_v_domain_right_edge);
18970     __Pyx_GIVEREF(__pyx_v_domain_right_edge);
18971     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_domain_right_edge);
18972     __Pyx_INCREF(__pyx_v_partial_coverage);
18973     __Pyx_GIVEREF(__pyx_v_partial_coverage);
18974     PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_partial_coverage);
18975     __Pyx_INCREF(__pyx_v_over_refine);
18976     __Pyx_GIVEREF(__pyx_v_over_refine);
18977     PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_over_refine);
18978     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
18979     __Pyx_GOTREF(__pyx_t_1);
18980     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18981   }
18982   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18983   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18984 
18985   /* "yt/geometry/oct_container.pyx":1089
18986  *                 domain_left_edge, domain_right_edge, partial_coverage,
18987  *                  over_refine)
18988  *         self.fill_style = "r"             # <<<<<<<<<<<<<<
18989  *
18990  * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top,
18991  */
18992   __Pyx_INCREF(__pyx_n_s_r);
18993   __Pyx_GIVEREF(__pyx_n_s_r);
18994   __Pyx_GOTREF(__pyx_v_self->__pyx_base.fill_style);
18995   __Pyx_DECREF(__pyx_v_self->__pyx_base.fill_style);
18996   __pyx_v_self->__pyx_base.fill_style = __pyx_n_s_r;
18997 
18998   /* "yt/geometry/oct_container.pyx":1083
18999  *
19000  * cdef class ARTOctreeContainer(OctreeContainer):
19001  *     def __init__(self, oct_domain_dimensions, domain_left_edge,             # <<<<<<<<<<<<<<
19002  *                  domain_right_edge, partial_coverage = 0,
19003  *                  over_refine = 1):
19004  */
19005 
19006   /* function exit code */
19007   __pyx_r = 0;
19008   goto __pyx_L0;
19009   __pyx_L1_error:;
19010   __Pyx_XDECREF(__pyx_t_1);
19011   __Pyx_XDECREF(__pyx_t_2);
19012   __Pyx_XDECREF(__pyx_t_3);
19013   __Pyx_XDECREF(__pyx_t_5);
19014   __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19015   __pyx_r = -1;
19016   __pyx_L0:;
19017   __Pyx_RefNannyFinishContext();
19018   return __pyx_r;
19019 }
19020 
19021 /* "(tree fragment)":1
19022  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19023  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19024  * def __setstate_cython__(self, __pyx_state):
19025  */
19026 
19027 /* Python wrapper */
19028 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)19029 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19030   PyObject *__pyx_r = 0;
19031   __Pyx_RefNannyDeclarations
19032   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
19033   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)__pyx_v_self));
19034 
19035   /* function exit code */
19036   __Pyx_RefNannyFinishContext();
19037   return __pyx_r;
19038 }
19039 
__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer * __pyx_v_self)19040 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self) {
19041   PyObject *__pyx_r = NULL;
19042   __Pyx_RefNannyDeclarations
19043   PyObject *__pyx_t_1 = NULL;
19044   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
19045 
19046   /* "(tree fragment)":2
19047  * def __reduce_cython__(self):
19048  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
19049  * def __setstate_cython__(self, __pyx_state):
19050  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19051  */
19052   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
19053   __Pyx_GOTREF(__pyx_t_1);
19054   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19055   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19056   __PYX_ERR(1, 2, __pyx_L1_error)
19057 
19058   /* "(tree fragment)":1
19059  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19060  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19061  * def __setstate_cython__(self, __pyx_state):
19062  */
19063 
19064   /* function exit code */
19065   __pyx_L1_error:;
19066   __Pyx_XDECREF(__pyx_t_1);
19067   __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19068   __pyx_r = NULL;
19069   __Pyx_XGIVEREF(__pyx_r);
19070   __Pyx_RefNannyFinishContext();
19071   return __pyx_r;
19072 }
19073 
19074 /* "(tree fragment)":3
19075  * def __reduce_cython__(self):
19076  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19077  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19078  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19079  */
19080 
19081 /* Python wrapper */
19082 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)19083 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19084   PyObject *__pyx_r = 0;
19085   __Pyx_RefNannyDeclarations
19086   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
19087   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19088 
19089   /* function exit code */
19090   __Pyx_RefNannyFinishContext();
19091   return __pyx_r;
19092 }
19093 
__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)19094 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_18ARTOctreeContainer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
19095   PyObject *__pyx_r = NULL;
19096   __Pyx_RefNannyDeclarations
19097   PyObject *__pyx_t_1 = NULL;
19098   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19099 
19100   /* "(tree fragment)":4
19101  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19102  * def __setstate_cython__(self, __pyx_state):
19103  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
19104  */
19105   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
19106   __Pyx_GOTREF(__pyx_t_1);
19107   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19108   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19109   __PYX_ERR(1, 4, __pyx_L1_error)
19110 
19111   /* "(tree fragment)":3
19112  * def __reduce_cython__(self):
19113  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19114  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19115  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
19116  */
19117 
19118   /* function exit code */
19119   __pyx_L1_error:;
19120   __Pyx_XDECREF(__pyx_t_1);
19121   __Pyx_AddTraceback("yt.geometry.oct_container.ARTOctreeContainer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19122   __pyx_r = NULL;
19123   __Pyx_XGIVEREF(__pyx_r);
19124   __Pyx_RefNannyFinishContext();
19125   return __pyx_r;
19126 }
19127 
19128 /* "yt/geometry/oct_container.pyx":1091
19129  *         self.fill_style = "r"
19130  *
19131  * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top,             # <<<<<<<<<<<<<<
19132  *                                        int i, int j, int k):
19133  *     if top.children == NULL: return olist
19134  */
19135 
__pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(struct __pyx_t_2yt_8geometry_13oct_container_OctList * __pyx_v_olist,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct * __pyx_v_top,int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)19136 static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_top, int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
19137   __pyx_t_5numpy_int64_t __pyx_v_n[3];
19138   __pyx_t_5numpy_int64_t __pyx_v_ind[3];
19139   __pyx_t_5numpy_int64_t __pyx_v_off[3][2];
19140   __pyx_t_5numpy_int64_t __pyx_v_ii;
19141   __pyx_t_5numpy_int64_t __pyx_v_ij;
19142   __pyx_t_5numpy_int64_t __pyx_v_ik;
19143   __pyx_t_5numpy_int64_t __pyx_v_ci;
19144   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_cand;
19145   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_r;
19146   __Pyx_RefNannyDeclarations
19147   int __pyx_t_1;
19148   int __pyx_t_2;
19149   __pyx_t_5numpy_int64_t __pyx_t_3;
19150   __pyx_t_5numpy_int64_t __pyx_t_4;
19151   __pyx_t_5numpy_int64_t __pyx_t_5;
19152   __pyx_t_5numpy_int64_t __pyx_t_6;
19153   __pyx_t_5numpy_int64_t __pyx_t_7;
19154   __pyx_t_5numpy_int64_t __pyx_t_8;
19155   __pyx_t_5numpy_int64_t __pyx_t_9;
19156   __pyx_t_5numpy_int64_t __pyx_t_10;
19157   __pyx_t_5numpy_int64_t __pyx_t_11;
19158   __Pyx_RefNannySetupContext("OctList_subneighbor_find", 0);
19159 
19160   /* "yt/geometry/oct_container.pyx":1093
19161  * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top,
19162  *                                        int i, int j, int k):
19163  *     if top.children == NULL: return olist             # <<<<<<<<<<<<<<
19164  *     # The i, j, k here are the offsets of "top" with respect to
19165  *     # the oct for whose neighbors we are searching.
19166  */
19167   __pyx_t_1 = ((__pyx_v_top->children == NULL) != 0);
19168   if (__pyx_t_1) {
19169     __pyx_r = __pyx_v_olist;
19170     goto __pyx_L0;
19171   }
19172 
19173   /* "yt/geometry/oct_container.pyx":1102
19174  *     # For now, we assume we will not be doing this along all three zeros,
19175  *     # because that would be pretty tricky.
19176  *     if i == j == k == 1: return olist             # <<<<<<<<<<<<<<
19177  *     cdef np.int64_t n[3]
19178  *     cdef np.int64_t ind[3]
19179  */
19180   __pyx_t_1 = (__pyx_v_i == __pyx_v_j);
19181   if (__pyx_t_1) {
19182     __pyx_t_1 = (__pyx_v_j == __pyx_v_k);
19183     if (__pyx_t_1) {
19184       __pyx_t_1 = (__pyx_v_k == 1);
19185     }
19186   }
19187   __pyx_t_2 = (__pyx_t_1 != 0);
19188   if (__pyx_t_2) {
19189     __pyx_r = __pyx_v_olist;
19190     goto __pyx_L0;
19191   }
19192 
19193   /* "yt/geometry/oct_container.pyx":1107
19194  *     cdef np.int64_t off[3][2]
19195  *     cdef np.int64_t ii, ij, ik, ci
19196  *     ind[0] = 1 - i             # <<<<<<<<<<<<<<
19197  *     ind[1] = 1 - j
19198  *     ind[2] = 1 - k
19199  */
19200   (__pyx_v_ind[0]) = (1 - __pyx_v_i);
19201 
19202   /* "yt/geometry/oct_container.pyx":1108
19203  *     cdef np.int64_t ii, ij, ik, ci
19204  *     ind[0] = 1 - i
19205  *     ind[1] = 1 - j             # <<<<<<<<<<<<<<
19206  *     ind[2] = 1 - k
19207  *     for ii in range(3):
19208  */
19209   (__pyx_v_ind[1]) = (1 - __pyx_v_j);
19210 
19211   /* "yt/geometry/oct_container.pyx":1109
19212  *     ind[0] = 1 - i
19213  *     ind[1] = 1 - j
19214  *     ind[2] = 1 - k             # <<<<<<<<<<<<<<
19215  *     for ii in range(3):
19216  *         if ind[ii] == 0:
19217  */
19218   (__pyx_v_ind[2]) = (1 - __pyx_v_k);
19219 
19220   /* "yt/geometry/oct_container.pyx":1110
19221  *     ind[1] = 1 - j
19222  *     ind[2] = 1 - k
19223  *     for ii in range(3):             # <<<<<<<<<<<<<<
19224  *         if ind[ii] == 0:
19225  *             n[ii] = 2
19226  */
19227   for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) {
19228     __pyx_v_ii = __pyx_t_3;
19229 
19230     /* "yt/geometry/oct_container.pyx":1111
19231  *     ind[2] = 1 - k
19232  *     for ii in range(3):
19233  *         if ind[ii] == 0:             # <<<<<<<<<<<<<<
19234  *             n[ii] = 2
19235  *             off[ii][0] = 0
19236  */
19237     __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == 0) != 0);
19238     if (__pyx_t_2) {
19239 
19240       /* "yt/geometry/oct_container.pyx":1112
19241  *     for ii in range(3):
19242  *         if ind[ii] == 0:
19243  *             n[ii] = 2             # <<<<<<<<<<<<<<
19244  *             off[ii][0] = 0
19245  *             off[ii][1] = 1
19246  */
19247       (__pyx_v_n[__pyx_v_ii]) = 2;
19248 
19249       /* "yt/geometry/oct_container.pyx":1113
19250  *         if ind[ii] == 0:
19251  *             n[ii] = 2
19252  *             off[ii][0] = 0             # <<<<<<<<<<<<<<
19253  *             off[ii][1] = 1
19254  *         elif ind[ii] == -1:
19255  */
19256       ((__pyx_v_off[__pyx_v_ii])[0]) = 0;
19257 
19258       /* "yt/geometry/oct_container.pyx":1114
19259  *             n[ii] = 2
19260  *             off[ii][0] = 0
19261  *             off[ii][1] = 1             # <<<<<<<<<<<<<<
19262  *         elif ind[ii] == -1:
19263  *             n[ii] = 1
19264  */
19265       ((__pyx_v_off[__pyx_v_ii])[1]) = 1;
19266 
19267       /* "yt/geometry/oct_container.pyx":1111
19268  *     ind[2] = 1 - k
19269  *     for ii in range(3):
19270  *         if ind[ii] == 0:             # <<<<<<<<<<<<<<
19271  *             n[ii] = 2
19272  *             off[ii][0] = 0
19273  */
19274       goto __pyx_L7;
19275     }
19276 
19277     /* "yt/geometry/oct_container.pyx":1115
19278  *             off[ii][0] = 0
19279  *             off[ii][1] = 1
19280  *         elif ind[ii] == -1:             # <<<<<<<<<<<<<<
19281  *             n[ii] = 1
19282  *             off[ii][0] = 1
19283  */
19284     __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == -1LL) != 0);
19285     if (__pyx_t_2) {
19286 
19287       /* "yt/geometry/oct_container.pyx":1116
19288  *             off[ii][1] = 1
19289  *         elif ind[ii] == -1:
19290  *             n[ii] = 1             # <<<<<<<<<<<<<<
19291  *             off[ii][0] = 1
19292  *         elif ind[ii] == 1:
19293  */
19294       (__pyx_v_n[__pyx_v_ii]) = 1;
19295 
19296       /* "yt/geometry/oct_container.pyx":1117
19297  *         elif ind[ii] == -1:
19298  *             n[ii] = 1
19299  *             off[ii][0] = 1             # <<<<<<<<<<<<<<
19300  *         elif ind[ii] == 1:
19301  *             n[ii] = 1
19302  */
19303       ((__pyx_v_off[__pyx_v_ii])[0]) = 1;
19304 
19305       /* "yt/geometry/oct_container.pyx":1115
19306  *             off[ii][0] = 0
19307  *             off[ii][1] = 1
19308  *         elif ind[ii] == -1:             # <<<<<<<<<<<<<<
19309  *             n[ii] = 1
19310  *             off[ii][0] = 1
19311  */
19312       goto __pyx_L7;
19313     }
19314 
19315     /* "yt/geometry/oct_container.pyx":1118
19316  *             n[ii] = 1
19317  *             off[ii][0] = 1
19318  *         elif ind[ii] == 1:             # <<<<<<<<<<<<<<
19319  *             n[ii] = 1
19320  *             off[ii][0] = 0
19321  */
19322     __pyx_t_2 = (((__pyx_v_ind[__pyx_v_ii]) == 1) != 0);
19323     if (__pyx_t_2) {
19324 
19325       /* "yt/geometry/oct_container.pyx":1119
19326  *             off[ii][0] = 1
19327  *         elif ind[ii] == 1:
19328  *             n[ii] = 1             # <<<<<<<<<<<<<<
19329  *             off[ii][0] = 0
19330  *     for ii in range(n[0]):
19331  */
19332       (__pyx_v_n[__pyx_v_ii]) = 1;
19333 
19334       /* "yt/geometry/oct_container.pyx":1120
19335  *         elif ind[ii] == 1:
19336  *             n[ii] = 1
19337  *             off[ii][0] = 0             # <<<<<<<<<<<<<<
19338  *     for ii in range(n[0]):
19339  *         for ij in range(n[1]):
19340  */
19341       ((__pyx_v_off[__pyx_v_ii])[0]) = 0;
19342 
19343       /* "yt/geometry/oct_container.pyx":1118
19344  *             n[ii] = 1
19345  *             off[ii][0] = 1
19346  *         elif ind[ii] == 1:             # <<<<<<<<<<<<<<
19347  *             n[ii] = 1
19348  *             off[ii][0] = 0
19349  */
19350     }
19351     __pyx_L7:;
19352   }
19353 
19354   /* "yt/geometry/oct_container.pyx":1121
19355  *             n[ii] = 1
19356  *             off[ii][0] = 0
19357  *     for ii in range(n[0]):             # <<<<<<<<<<<<<<
19358  *         for ij in range(n[1]):
19359  *             for ik in range(n[2]):
19360  */
19361   __pyx_t_3 = (__pyx_v_n[0]);
19362   __pyx_t_4 = __pyx_t_3;
19363   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
19364     __pyx_v_ii = __pyx_t_5;
19365 
19366     /* "yt/geometry/oct_container.pyx":1122
19367  *             off[ii][0] = 0
19368  *     for ii in range(n[0]):
19369  *         for ij in range(n[1]):             # <<<<<<<<<<<<<<
19370  *             for ik in range(n[2]):
19371  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])
19372  */
19373     __pyx_t_6 = (__pyx_v_n[1]);
19374     __pyx_t_7 = __pyx_t_6;
19375     for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
19376       __pyx_v_ij = __pyx_t_8;
19377 
19378       /* "yt/geometry/oct_container.pyx":1123
19379  *     for ii in range(n[0]):
19380  *         for ij in range(n[1]):
19381  *             for ik in range(n[2]):             # <<<<<<<<<<<<<<
19382  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])
19383  *                 cand = top.children[ci]
19384  */
19385       __pyx_t_9 = (__pyx_v_n[2]);
19386       __pyx_t_10 = __pyx_t_9;
19387       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
19388         __pyx_v_ik = __pyx_t_11;
19389 
19390         /* "yt/geometry/oct_container.pyx":1124
19391  *         for ij in range(n[1]):
19392  *             for ik in range(n[2]):
19393  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])             # <<<<<<<<<<<<<<
19394  *                 cand = top.children[ci]
19395  *                 if cand.children != NULL:
19396  */
19397         __pyx_v_ci = __pyx_f_2yt_8geometry_12oct_visitors_cind(((__pyx_v_off[0])[__pyx_v_ii]), ((__pyx_v_off[1])[__pyx_v_ij]), ((__pyx_v_off[2])[__pyx_v_ik]));
19398 
19399         /* "yt/geometry/oct_container.pyx":1125
19400  *             for ik in range(n[2]):
19401  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])
19402  *                 cand = top.children[ci]             # <<<<<<<<<<<<<<
19403  *                 if cand.children != NULL:
19404  *                     olist = OctList_subneighbor_find(olist,
19405  */
19406         __pyx_v_cand = (__pyx_v_top->children[__pyx_v_ci]);
19407 
19408         /* "yt/geometry/oct_container.pyx":1126
19409  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])
19410  *                 cand = top.children[ci]
19411  *                 if cand.children != NULL:             # <<<<<<<<<<<<<<
19412  *                     olist = OctList_subneighbor_find(olist,
19413  *                         cand, i, j, k)
19414  */
19415         __pyx_t_2 = ((__pyx_v_cand->children != NULL) != 0);
19416         if (__pyx_t_2) {
19417 
19418           /* "yt/geometry/oct_container.pyx":1127
19419  *                 cand = top.children[ci]
19420  *                 if cand.children != NULL:
19421  *                     olist = OctList_subneighbor_find(olist,             # <<<<<<<<<<<<<<
19422  *                         cand, i, j, k)
19423  *                 else:
19424  */
19425           __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_subneighbor_find(__pyx_v_olist, __pyx_v_cand, __pyx_v_i, __pyx_v_j, __pyx_v_k);
19426 
19427           /* "yt/geometry/oct_container.pyx":1126
19428  *                 ci = cind(off[0][ii], off[1][ij], off[2][ik])
19429  *                 cand = top.children[ci]
19430  *                 if cand.children != NULL:             # <<<<<<<<<<<<<<
19431  *                     olist = OctList_subneighbor_find(olist,
19432  *                         cand, i, j, k)
19433  */
19434           goto __pyx_L14;
19435         }
19436 
19437         /* "yt/geometry/oct_container.pyx":1130
19438  *                         cand, i, j, k)
19439  *                 else:
19440  *                     olist = OctList_append(olist, cand)             # <<<<<<<<<<<<<<
19441  *     return olist
19442  *
19443  */
19444         /*else*/ {
19445           __pyx_v_olist = __pyx_f_2yt_8geometry_13oct_container_OctList_append(__pyx_v_olist, __pyx_v_cand);
19446         }
19447         __pyx_L14:;
19448       }
19449     }
19450   }
19451 
19452   /* "yt/geometry/oct_container.pyx":1131
19453  *                 else:
19454  *                     olist = OctList_append(olist, cand)
19455  *     return olist             # <<<<<<<<<<<<<<
19456  *
19457  * cdef OctList *OctList_append(OctList *olist, Oct *o):
19458  */
19459   __pyx_r = __pyx_v_olist;
19460   goto __pyx_L0;
19461 
19462   /* "yt/geometry/oct_container.pyx":1091
19463  *         self.fill_style = "r"
19464  *
19465  * cdef OctList *OctList_subneighbor_find(OctList *olist, Oct *top,             # <<<<<<<<<<<<<<
19466  *                                        int i, int j, int k):
19467  *     if top.children == NULL: return olist
19468  */
19469 
19470   /* function exit code */
19471   __pyx_L0:;
19472   __Pyx_RefNannyFinishContext();
19473   return __pyx_r;
19474 }
19475 
19476 /* "yt/geometry/oct_container.pyx":1133
19477  *     return olist
19478  *
19479  * cdef OctList *OctList_append(OctList *olist, Oct *o):             # <<<<<<<<<<<<<<
19480  *     cdef OctList *this = olist
19481  *     if this == NULL:
19482  */
19483 
__pyx_f_2yt_8geometry_13oct_container_OctList_append(struct __pyx_t_2yt_8geometry_13oct_container_OctList * __pyx_v_olist,struct __pyx_t_2yt_8geometry_12oct_visitors_Oct * __pyx_v_o)19484 static struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_f_2yt_8geometry_13oct_container_OctList_append(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_o) {
19485   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_this;
19486   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_r;
19487   __Pyx_RefNannyDeclarations
19488   int __pyx_t_1;
19489   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2;
19490   __Pyx_RefNannySetupContext("OctList_append", 0);
19491 
19492   /* "yt/geometry/oct_container.pyx":1134
19493  *
19494  * cdef OctList *OctList_append(OctList *olist, Oct *o):
19495  *     cdef OctList *this = olist             # <<<<<<<<<<<<<<
19496  *     if this == NULL:
19497  *         this = <OctList *> malloc(sizeof(OctList))
19498  */
19499   __pyx_v_this = __pyx_v_olist;
19500 
19501   /* "yt/geometry/oct_container.pyx":1135
19502  * cdef OctList *OctList_append(OctList *olist, Oct *o):
19503  *     cdef OctList *this = olist
19504  *     if this == NULL:             # <<<<<<<<<<<<<<
19505  *         this = <OctList *> malloc(sizeof(OctList))
19506  *         this.next = NULL
19507  */
19508   __pyx_t_1 = ((__pyx_v_this == NULL) != 0);
19509   if (__pyx_t_1) {
19510 
19511     /* "yt/geometry/oct_container.pyx":1136
19512  *     cdef OctList *this = olist
19513  *     if this == NULL:
19514  *         this = <OctList *> malloc(sizeof(OctList))             # <<<<<<<<<<<<<<
19515  *         this.next = NULL
19516  *         this.o = o
19517  */
19518     __pyx_v_this = ((struct __pyx_t_2yt_8geometry_13oct_container_OctList *)malloc((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctList))));
19519 
19520     /* "yt/geometry/oct_container.pyx":1137
19521  *     if this == NULL:
19522  *         this = <OctList *> malloc(sizeof(OctList))
19523  *         this.next = NULL             # <<<<<<<<<<<<<<
19524  *         this.o = o
19525  *         return this
19526  */
19527     __pyx_v_this->next = NULL;
19528 
19529     /* "yt/geometry/oct_container.pyx":1138
19530  *         this = <OctList *> malloc(sizeof(OctList))
19531  *         this.next = NULL
19532  *         this.o = o             # <<<<<<<<<<<<<<
19533  *         return this
19534  *     while this.next != NULL:
19535  */
19536     __pyx_v_this->o = __pyx_v_o;
19537 
19538     /* "yt/geometry/oct_container.pyx":1139
19539  *         this.next = NULL
19540  *         this.o = o
19541  *         return this             # <<<<<<<<<<<<<<
19542  *     while this.next != NULL:
19543  *         this = this.next
19544  */
19545     __pyx_r = __pyx_v_this;
19546     goto __pyx_L0;
19547 
19548     /* "yt/geometry/oct_container.pyx":1135
19549  * cdef OctList *OctList_append(OctList *olist, Oct *o):
19550  *     cdef OctList *this = olist
19551  *     if this == NULL:             # <<<<<<<<<<<<<<
19552  *         this = <OctList *> malloc(sizeof(OctList))
19553  *         this.next = NULL
19554  */
19555   }
19556 
19557   /* "yt/geometry/oct_container.pyx":1140
19558  *         this.o = o
19559  *         return this
19560  *     while this.next != NULL:             # <<<<<<<<<<<<<<
19561  *         this = this.next
19562  *     this.next = <OctList*> malloc(sizeof(OctList))
19563  */
19564   while (1) {
19565     __pyx_t_1 = ((__pyx_v_this->next != NULL) != 0);
19566     if (!__pyx_t_1) break;
19567 
19568     /* "yt/geometry/oct_container.pyx":1141
19569  *         return this
19570  *     while this.next != NULL:
19571  *         this = this.next             # <<<<<<<<<<<<<<
19572  *     this.next = <OctList*> malloc(sizeof(OctList))
19573  *     this = this.next
19574  */
19575     __pyx_t_2 = __pyx_v_this->next;
19576     __pyx_v_this = __pyx_t_2;
19577   }
19578 
19579   /* "yt/geometry/oct_container.pyx":1142
19580  *     while this.next != NULL:
19581  *         this = this.next
19582  *     this.next = <OctList*> malloc(sizeof(OctList))             # <<<<<<<<<<<<<<
19583  *     this = this.next
19584  *     this.o = o
19585  */
19586   __pyx_v_this->next = ((struct __pyx_t_2yt_8geometry_13oct_container_OctList *)malloc((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctList))));
19587 
19588   /* "yt/geometry/oct_container.pyx":1143
19589  *         this = this.next
19590  *     this.next = <OctList*> malloc(sizeof(OctList))
19591  *     this = this.next             # <<<<<<<<<<<<<<
19592  *     this.o = o
19593  *     this.next = NULL
19594  */
19595   __pyx_t_2 = __pyx_v_this->next;
19596   __pyx_v_this = __pyx_t_2;
19597 
19598   /* "yt/geometry/oct_container.pyx":1144
19599  *     this.next = <OctList*> malloc(sizeof(OctList))
19600  *     this = this.next
19601  *     this.o = o             # <<<<<<<<<<<<<<
19602  *     this.next = NULL
19603  *     return this
19604  */
19605   __pyx_v_this->o = __pyx_v_o;
19606 
19607   /* "yt/geometry/oct_container.pyx":1145
19608  *     this = this.next
19609  *     this.o = o
19610  *     this.next = NULL             # <<<<<<<<<<<<<<
19611  *     return this
19612  *
19613  */
19614   __pyx_v_this->next = NULL;
19615 
19616   /* "yt/geometry/oct_container.pyx":1146
19617  *     this.o = o
19618  *     this.next = NULL
19619  *     return this             # <<<<<<<<<<<<<<
19620  *
19621  * cdef int OctList_count(OctList *olist):
19622  */
19623   __pyx_r = __pyx_v_this;
19624   goto __pyx_L0;
19625 
19626   /* "yt/geometry/oct_container.pyx":1133
19627  *     return olist
19628  *
19629  * cdef OctList *OctList_append(OctList *olist, Oct *o):             # <<<<<<<<<<<<<<
19630  *     cdef OctList *this = olist
19631  *     if this == NULL:
19632  */
19633 
19634   /* function exit code */
19635   __pyx_L0:;
19636   __Pyx_RefNannyFinishContext();
19637   return __pyx_r;
19638 }
19639 
19640 /* "yt/geometry/oct_container.pyx":1148
19641  *     return this
19642  *
19643  * cdef int OctList_count(OctList *olist):             # <<<<<<<<<<<<<<
19644  *     cdef OctList *this = olist
19645  *     cdef int i = 0 # Count the list
19646  */
19647 
__pyx_f_2yt_8geometry_13oct_container_OctList_count(struct __pyx_t_2yt_8geometry_13oct_container_OctList * __pyx_v_olist)19648 static int __pyx_f_2yt_8geometry_13oct_container_OctList_count(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist) {
19649   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_this;
19650   int __pyx_v_i;
19651   int __pyx_r;
19652   __Pyx_RefNannyDeclarations
19653   int __pyx_t_1;
19654   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2;
19655   __Pyx_RefNannySetupContext("OctList_count", 0);
19656 
19657   /* "yt/geometry/oct_container.pyx":1149
19658  *
19659  * cdef int OctList_count(OctList *olist):
19660  *     cdef OctList *this = olist             # <<<<<<<<<<<<<<
19661  *     cdef int i = 0 # Count the list
19662  *     while this != NULL:
19663  */
19664   __pyx_v_this = __pyx_v_olist;
19665 
19666   /* "yt/geometry/oct_container.pyx":1150
19667  * cdef int OctList_count(OctList *olist):
19668  *     cdef OctList *this = olist
19669  *     cdef int i = 0 # Count the list             # <<<<<<<<<<<<<<
19670  *     while this != NULL:
19671  *         i += 1
19672  */
19673   __pyx_v_i = 0;
19674 
19675   /* "yt/geometry/oct_container.pyx":1151
19676  *     cdef OctList *this = olist
19677  *     cdef int i = 0 # Count the list
19678  *     while this != NULL:             # <<<<<<<<<<<<<<
19679  *         i += 1
19680  *         this = this.next
19681  */
19682   while (1) {
19683     __pyx_t_1 = ((__pyx_v_this != NULL) != 0);
19684     if (!__pyx_t_1) break;
19685 
19686     /* "yt/geometry/oct_container.pyx":1152
19687  *     cdef int i = 0 # Count the list
19688  *     while this != NULL:
19689  *         i += 1             # <<<<<<<<<<<<<<
19690  *         this = this.next
19691  *     return i
19692  */
19693     __pyx_v_i = (__pyx_v_i + 1);
19694 
19695     /* "yt/geometry/oct_container.pyx":1153
19696  *     while this != NULL:
19697  *         i += 1
19698  *         this = this.next             # <<<<<<<<<<<<<<
19699  *     return i
19700  *
19701  */
19702     __pyx_t_2 = __pyx_v_this->next;
19703     __pyx_v_this = __pyx_t_2;
19704   }
19705 
19706   /* "yt/geometry/oct_container.pyx":1154
19707  *         i += 1
19708  *         this = this.next
19709  *     return i             # <<<<<<<<<<<<<<
19710  *
19711  * cdef void OctList_delete(OctList *olist):
19712  */
19713   __pyx_r = __pyx_v_i;
19714   goto __pyx_L0;
19715 
19716   /* "yt/geometry/oct_container.pyx":1148
19717  *     return this
19718  *
19719  * cdef int OctList_count(OctList *olist):             # <<<<<<<<<<<<<<
19720  *     cdef OctList *this = olist
19721  *     cdef int i = 0 # Count the list
19722  */
19723 
19724   /* function exit code */
19725   __pyx_L0:;
19726   __Pyx_RefNannyFinishContext();
19727   return __pyx_r;
19728 }
19729 
19730 /* "yt/geometry/oct_container.pyx":1156
19731  *     return i
19732  *
19733  * cdef void OctList_delete(OctList *olist):             # <<<<<<<<<<<<<<
19734  *     cdef OctList *next
19735  *     cdef OctList *this = olist
19736  */
19737 
__pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList * __pyx_v_olist)19738 static void __pyx_f_2yt_8geometry_13oct_container_OctList_delete(struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_olist) {
19739   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_next;
19740   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_v_this;
19741   __Pyx_RefNannyDeclarations
19742   int __pyx_t_1;
19743   struct __pyx_t_2yt_8geometry_13oct_container_OctList *__pyx_t_2;
19744   __Pyx_RefNannySetupContext("OctList_delete", 0);
19745 
19746   /* "yt/geometry/oct_container.pyx":1158
19747  * cdef void OctList_delete(OctList *olist):
19748  *     cdef OctList *next
19749  *     cdef OctList *this = olist             # <<<<<<<<<<<<<<
19750  *     while this != NULL:
19751  *         next = this.next
19752  */
19753   __pyx_v_this = __pyx_v_olist;
19754 
19755   /* "yt/geometry/oct_container.pyx":1159
19756  *     cdef OctList *next
19757  *     cdef OctList *this = olist
19758  *     while this != NULL:             # <<<<<<<<<<<<<<
19759  *         next = this.next
19760  *         free(this)
19761  */
19762   while (1) {
19763     __pyx_t_1 = ((__pyx_v_this != NULL) != 0);
19764     if (!__pyx_t_1) break;
19765 
19766     /* "yt/geometry/oct_container.pyx":1160
19767  *     cdef OctList *this = olist
19768  *     while this != NULL:
19769  *         next = this.next             # <<<<<<<<<<<<<<
19770  *         free(this)
19771  *         this = next
19772  */
19773     __pyx_t_2 = __pyx_v_this->next;
19774     __pyx_v_next = __pyx_t_2;
19775 
19776     /* "yt/geometry/oct_container.pyx":1161
19777  *     while this != NULL:
19778  *         next = this.next
19779  *         free(this)             # <<<<<<<<<<<<<<
19780  *         this = next
19781  *
19782  */
19783     free(__pyx_v_this);
19784 
19785     /* "yt/geometry/oct_container.pyx":1162
19786  *         next = this.next
19787  *         free(this)
19788  *         this = next             # <<<<<<<<<<<<<<
19789  *
19790  * cdef class OctObjectPool(ObjectPool):
19791  */
19792     __pyx_v_this = __pyx_v_next;
19793   }
19794 
19795   /* "yt/geometry/oct_container.pyx":1156
19796  *     return i
19797  *
19798  * cdef void OctList_delete(OctList *olist):             # <<<<<<<<<<<<<<
19799  *     cdef OctList *next
19800  *     cdef OctList *this = olist
19801  */
19802 
19803   /* function exit code */
19804   __Pyx_RefNannyFinishContext();
19805 }
19806 
19807 /* "yt/geometry/oct_container.pyx":1170
19808  *     # allocated memory in them.  Implementing _con_to_array also provides the
19809  *     # opportunity to supply views of the octs in Python code.
19810  *     def __cinit__(self):             # <<<<<<<<<<<<<<
19811  *         # Base class will ALSO be called
19812  *         self.itemsize = sizeof(Oct)
19813  */
19814 
19815 /* Python wrapper */
19816 static int __pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)19817 static int __pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19818   int __pyx_r;
19819   __Pyx_RefNannyDeclarations
19820   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
19821   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
19822     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
19823   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
19824   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self));
19825 
19826   /* function exit code */
19827   __Pyx_RefNannyFinishContext();
19828   return __pyx_r;
19829 }
19830 
__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self)19831 static int __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool___cinit__(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self) {
19832   int __pyx_r;
19833   __Pyx_RefNannyDeclarations
19834   __Pyx_RefNannySetupContext("__cinit__", 0);
19835 
19836   /* "yt/geometry/oct_container.pyx":1172
19837  *     def __cinit__(self):
19838  *         # Base class will ALSO be called
19839  *         self.itemsize = sizeof(Oct)             # <<<<<<<<<<<<<<
19840  *         assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer))
19841  *
19842  */
19843   __pyx_v_self->__pyx_base.itemsize = (sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_Oct));
19844 
19845   /* "yt/geometry/oct_container.pyx":1173
19846  *         # Base class will ALSO be called
19847  *         self.itemsize = sizeof(Oct)
19848  *         assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer))             # <<<<<<<<<<<<<<
19849  *
19850  *     cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,
19851  */
19852   #ifndef CYTHON_WITHOUT_ASSERTIONS
19853   if (unlikely(!Py_OptimizeFlag)) {
19854     if (unlikely(!(((sizeof(struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer)) == (sizeof(struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer))) != 0))) {
19855       PyErr_SetNone(PyExc_AssertionError);
19856       __PYX_ERR(0, 1173, __pyx_L1_error)
19857     }
19858   }
19859   #endif
19860 
19861   /* "yt/geometry/oct_container.pyx":1170
19862  *     # allocated memory in them.  Implementing _con_to_array also provides the
19863  *     # opportunity to supply views of the octs in Python code.
19864  *     def __cinit__(self):             # <<<<<<<<<<<<<<
19865  *         # Base class will ALSO be called
19866  *         self.itemsize = sizeof(Oct)
19867  */
19868 
19869   /* function exit code */
19870   __pyx_r = 0;
19871   goto __pyx_L0;
19872   __pyx_L1_error:;
19873   __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19874   __pyx_r = -1;
19875   __pyx_L0:;
19876   __Pyx_RefNannyFinishContext();
19877   return __pyx_r;
19878 }
19879 
19880 /* "yt/geometry/oct_container.pyx":1175
19881  *         assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer))
19882  *
19883  *     cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,             # <<<<<<<<<<<<<<
19884  *                          np.int64_t con_id):
19885  *         cdef np.uint64_t i
19886  */
19887 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,void * __pyx_v_obj,__pyx_t_5numpy_uint64_t __pyx_v_n,__pyx_t_5numpy_uint64_t __pyx_v_offset,CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id)19888 static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) {
19889   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_octs;
19890   __Pyx_RefNannyDeclarations
19891   __pyx_t_5numpy_uint64_t __pyx_t_1;
19892   __pyx_t_5numpy_uint64_t __pyx_t_2;
19893   __pyx_t_5numpy_uint64_t __pyx_t_3;
19894   __Pyx_RefNannySetupContext("setup_objs", 0);
19895 
19896   /* "yt/geometry/oct_container.pyx":1178
19897  *                          np.int64_t con_id):
19898  *         cdef np.uint64_t i
19899  *         cdef Oct* octs = <Oct *> obj             # <<<<<<<<<<<<<<
19900  *         for n in range(n):
19901  *             octs[n].file_ind = octs[n].domain = - 1
19902  */
19903   __pyx_v_octs = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)__pyx_v_obj);
19904 
19905   /* "yt/geometry/oct_container.pyx":1179
19906  *         cdef np.uint64_t i
19907  *         cdef Oct* octs = <Oct *> obj
19908  *         for n in range(n):             # <<<<<<<<<<<<<<
19909  *             octs[n].file_ind = octs[n].domain = - 1
19910  *             octs[n].domain_ind = n + offset
19911  */
19912   __pyx_t_1 = __pyx_v_n;
19913   __pyx_t_2 = __pyx_t_1;
19914   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19915     __pyx_v_n = __pyx_t_3;
19916 
19917     /* "yt/geometry/oct_container.pyx":1180
19918  *         cdef Oct* octs = <Oct *> obj
19919  *         for n in range(n):
19920  *             octs[n].file_ind = octs[n].domain = - 1             # <<<<<<<<<<<<<<
19921  *             octs[n].domain_ind = n + offset
19922  *             octs[n].children = NULL
19923  */
19924     (__pyx_v_octs[__pyx_v_n]).file_ind = -1LL;
19925     (__pyx_v_octs[__pyx_v_n]).domain = -1LL;
19926 
19927     /* "yt/geometry/oct_container.pyx":1181
19928  *         for n in range(n):
19929  *             octs[n].file_ind = octs[n].domain = - 1
19930  *             octs[n].domain_ind = n + offset             # <<<<<<<<<<<<<<
19931  *             octs[n].children = NULL
19932  *
19933  */
19934     (__pyx_v_octs[__pyx_v_n]).domain_ind = (__pyx_v_n + __pyx_v_offset);
19935 
19936     /* "yt/geometry/oct_container.pyx":1182
19937  *             octs[n].file_ind = octs[n].domain = - 1
19938  *             octs[n].domain_ind = n + offset
19939  *             octs[n].children = NULL             # <<<<<<<<<<<<<<
19940  *
19941  *     cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,
19942  */
19943     (__pyx_v_octs[__pyx_v_n]).children = NULL;
19944   }
19945 
19946   /* "yt/geometry/oct_container.pyx":1175
19947  *         assert(sizeof(OctAllocationContainer) == sizeof(AllocationContainer))
19948  *
19949  *     cdef void setup_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,             # <<<<<<<<<<<<<<
19950  *                          np.int64_t con_id):
19951  *         cdef np.uint64_t i
19952  */
19953 
19954   /* function exit code */
19955   __Pyx_RefNannyFinishContext();
19956 }
19957 
19958 /* "yt/geometry/oct_container.pyx":1184
19959  *             octs[n].children = NULL
19960  *
19961  *     cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,             # <<<<<<<<<<<<<<
19962  *                            np.int64_t con_id):
19963  *         cdef np.uint64_t i, j
19964  */
19965 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,void * __pyx_v_obj,__pyx_t_5numpy_uint64_t __pyx_v_n,CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset,CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id)19966 static void __pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, void *__pyx_v_obj, __pyx_t_5numpy_uint64_t __pyx_v_n, CYTHON_UNUSED __pyx_t_5numpy_uint64_t __pyx_v_offset, CYTHON_UNUSED __pyx_t_5numpy_int64_t __pyx_v_con_id) {
19967   __pyx_t_5numpy_uint64_t __pyx_v_i;
19968   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *__pyx_v_my_octs;
19969   __Pyx_RefNannyDeclarations
19970   __pyx_t_5numpy_uint64_t __pyx_t_1;
19971   __pyx_t_5numpy_uint64_t __pyx_t_2;
19972   __pyx_t_5numpy_uint64_t __pyx_t_3;
19973   int __pyx_t_4;
19974   __Pyx_RefNannySetupContext("teardown_objs", 0);
19975 
19976   /* "yt/geometry/oct_container.pyx":1187
19977  *                            np.int64_t con_id):
19978  *         cdef np.uint64_t i, j
19979  *         cdef Oct *my_octs = <Oct *> obj             # <<<<<<<<<<<<<<
19980  *         for i in range(n):
19981  *             if my_octs[i].children != NULL:
19982  */
19983   __pyx_v_my_octs = ((struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)__pyx_v_obj);
19984 
19985   /* "yt/geometry/oct_container.pyx":1188
19986  *         cdef np.uint64_t i, j
19987  *         cdef Oct *my_octs = <Oct *> obj
19988  *         for i in range(n):             # <<<<<<<<<<<<<<
19989  *             if my_octs[i].children != NULL:
19990  *                 free(my_octs[i].children)
19991  */
19992   __pyx_t_1 = __pyx_v_n;
19993   __pyx_t_2 = __pyx_t_1;
19994   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19995     __pyx_v_i = __pyx_t_3;
19996 
19997     /* "yt/geometry/oct_container.pyx":1189
19998  *         cdef Oct *my_octs = <Oct *> obj
19999  *         for i in range(n):
20000  *             if my_octs[i].children != NULL:             # <<<<<<<<<<<<<<
20001  *                 free(my_octs[i].children)
20002  *         free(obj)
20003  */
20004     __pyx_t_4 = (((__pyx_v_my_octs[__pyx_v_i]).children != NULL) != 0);
20005     if (__pyx_t_4) {
20006 
20007       /* "yt/geometry/oct_container.pyx":1190
20008  *         for i in range(n):
20009  *             if my_octs[i].children != NULL:
20010  *                 free(my_octs[i].children)             # <<<<<<<<<<<<<<
20011  *         free(obj)
20012  *
20013  */
20014       free((__pyx_v_my_octs[__pyx_v_i]).children);
20015 
20016       /* "yt/geometry/oct_container.pyx":1189
20017  *         cdef Oct *my_octs = <Oct *> obj
20018  *         for i in range(n):
20019  *             if my_octs[i].children != NULL:             # <<<<<<<<<<<<<<
20020  *                 free(my_octs[i].children)
20021  *         free(obj)
20022  */
20023     }
20024   }
20025 
20026   /* "yt/geometry/oct_container.pyx":1191
20027  *             if my_octs[i].children != NULL:
20028  *                 free(my_octs[i].children)
20029  *         free(obj)             # <<<<<<<<<<<<<<
20030  *
20031  *     def _con_to_array(self, int i):
20032  */
20033   free(__pyx_v_obj);
20034 
20035   /* "yt/geometry/oct_container.pyx":1184
20036  *             octs[n].children = NULL
20037  *
20038  *     cdef void teardown_objs(self, void *obj, np.uint64_t n, np.uint64_t offset,             # <<<<<<<<<<<<<<
20039  *                            np.int64_t con_id):
20040  *         cdef np.uint64_t i, j
20041  */
20042 
20043   /* function exit code */
20044   __Pyx_RefNannyFinishContext();
20045 }
20046 
20047 /* "yt/geometry/oct_container.pyx":1193
20048  *         free(obj)
20049  *
20050  *     def _con_to_array(self, int i):             # <<<<<<<<<<<<<<
20051  *         cdef AllocationContainer *obj = &self.containers[i]
20052  *         if obj.n_assigned == 0:
20053  */
20054 
20055 /* Python wrapper */
20056 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array(PyObject * __pyx_v_self,PyObject * __pyx_arg_i)20057 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
20058   int __pyx_v_i;
20059   PyObject *__pyx_r = 0;
20060   __Pyx_RefNannyDeclarations
20061   __Pyx_RefNannySetupContext("_con_to_array (wrapper)", 0);
20062   assert(__pyx_arg_i); {
20063     __pyx_v_i = __Pyx_PyInt_As_int(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1193, __pyx_L3_error)
20064   }
20065   goto __pyx_L4_argument_unpacking_done;
20066   __pyx_L3_error:;
20067   __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20068   __Pyx_RefNannyFinishContext();
20069   return NULL;
20070   __pyx_L4_argument_unpacking_done:;
20071   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self), ((int)__pyx_v_i));
20072 
20073   /* function exit code */
20074   __Pyx_RefNannyFinishContext();
20075   return __pyx_r;
20076 }
20077 
__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,int __pyx_v_i)20078 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_2_con_to_array(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) {
20079   struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *__pyx_v_obj;
20080   __Pyx_memviewslice __pyx_v_mm = { 0, 0, { 0 }, { 0 }, { 0 } };
20081   PyObject *__pyx_v_rv = NULL;
20082   PyObject *__pyx_r = NULL;
20083   __Pyx_RefNannyDeclarations
20084   int __pyx_t_1;
20085   struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *__pyx_t_2;
20086   struct __pyx_array_obj *__pyx_t_3 = NULL;
20087   PyObject *__pyx_t_4 = NULL;
20088   PyObject *__pyx_t_5 = NULL;
20089   __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
20090   PyObject *__pyx_t_7 = NULL;
20091   PyObject *__pyx_t_8 = NULL;
20092   __Pyx_RefNannySetupContext("_con_to_array", 0);
20093 
20094   /* "yt/geometry/oct_container.pyx":1194
20095  *
20096  *     def _con_to_array(self, int i):
20097  *         cdef AllocationContainer *obj = &self.containers[i]             # <<<<<<<<<<<<<<
20098  *         if obj.n_assigned == 0:
20099  *             return None
20100  */
20101   __pyx_v_obj = (&(__pyx_v_self->__pyx_base.containers[__pyx_v_i]));
20102 
20103   /* "yt/geometry/oct_container.pyx":1195
20104  *     def _con_to_array(self, int i):
20105  *         cdef AllocationContainer *obj = &self.containers[i]
20106  *         if obj.n_assigned == 0:             # <<<<<<<<<<<<<<
20107  *             return None
20108  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (
20109  */
20110   __pyx_t_1 = ((__pyx_v_obj->n_assigned == 0) != 0);
20111   if (__pyx_t_1) {
20112 
20113     /* "yt/geometry/oct_container.pyx":1196
20114  *         cdef AllocationContainer *obj = &self.containers[i]
20115  *         if obj.n_assigned == 0:
20116  *             return None             # <<<<<<<<<<<<<<
20117  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (
20118  *                 <OctPadded*> obj.my_objs)
20119  */
20120     __Pyx_XDECREF(__pyx_r);
20121     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20122     goto __pyx_L0;
20123 
20124     /* "yt/geometry/oct_container.pyx":1195
20125  *     def _con_to_array(self, int i):
20126  *         cdef AllocationContainer *obj = &self.containers[i]
20127  *         if obj.n_assigned == 0:             # <<<<<<<<<<<<<<
20128  *             return None
20129  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (
20130  */
20131   }
20132 
20133   /* "yt/geometry/oct_container.pyx":1198
20134  *             return None
20135  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (
20136  *                 <OctPadded*> obj.my_objs)             # <<<<<<<<<<<<<<
20137  *         rv = np.asarray(mm)
20138  *         return rv
20139  */
20140   __pyx_t_2 = ((struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *)__pyx_v_obj->my_objs);
20141 
20142   /* "yt/geometry/oct_container.pyx":1197
20143  *         if obj.n_assigned == 0:
20144  *             return None
20145  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (             # <<<<<<<<<<<<<<
20146  *                 <OctPadded*> obj.my_objs)
20147  *         rv = np.asarray(mm)
20148  */
20149   if (!__pyx_t_2) {
20150     PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
20151     __PYX_ERR(0, 1198, __pyx_L1_error)
20152   }
20153   __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded);
20154   __pyx_t_4 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_obj->n_assigned));
20155   if (unlikely(!__pyx_t_5 || !__pyx_t_4 || !PyBytes_AsString(__pyx_t_5))) __PYX_ERR(0, 1197, __pyx_L1_error)
20156   __Pyx_GOTREF(__pyx_t_5);
20157   __Pyx_GOTREF(__pyx_t_4);
20158   __pyx_t_3 = __pyx_array_new(__pyx_t_4, sizeof(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_t_2);
20159   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __pyx_L1_error)
20160   __Pyx_GOTREF(__pyx_t_3);
20161   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20162   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20163   __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(((PyObject *)__pyx_t_3), PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 1197, __pyx_L1_error)
20164   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
20165   __pyx_v_mm = __pyx_t_6;
20166   __pyx_t_6.memview = NULL;
20167   __pyx_t_6.data = NULL;
20168 
20169   /* "yt/geometry/oct_container.pyx":1199
20170  *         cdef OctPadded[:] mm = <OctPadded[:obj.n_assigned]> (
20171  *                 <OctPadded*> obj.my_objs)
20172  *         rv = np.asarray(mm)             # <<<<<<<<<<<<<<
20173  *         return rv
20174  */
20175   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error)
20176   __Pyx_GOTREF(__pyx_t_4);
20177   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
20178   __Pyx_GOTREF(__pyx_t_7);
20179   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20180   __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_mm, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error)
20181   __Pyx_GOTREF(__pyx_t_4);
20182   __pyx_t_8 = NULL;
20183   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20184     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20185     if (likely(__pyx_t_8)) {
20186       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20187       __Pyx_INCREF(__pyx_t_8);
20188       __Pyx_INCREF(function);
20189       __Pyx_DECREF_SET(__pyx_t_7, function);
20190     }
20191   }
20192   __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
20193   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20194   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20195   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
20196   __Pyx_GOTREF(__pyx_t_5);
20197   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20198   __pyx_v_rv = __pyx_t_5;
20199   __pyx_t_5 = 0;
20200 
20201   /* "yt/geometry/oct_container.pyx":1200
20202  *                 <OctPadded*> obj.my_objs)
20203  *         rv = np.asarray(mm)
20204  *         return rv             # <<<<<<<<<<<<<<
20205  */
20206   __Pyx_XDECREF(__pyx_r);
20207   __Pyx_INCREF(__pyx_v_rv);
20208   __pyx_r = __pyx_v_rv;
20209   goto __pyx_L0;
20210 
20211   /* "yt/geometry/oct_container.pyx":1193
20212  *         free(obj)
20213  *
20214  *     def _con_to_array(self, int i):             # <<<<<<<<<<<<<<
20215  *         cdef AllocationContainer *obj = &self.containers[i]
20216  *         if obj.n_assigned == 0:
20217  */
20218 
20219   /* function exit code */
20220   __pyx_L1_error:;
20221   __Pyx_XDECREF(((PyObject *)__pyx_t_3));
20222   __Pyx_XDECREF(__pyx_t_4);
20223   __Pyx_XDECREF(__pyx_t_5);
20224   __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
20225   __Pyx_XDECREF(__pyx_t_7);
20226   __Pyx_XDECREF(__pyx_t_8);
20227   __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool._con_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20228   __pyx_r = NULL;
20229   __pyx_L0:;
20230   __PYX_XDEC_MEMVIEW(&__pyx_v_mm, 1);
20231   __Pyx_XDECREF(__pyx_v_rv);
20232   __Pyx_XGIVEREF(__pyx_r);
20233   __Pyx_RefNannyFinishContext();
20234   return __pyx_r;
20235 }
20236 
20237 /* "(tree fragment)":1
20238  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20239  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20240  * def __setstate_cython__(self, __pyx_state):
20241  */
20242 
20243 /* Python wrapper */
20244 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)20245 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
20246   PyObject *__pyx_r = 0;
20247   __Pyx_RefNannyDeclarations
20248   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
20249   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self));
20250 
20251   /* function exit code */
20252   __Pyx_RefNannyFinishContext();
20253   return __pyx_r;
20254 }
20255 
__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self)20256 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self) {
20257   PyObject *__pyx_r = NULL;
20258   __Pyx_RefNannyDeclarations
20259   PyObject *__pyx_t_1 = NULL;
20260   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
20261 
20262   /* "(tree fragment)":2
20263  * def __reduce_cython__(self):
20264  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20265  * def __setstate_cython__(self, __pyx_state):
20266  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20267  */
20268   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
20269   __Pyx_GOTREF(__pyx_t_1);
20270   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20271   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20272   __PYX_ERR(1, 2, __pyx_L1_error)
20273 
20274   /* "(tree fragment)":1
20275  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
20276  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20277  * def __setstate_cython__(self, __pyx_state):
20278  */
20279 
20280   /* function exit code */
20281   __pyx_L1_error:;
20282   __Pyx_XDECREF(__pyx_t_1);
20283   __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20284   __pyx_r = NULL;
20285   __Pyx_XGIVEREF(__pyx_r);
20286   __Pyx_RefNannyFinishContext();
20287   return __pyx_r;
20288 }
20289 
20290 /* "(tree fragment)":3
20291  * def __reduce_cython__(self):
20292  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20293  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20294  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20295  */
20296 
20297 /* Python wrapper */
20298 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)20299 static PyObject *__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
20300   PyObject *__pyx_r = 0;
20301   __Pyx_RefNannyDeclarations
20302   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
20303   __pyx_r = __pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
20304 
20305   /* function exit code */
20306   __Pyx_RefNannyFinishContext();
20307   return __pyx_r;
20308 }
20309 
__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)20310 static PyObject *__pyx_pf_2yt_8geometry_13oct_container_13OctObjectPool_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
20311   PyObject *__pyx_r = NULL;
20312   __Pyx_RefNannyDeclarations
20313   PyObject *__pyx_t_1 = NULL;
20314   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
20315 
20316   /* "(tree fragment)":4
20317  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20318  * def __setstate_cython__(self, __pyx_state):
20319  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
20320  */
20321   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20322   __Pyx_GOTREF(__pyx_t_1);
20323   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20324   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20325   __PYX_ERR(1, 4, __pyx_L1_error)
20326 
20327   /* "(tree fragment)":3
20328  * def __reduce_cython__(self):
20329  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20330  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
20331  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20332  */
20333 
20334   /* function exit code */
20335   __pyx_L1_error:;
20336   __Pyx_XDECREF(__pyx_t_1);
20337   __Pyx_AddTraceback("yt.geometry.oct_container.OctObjectPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20338   __pyx_r = NULL;
20339   __Pyx_XGIVEREF(__pyx_r);
20340   __Pyx_RefNannyFinishContext();
20341   return __pyx_r;
20342 }
20343 
20344 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
20345  *         # experimental exception made for __getbuffer__ and __releasebuffer__
20346  *         # -- the details of this may change.
20347  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
20348  *             # This implementation of getbuffer is geared towards Cython
20349  *             # requirements, and does not yet fulfill the PEP.
20350  */
20351 
20352 /* Python wrapper */
20353 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)20354 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
20355   int __pyx_r;
20356   __Pyx_RefNannyDeclarations
20357   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
20358   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
20359 
20360   /* function exit code */
20361   __Pyx_RefNannyFinishContext();
20362   return __pyx_r;
20363 }
20364 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)20365 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
20366   int __pyx_v_i;
20367   int __pyx_v_ndim;
20368   int __pyx_v_endian_detector;
20369   int __pyx_v_little_endian;
20370   int __pyx_v_t;
20371   char *__pyx_v_f;
20372   PyArray_Descr *__pyx_v_descr = 0;
20373   int __pyx_v_offset;
20374   int __pyx_r;
20375   __Pyx_RefNannyDeclarations
20376   int __pyx_t_1;
20377   int __pyx_t_2;
20378   PyObject *__pyx_t_3 = NULL;
20379   int __pyx_t_4;
20380   int __pyx_t_5;
20381   int __pyx_t_6;
20382   PyArray_Descr *__pyx_t_7;
20383   PyObject *__pyx_t_8 = NULL;
20384   char *__pyx_t_9;
20385   if (__pyx_v_info == NULL) {
20386     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
20387     return -1;
20388   }
20389   __Pyx_RefNannySetupContext("__getbuffer__", 0);
20390   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
20391   __Pyx_GIVEREF(__pyx_v_info->obj);
20392 
20393   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
20394  *
20395  *             cdef int i, ndim
20396  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
20397  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
20398  *
20399  */
20400   __pyx_v_endian_detector = 1;
20401 
20402   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
20403  *             cdef int i, ndim
20404  *             cdef int endian_detector = 1
20405  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
20406  *
20407  *             ndim = PyArray_NDIM(self)
20408  */
20409   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
20410 
20411   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
20412  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
20413  *
20414  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
20415  *
20416  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
20417  */
20418   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
20419 
20420   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
20421  *             ndim = PyArray_NDIM(self)
20422  *
20423  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
20424  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
20425  *                 raise ValueError(u"ndarray is not C contiguous")
20426  */
20427   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
20428   if (__pyx_t_2) {
20429   } else {
20430     __pyx_t_1 = __pyx_t_2;
20431     goto __pyx_L4_bool_binop_done;
20432   }
20433 
20434   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
20435  *
20436  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
20437  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
20438  *                 raise ValueError(u"ndarray is not C contiguous")
20439  *
20440  */
20441   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
20442   __pyx_t_1 = __pyx_t_2;
20443   __pyx_L4_bool_binop_done:;
20444 
20445   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
20446  *             ndim = PyArray_NDIM(self)
20447  *
20448  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
20449  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
20450  *                 raise ValueError(u"ndarray is not C contiguous")
20451  */
20452   if (unlikely(__pyx_t_1)) {
20453 
20454     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
20455  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
20456  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
20457  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
20458  *
20459  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
20460  */
20461     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
20462     __Pyx_GOTREF(__pyx_t_3);
20463     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20464     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20465     __PYX_ERR(3, 272, __pyx_L1_error)
20466 
20467     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
20468  *             ndim = PyArray_NDIM(self)
20469  *
20470  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
20471  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
20472  *                 raise ValueError(u"ndarray is not C contiguous")
20473  */
20474   }
20475 
20476   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
20477  *                 raise ValueError(u"ndarray is not C contiguous")
20478  *
20479  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
20480  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
20481  *                 raise ValueError(u"ndarray is not Fortran contiguous")
20482  */
20483   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
20484   if (__pyx_t_2) {
20485   } else {
20486     __pyx_t_1 = __pyx_t_2;
20487     goto __pyx_L7_bool_binop_done;
20488   }
20489 
20490   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
20491  *
20492  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
20493  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
20494  *                 raise ValueError(u"ndarray is not Fortran contiguous")
20495  *
20496  */
20497   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
20498   __pyx_t_1 = __pyx_t_2;
20499   __pyx_L7_bool_binop_done:;
20500 
20501   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
20502  *                 raise ValueError(u"ndarray is not C contiguous")
20503  *
20504  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
20505  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
20506  *                 raise ValueError(u"ndarray is not Fortran contiguous")
20507  */
20508   if (unlikely(__pyx_t_1)) {
20509 
20510     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
20511  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
20512  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
20513  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
20514  *
20515  *             info.buf = PyArray_DATA(self)
20516  */
20517     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
20518     __Pyx_GOTREF(__pyx_t_3);
20519     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20520     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20521     __PYX_ERR(3, 276, __pyx_L1_error)
20522 
20523     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
20524  *                 raise ValueError(u"ndarray is not C contiguous")
20525  *
20526  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
20527  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
20528  *                 raise ValueError(u"ndarray is not Fortran contiguous")
20529  */
20530   }
20531 
20532   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
20533  *                 raise ValueError(u"ndarray is not Fortran contiguous")
20534  *
20535  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
20536  *             info.ndim = ndim
20537  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
20538  */
20539   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
20540 
20541   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
20542  *
20543  *             info.buf = PyArray_DATA(self)
20544  *             info.ndim = ndim             # <<<<<<<<<<<<<<
20545  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
20546  *                 # Allocate new buffer for strides and shape info.
20547  */
20548   __pyx_v_info->ndim = __pyx_v_ndim;
20549 
20550   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
20551  *             info.buf = PyArray_DATA(self)
20552  *             info.ndim = ndim
20553  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
20554  *                 # Allocate new buffer for strides and shape info.
20555  *                 # This is allocated as one block, strides first.
20556  */
20557   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
20558   if (__pyx_t_1) {
20559 
20560     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
20561  *                 # Allocate new buffer for strides and shape info.
20562  *                 # This is allocated as one block, strides first.
20563  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
20564  *                 info.shape = info.strides + ndim
20565  *                 for i in range(ndim):
20566  */
20567     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
20568 
20569     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
20570  *                 # This is allocated as one block, strides first.
20571  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
20572  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
20573  *                 for i in range(ndim):
20574  *                     info.strides[i] = PyArray_STRIDES(self)[i]
20575  */
20576     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
20577 
20578     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
20579  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
20580  *                 info.shape = info.strides + ndim
20581  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
20582  *                     info.strides[i] = PyArray_STRIDES(self)[i]
20583  *                     info.shape[i] = PyArray_DIMS(self)[i]
20584  */
20585     __pyx_t_4 = __pyx_v_ndim;
20586     __pyx_t_5 = __pyx_t_4;
20587     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20588       __pyx_v_i = __pyx_t_6;
20589 
20590       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
20591  *                 info.shape = info.strides + ndim
20592  *                 for i in range(ndim):
20593  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
20594  *                     info.shape[i] = PyArray_DIMS(self)[i]
20595  *             else:
20596  */
20597       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
20598 
20599       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
20600  *                 for i in range(ndim):
20601  *                     info.strides[i] = PyArray_STRIDES(self)[i]
20602  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
20603  *             else:
20604  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
20605  */
20606       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
20607     }
20608 
20609     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
20610  *             info.buf = PyArray_DATA(self)
20611  *             info.ndim = ndim
20612  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
20613  *                 # Allocate new buffer for strides and shape info.
20614  *                 # This is allocated as one block, strides first.
20615  */
20616     goto __pyx_L9;
20617   }
20618 
20619   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
20620  *                     info.shape[i] = PyArray_DIMS(self)[i]
20621  *             else:
20622  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
20623  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
20624  *             info.suboffsets = NULL
20625  */
20626   /*else*/ {
20627     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
20628 
20629     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
20630  *             else:
20631  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
20632  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
20633  *             info.suboffsets = NULL
20634  *             info.itemsize = PyArray_ITEMSIZE(self)
20635  */
20636     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
20637   }
20638   __pyx_L9:;
20639 
20640   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
20641  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
20642  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
20643  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
20644  *             info.itemsize = PyArray_ITEMSIZE(self)
20645  *             info.readonly = not PyArray_ISWRITEABLE(self)
20646  */
20647   __pyx_v_info->suboffsets = NULL;
20648 
20649   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
20650  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
20651  *             info.suboffsets = NULL
20652  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
20653  *             info.readonly = not PyArray_ISWRITEABLE(self)
20654  *
20655  */
20656   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
20657 
20658   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
20659  *             info.suboffsets = NULL
20660  *             info.itemsize = PyArray_ITEMSIZE(self)
20661  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
20662  *
20663  *             cdef int t
20664  */
20665   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
20666 
20667   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
20668  *
20669  *             cdef int t
20670  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
20671  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
20672  *             cdef int offset
20673  */
20674   __pyx_v_f = NULL;
20675 
20676   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
20677  *             cdef int t
20678  *             cdef char* f = NULL
20679  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
20680  *             cdef int offset
20681  *
20682  */
20683   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
20684   __pyx_t_3 = ((PyObject *)__pyx_t_7);
20685   __Pyx_INCREF(__pyx_t_3);
20686   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
20687   __pyx_t_3 = 0;
20688 
20689   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
20690  *             cdef int offset
20691  *
20692  *             info.obj = self             # <<<<<<<<<<<<<<
20693  *
20694  *             if not PyDataType_HASFIELDS(descr):
20695  */
20696   __Pyx_INCREF(((PyObject *)__pyx_v_self));
20697   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20698   __Pyx_GOTREF(__pyx_v_info->obj);
20699   __Pyx_DECREF(__pyx_v_info->obj);
20700   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
20701 
20702   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
20703  *             info.obj = self
20704  *
20705  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
20706  *                 t = descr.type_num
20707  *                 if ((descr.byteorder == c'>' and little_endian) or
20708  */
20709   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
20710   if (__pyx_t_1) {
20711 
20712     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
20713  *
20714  *             if not PyDataType_HASFIELDS(descr):
20715  *                 t = descr.type_num             # <<<<<<<<<<<<<<
20716  *                 if ((descr.byteorder == c'>' and little_endian) or
20717  *                     (descr.byteorder == c'<' and not little_endian)):
20718  */
20719     __pyx_t_4 = __pyx_v_descr->type_num;
20720     __pyx_v_t = __pyx_t_4;
20721 
20722     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
20723  *             if not PyDataType_HASFIELDS(descr):
20724  *                 t = descr.type_num
20725  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
20726  *                     (descr.byteorder == c'<' and not little_endian)):
20727  *                     raise ValueError(u"Non-native byte order not supported")
20728  */
20729     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
20730     if (!__pyx_t_2) {
20731       goto __pyx_L15_next_or;
20732     } else {
20733     }
20734     __pyx_t_2 = (__pyx_v_little_endian != 0);
20735     if (!__pyx_t_2) {
20736     } else {
20737       __pyx_t_1 = __pyx_t_2;
20738       goto __pyx_L14_bool_binop_done;
20739     }
20740     __pyx_L15_next_or:;
20741 
20742     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
20743  *                 t = descr.type_num
20744  *                 if ((descr.byteorder == c'>' and little_endian) or
20745  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
20746  *                     raise ValueError(u"Non-native byte order not supported")
20747  *                 if   t == NPY_BYTE:        f = "b"
20748  */
20749     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
20750     if (__pyx_t_2) {
20751     } else {
20752       __pyx_t_1 = __pyx_t_2;
20753       goto __pyx_L14_bool_binop_done;
20754     }
20755     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
20756     __pyx_t_1 = __pyx_t_2;
20757     __pyx_L14_bool_binop_done:;
20758 
20759     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
20760  *             if not PyDataType_HASFIELDS(descr):
20761  *                 t = descr.type_num
20762  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
20763  *                     (descr.byteorder == c'<' and not little_endian)):
20764  *                     raise ValueError(u"Non-native byte order not supported")
20765  */
20766     if (unlikely(__pyx_t_1)) {
20767 
20768       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
20769  *                 if ((descr.byteorder == c'>' and little_endian) or
20770  *                     (descr.byteorder == c'<' and not little_endian)):
20771  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
20772  *                 if   t == NPY_BYTE:        f = "b"
20773  *                 elif t == NPY_UBYTE:       f = "B"
20774  */
20775       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
20776       __Pyx_GOTREF(__pyx_t_3);
20777       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20778       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20779       __PYX_ERR(3, 306, __pyx_L1_error)
20780 
20781       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
20782  *             if not PyDataType_HASFIELDS(descr):
20783  *                 t = descr.type_num
20784  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
20785  *                     (descr.byteorder == c'<' and not little_endian)):
20786  *                     raise ValueError(u"Non-native byte order not supported")
20787  */
20788     }
20789 
20790     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
20791  *                     (descr.byteorder == c'<' and not little_endian)):
20792  *                     raise ValueError(u"Non-native byte order not supported")
20793  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
20794  *                 elif t == NPY_UBYTE:       f = "B"
20795  *                 elif t == NPY_SHORT:       f = "h"
20796  */
20797     switch (__pyx_v_t) {
20798       case NPY_BYTE:
20799       __pyx_v_f = ((char *)"b");
20800       break;
20801       case NPY_UBYTE:
20802 
20803       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
20804  *                     raise ValueError(u"Non-native byte order not supported")
20805  *                 if   t == NPY_BYTE:        f = "b"
20806  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
20807  *                 elif t == NPY_SHORT:       f = "h"
20808  *                 elif t == NPY_USHORT:      f = "H"
20809  */
20810       __pyx_v_f = ((char *)"B");
20811       break;
20812       case NPY_SHORT:
20813 
20814       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
20815  *                 if   t == NPY_BYTE:        f = "b"
20816  *                 elif t == NPY_UBYTE:       f = "B"
20817  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
20818  *                 elif t == NPY_USHORT:      f = "H"
20819  *                 elif t == NPY_INT:         f = "i"
20820  */
20821       __pyx_v_f = ((char *)"h");
20822       break;
20823       case NPY_USHORT:
20824 
20825       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
20826  *                 elif t == NPY_UBYTE:       f = "B"
20827  *                 elif t == NPY_SHORT:       f = "h"
20828  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
20829  *                 elif t == NPY_INT:         f = "i"
20830  *                 elif t == NPY_UINT:        f = "I"
20831  */
20832       __pyx_v_f = ((char *)"H");
20833       break;
20834       case NPY_INT:
20835 
20836       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
20837  *                 elif t == NPY_SHORT:       f = "h"
20838  *                 elif t == NPY_USHORT:      f = "H"
20839  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
20840  *                 elif t == NPY_UINT:        f = "I"
20841  *                 elif t == NPY_LONG:        f = "l"
20842  */
20843       __pyx_v_f = ((char *)"i");
20844       break;
20845       case NPY_UINT:
20846 
20847       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
20848  *                 elif t == NPY_USHORT:      f = "H"
20849  *                 elif t == NPY_INT:         f = "i"
20850  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
20851  *                 elif t == NPY_LONG:        f = "l"
20852  *                 elif t == NPY_ULONG:       f = "L"
20853  */
20854       __pyx_v_f = ((char *)"I");
20855       break;
20856       case NPY_LONG:
20857 
20858       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
20859  *                 elif t == NPY_INT:         f = "i"
20860  *                 elif t == NPY_UINT:        f = "I"
20861  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
20862  *                 elif t == NPY_ULONG:       f = "L"
20863  *                 elif t == NPY_LONGLONG:    f = "q"
20864  */
20865       __pyx_v_f = ((char *)"l");
20866       break;
20867       case NPY_ULONG:
20868 
20869       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
20870  *                 elif t == NPY_UINT:        f = "I"
20871  *                 elif t == NPY_LONG:        f = "l"
20872  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
20873  *                 elif t == NPY_LONGLONG:    f = "q"
20874  *                 elif t == NPY_ULONGLONG:   f = "Q"
20875  */
20876       __pyx_v_f = ((char *)"L");
20877       break;
20878       case NPY_LONGLONG:
20879 
20880       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
20881  *                 elif t == NPY_LONG:        f = "l"
20882  *                 elif t == NPY_ULONG:       f = "L"
20883  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
20884  *                 elif t == NPY_ULONGLONG:   f = "Q"
20885  *                 elif t == NPY_FLOAT:       f = "f"
20886  */
20887       __pyx_v_f = ((char *)"q");
20888       break;
20889       case NPY_ULONGLONG:
20890 
20891       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
20892  *                 elif t == NPY_ULONG:       f = "L"
20893  *                 elif t == NPY_LONGLONG:    f = "q"
20894  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
20895  *                 elif t == NPY_FLOAT:       f = "f"
20896  *                 elif t == NPY_DOUBLE:      f = "d"
20897  */
20898       __pyx_v_f = ((char *)"Q");
20899       break;
20900       case NPY_FLOAT:
20901 
20902       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
20903  *                 elif t == NPY_LONGLONG:    f = "q"
20904  *                 elif t == NPY_ULONGLONG:   f = "Q"
20905  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
20906  *                 elif t == NPY_DOUBLE:      f = "d"
20907  *                 elif t == NPY_LONGDOUBLE:  f = "g"
20908  */
20909       __pyx_v_f = ((char *)"f");
20910       break;
20911       case NPY_DOUBLE:
20912 
20913       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
20914  *                 elif t == NPY_ULONGLONG:   f = "Q"
20915  *                 elif t == NPY_FLOAT:       f = "f"
20916  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
20917  *                 elif t == NPY_LONGDOUBLE:  f = "g"
20918  *                 elif t == NPY_CFLOAT:      f = "Zf"
20919  */
20920       __pyx_v_f = ((char *)"d");
20921       break;
20922       case NPY_LONGDOUBLE:
20923 
20924       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
20925  *                 elif t == NPY_FLOAT:       f = "f"
20926  *                 elif t == NPY_DOUBLE:      f = "d"
20927  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
20928  *                 elif t == NPY_CFLOAT:      f = "Zf"
20929  *                 elif t == NPY_CDOUBLE:     f = "Zd"
20930  */
20931       __pyx_v_f = ((char *)"g");
20932       break;
20933       case NPY_CFLOAT:
20934 
20935       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
20936  *                 elif t == NPY_DOUBLE:      f = "d"
20937  *                 elif t == NPY_LONGDOUBLE:  f = "g"
20938  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
20939  *                 elif t == NPY_CDOUBLE:     f = "Zd"
20940  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
20941  */
20942       __pyx_v_f = ((char *)"Zf");
20943       break;
20944       case NPY_CDOUBLE:
20945 
20946       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
20947  *                 elif t == NPY_LONGDOUBLE:  f = "g"
20948  *                 elif t == NPY_CFLOAT:      f = "Zf"
20949  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
20950  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
20951  *                 elif t == NPY_OBJECT:      f = "O"
20952  */
20953       __pyx_v_f = ((char *)"Zd");
20954       break;
20955       case NPY_CLONGDOUBLE:
20956 
20957       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
20958  *                 elif t == NPY_CFLOAT:      f = "Zf"
20959  *                 elif t == NPY_CDOUBLE:     f = "Zd"
20960  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
20961  *                 elif t == NPY_OBJECT:      f = "O"
20962  *                 else:
20963  */
20964       __pyx_v_f = ((char *)"Zg");
20965       break;
20966       case NPY_OBJECT:
20967 
20968       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
20969  *                 elif t == NPY_CDOUBLE:     f = "Zd"
20970  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
20971  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
20972  *                 else:
20973  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
20974  */
20975       __pyx_v_f = ((char *)"O");
20976       break;
20977       default:
20978 
20979       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
20980  *                 elif t == NPY_OBJECT:      f = "O"
20981  *                 else:
20982  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
20983  *                 info.format = f
20984  *                 return
20985  */
20986       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
20987       __Pyx_GOTREF(__pyx_t_3);
20988       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
20989       __Pyx_GOTREF(__pyx_t_8);
20990       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20991       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
20992       __Pyx_GOTREF(__pyx_t_3);
20993       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20994       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20995       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20996       __PYX_ERR(3, 325, __pyx_L1_error)
20997       break;
20998     }
20999 
21000     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
21001  *                 else:
21002  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
21003  *                 info.format = f             # <<<<<<<<<<<<<<
21004  *                 return
21005  *             else:
21006  */
21007     __pyx_v_info->format = __pyx_v_f;
21008 
21009     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
21010  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
21011  *                 info.format = f
21012  *                 return             # <<<<<<<<<<<<<<
21013  *             else:
21014  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
21015  */
21016     __pyx_r = 0;
21017     goto __pyx_L0;
21018 
21019     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
21020  *             info.obj = self
21021  *
21022  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
21023  *                 t = descr.type_num
21024  *                 if ((descr.byteorder == c'>' and little_endian) or
21025  */
21026   }
21027 
21028   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
21029  *                 return
21030  *             else:
21031  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
21032  *                 info.format[0] = c'^' # Native data types, manual alignment
21033  *                 offset = 0
21034  */
21035   /*else*/ {
21036     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
21037 
21038     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
21039  *             else:
21040  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
21041  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
21042  *                 offset = 0
21043  *                 f = _util_dtypestring(descr, info.format + 1,
21044  */
21045     (__pyx_v_info->format[0]) = '^';
21046 
21047     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
21048  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
21049  *                 info.format[0] = c'^' # Native data types, manual alignment
21050  *                 offset = 0             # <<<<<<<<<<<<<<
21051  *                 f = _util_dtypestring(descr, info.format + 1,
21052  *                                       info.format + _buffer_format_string_len,
21053  */
21054     __pyx_v_offset = 0;
21055 
21056     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
21057  *                 info.format[0] = c'^' # Native data types, manual alignment
21058  *                 offset = 0
21059  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
21060  *                                       info.format + _buffer_format_string_len,
21061  *                                       &offset)
21062  */
21063     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
21064     __pyx_v_f = __pyx_t_9;
21065 
21066     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
21067  *                                       info.format + _buffer_format_string_len,
21068  *                                       &offset)
21069  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
21070  *
21071  *         def __releasebuffer__(ndarray self, Py_buffer* info):
21072  */
21073     (__pyx_v_f[0]) = '\x00';
21074   }
21075 
21076   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
21077  *         # experimental exception made for __getbuffer__ and __releasebuffer__
21078  *         # -- the details of this may change.
21079  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
21080  *             # This implementation of getbuffer is geared towards Cython
21081  *             # requirements, and does not yet fulfill the PEP.
21082  */
21083 
21084   /* function exit code */
21085   __pyx_r = 0;
21086   goto __pyx_L0;
21087   __pyx_L1_error:;
21088   __Pyx_XDECREF(__pyx_t_3);
21089   __Pyx_XDECREF(__pyx_t_8);
21090   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21091   __pyx_r = -1;
21092   if (__pyx_v_info->obj != NULL) {
21093     __Pyx_GOTREF(__pyx_v_info->obj);
21094     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21095   }
21096   goto __pyx_L2;
21097   __pyx_L0:;
21098   if (__pyx_v_info->obj == Py_None) {
21099     __Pyx_GOTREF(__pyx_v_info->obj);
21100     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21101   }
21102   __pyx_L2:;
21103   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
21104   __Pyx_RefNannyFinishContext();
21105   return __pyx_r;
21106 }
21107 
21108 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
21109  *                 f[0] = c'\0' # Terminate format string
21110  *
21111  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
21112  *             if PyArray_HASFIELDS(self):
21113  *                 PyObject_Free(info.format)
21114  */
21115 
21116 /* Python wrapper */
21117 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)21118 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
21119   __Pyx_RefNannyDeclarations
21120   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
21121   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
21122 
21123   /* function exit code */
21124   __Pyx_RefNannyFinishContext();
21125 }
21126 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)21127 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
21128   __Pyx_RefNannyDeclarations
21129   int __pyx_t_1;
21130   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
21131 
21132   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
21133  *
21134  *         def __releasebuffer__(ndarray self, Py_buffer* info):
21135  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
21136  *                 PyObject_Free(info.format)
21137  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
21138  */
21139   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
21140   if (__pyx_t_1) {
21141 
21142     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
21143  *         def __releasebuffer__(ndarray self, Py_buffer* info):
21144  *             if PyArray_HASFIELDS(self):
21145  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
21146  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
21147  *                 PyObject_Free(info.strides)
21148  */
21149     PyObject_Free(__pyx_v_info->format);
21150 
21151     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
21152  *
21153  *         def __releasebuffer__(ndarray self, Py_buffer* info):
21154  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
21155  *                 PyObject_Free(info.format)
21156  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
21157  */
21158   }
21159 
21160   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
21161  *             if PyArray_HASFIELDS(self):
21162  *                 PyObject_Free(info.format)
21163  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
21164  *                 PyObject_Free(info.strides)
21165  *                 # info.shape was stored after info.strides in the same block
21166  */
21167   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
21168   if (__pyx_t_1) {
21169 
21170     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
21171  *                 PyObject_Free(info.format)
21172  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
21173  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
21174  *                 # info.shape was stored after info.strides in the same block
21175  *
21176  */
21177     PyObject_Free(__pyx_v_info->strides);
21178 
21179     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
21180  *             if PyArray_HASFIELDS(self):
21181  *                 PyObject_Free(info.format)
21182  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
21183  *                 PyObject_Free(info.strides)
21184  *                 # info.shape was stored after info.strides in the same block
21185  */
21186   }
21187 
21188   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
21189  *                 f[0] = c'\0' # Terminate format string
21190  *
21191  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
21192  *             if PyArray_HASFIELDS(self):
21193  *                 PyObject_Free(info.format)
21194  */
21195 
21196   /* function exit code */
21197   __Pyx_RefNannyFinishContext();
21198 }
21199 
21200 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
21201  * ctypedef npy_cdouble     complex_t
21202  *
21203  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
21204  *     return PyArray_MultiIterNew(1, <void*>a)
21205  *
21206  */
21207 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)21208 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
21209   PyObject *__pyx_r = NULL;
21210   __Pyx_RefNannyDeclarations
21211   PyObject *__pyx_t_1 = NULL;
21212   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
21213 
21214   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
21215  *
21216  * cdef inline object PyArray_MultiIterNew1(a):
21217  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
21218  *
21219  * cdef inline object PyArray_MultiIterNew2(a, b):
21220  */
21221   __Pyx_XDECREF(__pyx_r);
21222   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
21223   __Pyx_GOTREF(__pyx_t_1);
21224   __pyx_r = __pyx_t_1;
21225   __pyx_t_1 = 0;
21226   goto __pyx_L0;
21227 
21228   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
21229  * ctypedef npy_cdouble     complex_t
21230  *
21231  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
21232  *     return PyArray_MultiIterNew(1, <void*>a)
21233  *
21234  */
21235 
21236   /* function exit code */
21237   __pyx_L1_error:;
21238   __Pyx_XDECREF(__pyx_t_1);
21239   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
21240   __pyx_r = 0;
21241   __pyx_L0:;
21242   __Pyx_XGIVEREF(__pyx_r);
21243   __Pyx_RefNannyFinishContext();
21244   return __pyx_r;
21245 }
21246 
21247 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
21248  *     return PyArray_MultiIterNew(1, <void*>a)
21249  *
21250  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
21251  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
21252  *
21253  */
21254 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)21255 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
21256   PyObject *__pyx_r = NULL;
21257   __Pyx_RefNannyDeclarations
21258   PyObject *__pyx_t_1 = NULL;
21259   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
21260 
21261   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
21262  *
21263  * cdef inline object PyArray_MultiIterNew2(a, b):
21264  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
21265  *
21266  * cdef inline object PyArray_MultiIterNew3(a, b, c):
21267  */
21268   __Pyx_XDECREF(__pyx_r);
21269   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
21270   __Pyx_GOTREF(__pyx_t_1);
21271   __pyx_r = __pyx_t_1;
21272   __pyx_t_1 = 0;
21273   goto __pyx_L0;
21274 
21275   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
21276  *     return PyArray_MultiIterNew(1, <void*>a)
21277  *
21278  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
21279  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
21280  *
21281  */
21282 
21283   /* function exit code */
21284   __pyx_L1_error:;
21285   __Pyx_XDECREF(__pyx_t_1);
21286   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
21287   __pyx_r = 0;
21288   __pyx_L0:;
21289   __Pyx_XGIVEREF(__pyx_r);
21290   __Pyx_RefNannyFinishContext();
21291   return __pyx_r;
21292 }
21293 
21294 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
21295  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
21296  *
21297  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
21298  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
21299  *
21300  */
21301 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)21302 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
21303   PyObject *__pyx_r = NULL;
21304   __Pyx_RefNannyDeclarations
21305   PyObject *__pyx_t_1 = NULL;
21306   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
21307 
21308   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
21309  *
21310  * cdef inline object PyArray_MultiIterNew3(a, b, c):
21311  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
21312  *
21313  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
21314  */
21315   __Pyx_XDECREF(__pyx_r);
21316   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
21317   __Pyx_GOTREF(__pyx_t_1);
21318   __pyx_r = __pyx_t_1;
21319   __pyx_t_1 = 0;
21320   goto __pyx_L0;
21321 
21322   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
21323  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
21324  *
21325  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
21326  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
21327  *
21328  */
21329 
21330   /* function exit code */
21331   __pyx_L1_error:;
21332   __Pyx_XDECREF(__pyx_t_1);
21333   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21334   __pyx_r = 0;
21335   __pyx_L0:;
21336   __Pyx_XGIVEREF(__pyx_r);
21337   __Pyx_RefNannyFinishContext();
21338   return __pyx_r;
21339 }
21340 
21341 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
21342  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
21343  *
21344  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
21345  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
21346  *
21347  */
21348 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)21349 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) {
21350   PyObject *__pyx_r = NULL;
21351   __Pyx_RefNannyDeclarations
21352   PyObject *__pyx_t_1 = NULL;
21353   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
21354 
21355   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
21356  *
21357  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
21358  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
21359  *
21360  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
21361  */
21362   __Pyx_XDECREF(__pyx_r);
21363   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
21364   __Pyx_GOTREF(__pyx_t_1);
21365   __pyx_r = __pyx_t_1;
21366   __pyx_t_1 = 0;
21367   goto __pyx_L0;
21368 
21369   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
21370  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
21371  *
21372  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
21373  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
21374  *
21375  */
21376 
21377   /* function exit code */
21378   __pyx_L1_error:;
21379   __Pyx_XDECREF(__pyx_t_1);
21380   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21381   __pyx_r = 0;
21382   __pyx_L0:;
21383   __Pyx_XGIVEREF(__pyx_r);
21384   __Pyx_RefNannyFinishContext();
21385   return __pyx_r;
21386 }
21387 
21388 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
21389  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
21390  *
21391  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
21392  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
21393  *
21394  */
21395 
__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)21396 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) {
21397   PyObject *__pyx_r = NULL;
21398   __Pyx_RefNannyDeclarations
21399   PyObject *__pyx_t_1 = NULL;
21400   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
21401 
21402   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
21403  *
21404  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
21405  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
21406  *
21407  * cdef inline tuple PyDataType_SHAPE(dtype d):
21408  */
21409   __Pyx_XDECREF(__pyx_r);
21410   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 834, __pyx_L1_error)
21411   __Pyx_GOTREF(__pyx_t_1);
21412   __pyx_r = __pyx_t_1;
21413   __pyx_t_1 = 0;
21414   goto __pyx_L0;
21415 
21416   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
21417  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
21418  *
21419  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
21420  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
21421  *
21422  */
21423 
21424   /* function exit code */
21425   __pyx_L1_error:;
21426   __Pyx_XDECREF(__pyx_t_1);
21427   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21428   __pyx_r = 0;
21429   __pyx_L0:;
21430   __Pyx_XGIVEREF(__pyx_r);
21431   __Pyx_RefNannyFinishContext();
21432   return __pyx_r;
21433 }
21434 
21435 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
21436  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
21437  *
21438  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
21439  *     if PyDataType_HASSUBARRAY(d):
21440  *         return <tuple>d.subarray.shape
21441  */
21442 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)21443 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
21444   PyObject *__pyx_r = NULL;
21445   __Pyx_RefNannyDeclarations
21446   int __pyx_t_1;
21447   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
21448 
21449   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
21450  *
21451  * cdef inline tuple PyDataType_SHAPE(dtype d):
21452  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
21453  *         return <tuple>d.subarray.shape
21454  *     else:
21455  */
21456   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
21457   if (__pyx_t_1) {
21458 
21459     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
21460  * cdef inline tuple PyDataType_SHAPE(dtype d):
21461  *     if PyDataType_HASSUBARRAY(d):
21462  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
21463  *     else:
21464  *         return ()
21465  */
21466     __Pyx_XDECREF(__pyx_r);
21467     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
21468     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
21469     goto __pyx_L0;
21470 
21471     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
21472  *
21473  * cdef inline tuple PyDataType_SHAPE(dtype d):
21474  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
21475  *         return <tuple>d.subarray.shape
21476  *     else:
21477  */
21478   }
21479 
21480   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
21481  *         return <tuple>d.subarray.shape
21482  *     else:
21483  *         return ()             # <<<<<<<<<<<<<<
21484  *
21485  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
21486  */
21487   /*else*/ {
21488     __Pyx_XDECREF(__pyx_r);
21489     __Pyx_INCREF(__pyx_empty_tuple);
21490     __pyx_r = __pyx_empty_tuple;
21491     goto __pyx_L0;
21492   }
21493 
21494   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
21495  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
21496  *
21497  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
21498  *     if PyDataType_HASSUBARRAY(d):
21499  *         return <tuple>d.subarray.shape
21500  */
21501 
21502   /* function exit code */
21503   __pyx_L0:;
21504   __Pyx_XGIVEREF(__pyx_r);
21505   __Pyx_RefNannyFinishContext();
21506   return __pyx_r;
21507 }
21508 
21509 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
21510  *         return ()
21511  *
21512  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
21513  *     # Recursive utility function used in __getbuffer__ to get format
21514  *     # string. The new location in the format string is returned.
21515  */
21516 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)21517 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) {
21518   PyArray_Descr *__pyx_v_child = 0;
21519   int __pyx_v_endian_detector;
21520   int __pyx_v_little_endian;
21521   PyObject *__pyx_v_fields = 0;
21522   PyObject *__pyx_v_childname = NULL;
21523   PyObject *__pyx_v_new_offset = NULL;
21524   PyObject *__pyx_v_t = NULL;
21525   char *__pyx_r;
21526   __Pyx_RefNannyDeclarations
21527   PyObject *__pyx_t_1 = NULL;
21528   Py_ssize_t __pyx_t_2;
21529   PyObject *__pyx_t_3 = NULL;
21530   PyObject *__pyx_t_4 = NULL;
21531   int __pyx_t_5;
21532   int __pyx_t_6;
21533   int __pyx_t_7;
21534   long __pyx_t_8;
21535   char *__pyx_t_9;
21536   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
21537 
21538   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
21539  *
21540  *     cdef dtype child
21541  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
21542  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
21543  *     cdef tuple fields
21544  */
21545   __pyx_v_endian_detector = 1;
21546 
21547   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
21548  *     cdef dtype child
21549  *     cdef int endian_detector = 1
21550  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
21551  *     cdef tuple fields
21552  *
21553  */
21554   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
21555 
21556   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
21557  *     cdef tuple fields
21558  *
21559  *     for childname in descr.names:             # <<<<<<<<<<<<<<
21560  *         fields = descr.fields[childname]
21561  *         child, new_offset = fields
21562  */
21563   if (unlikely(__pyx_v_descr->names == Py_None)) {
21564     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21565     __PYX_ERR(3, 851, __pyx_L1_error)
21566   }
21567   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
21568   for (;;) {
21569     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
21570     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21571     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
21572     #else
21573     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
21574     __Pyx_GOTREF(__pyx_t_3);
21575     #endif
21576     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
21577     __pyx_t_3 = 0;
21578 
21579     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
21580  *
21581  *     for childname in descr.names:
21582  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
21583  *         child, new_offset = fields
21584  *
21585  */
21586     if (unlikely(__pyx_v_descr->fields == Py_None)) {
21587       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21588       __PYX_ERR(3, 852, __pyx_L1_error)
21589     }
21590     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
21591     __Pyx_GOTREF(__pyx_t_3);
21592     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
21593     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
21594     __pyx_t_3 = 0;
21595 
21596     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
21597  *     for childname in descr.names:
21598  *         fields = descr.fields[childname]
21599  *         child, new_offset = fields             # <<<<<<<<<<<<<<
21600  *
21601  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
21602  */
21603     if (likely(__pyx_v_fields != Py_None)) {
21604       PyObject* sequence = __pyx_v_fields;
21605       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21606       if (unlikely(size != 2)) {
21607         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21608         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21609         __PYX_ERR(3, 853, __pyx_L1_error)
21610       }
21611       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21612       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
21613       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
21614       __Pyx_INCREF(__pyx_t_3);
21615       __Pyx_INCREF(__pyx_t_4);
21616       #else
21617       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
21618       __Pyx_GOTREF(__pyx_t_3);
21619       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
21620       __Pyx_GOTREF(__pyx_t_4);
21621       #endif
21622     } else {
21623       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
21624     }
21625     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
21626     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
21627     __pyx_t_3 = 0;
21628     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
21629     __pyx_t_4 = 0;
21630 
21631     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
21632  *         child, new_offset = fields
21633  *
21634  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
21635  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
21636  *
21637  */
21638     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
21639     __Pyx_GOTREF(__pyx_t_4);
21640     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
21641     __Pyx_GOTREF(__pyx_t_3);
21642     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21643     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
21644     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21645     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
21646     if (unlikely(__pyx_t_6)) {
21647 
21648       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
21649  *
21650  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
21651  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
21652  *
21653  *         if ((child.byteorder == c'>' and little_endian) or
21654  */
21655       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
21656       __Pyx_GOTREF(__pyx_t_3);
21657       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21658       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21659       __PYX_ERR(3, 856, __pyx_L1_error)
21660 
21661       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
21662  *         child, new_offset = fields
21663  *
21664  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
21665  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
21666  *
21667  */
21668     }
21669 
21670     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
21671  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
21672  *
21673  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
21674  *             (child.byteorder == c'<' and not little_endian)):
21675  *             raise ValueError(u"Non-native byte order not supported")
21676  */
21677     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
21678     if (!__pyx_t_7) {
21679       goto __pyx_L8_next_or;
21680     } else {
21681     }
21682     __pyx_t_7 = (__pyx_v_little_endian != 0);
21683     if (!__pyx_t_7) {
21684     } else {
21685       __pyx_t_6 = __pyx_t_7;
21686       goto __pyx_L7_bool_binop_done;
21687     }
21688     __pyx_L8_next_or:;
21689 
21690     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
21691  *
21692  *         if ((child.byteorder == c'>' and little_endian) or
21693  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
21694  *             raise ValueError(u"Non-native byte order not supported")
21695  *             # One could encode it in the format string and have Cython
21696  */
21697     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
21698     if (__pyx_t_7) {
21699     } else {
21700       __pyx_t_6 = __pyx_t_7;
21701       goto __pyx_L7_bool_binop_done;
21702     }
21703     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
21704     __pyx_t_6 = __pyx_t_7;
21705     __pyx_L7_bool_binop_done:;
21706 
21707     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
21708  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
21709  *
21710  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
21711  *             (child.byteorder == c'<' and not little_endian)):
21712  *             raise ValueError(u"Non-native byte order not supported")
21713  */
21714     if (unlikely(__pyx_t_6)) {
21715 
21716       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
21717  *         if ((child.byteorder == c'>' and little_endian) or
21718  *             (child.byteorder == c'<' and not little_endian)):
21719  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
21720  *             # One could encode it in the format string and have Cython
21721  *             # complain instead, BUT: < and > in format strings also imply
21722  */
21723       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
21724       __Pyx_GOTREF(__pyx_t_3);
21725       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21726       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21727       __PYX_ERR(3, 860, __pyx_L1_error)
21728 
21729       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
21730  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
21731  *
21732  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
21733  *             (child.byteorder == c'<' and not little_endian)):
21734  *             raise ValueError(u"Non-native byte order not supported")
21735  */
21736     }
21737 
21738     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
21739  *
21740  *         # Output padding bytes
21741  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
21742  *             f[0] = 120 # "x"; pad byte
21743  *             f += 1
21744  */
21745     while (1) {
21746       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
21747       __Pyx_GOTREF(__pyx_t_3);
21748       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
21749       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21750       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
21751       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21752       if (!__pyx_t_6) break;
21753 
21754       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
21755  *         # Output padding bytes
21756  *         while offset[0] < new_offset:
21757  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
21758  *             f += 1
21759  *             offset[0] += 1
21760  */
21761       (__pyx_v_f[0]) = 0x78;
21762 
21763       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
21764  *         while offset[0] < new_offset:
21765  *             f[0] = 120 # "x"; pad byte
21766  *             f += 1             # <<<<<<<<<<<<<<
21767  *             offset[0] += 1
21768  *
21769  */
21770       __pyx_v_f = (__pyx_v_f + 1);
21771 
21772       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
21773  *             f[0] = 120 # "x"; pad byte
21774  *             f += 1
21775  *             offset[0] += 1             # <<<<<<<<<<<<<<
21776  *
21777  *         offset[0] += child.itemsize
21778  */
21779       __pyx_t_8 = 0;
21780       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
21781     }
21782 
21783     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
21784  *             offset[0] += 1
21785  *
21786  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
21787  *
21788  *         if not PyDataType_HASFIELDS(child):
21789  */
21790     __pyx_t_8 = 0;
21791     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
21792 
21793     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
21794  *         offset[0] += child.itemsize
21795  *
21796  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
21797  *             t = child.type_num
21798  *             if end - f < 5:
21799  */
21800     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
21801     if (__pyx_t_6) {
21802 
21803       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
21804  *
21805  *         if not PyDataType_HASFIELDS(child):
21806  *             t = child.type_num             # <<<<<<<<<<<<<<
21807  *             if end - f < 5:
21808  *                 raise RuntimeError(u"Format string allocated too short.")
21809  */
21810       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
21811       __Pyx_GOTREF(__pyx_t_4);
21812       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
21813       __pyx_t_4 = 0;
21814 
21815       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
21816  *         if not PyDataType_HASFIELDS(child):
21817  *             t = child.type_num
21818  *             if end - f < 5:             # <<<<<<<<<<<<<<
21819  *                 raise RuntimeError(u"Format string allocated too short.")
21820  *
21821  */
21822       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
21823       if (unlikely(__pyx_t_6)) {
21824 
21825         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
21826  *             t = child.type_num
21827  *             if end - f < 5:
21828  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
21829  *
21830  *             # Until ticket #99 is fixed, use integers to avoid warnings
21831  */
21832         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
21833         __Pyx_GOTREF(__pyx_t_4);
21834         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21835         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21836         __PYX_ERR(3, 880, __pyx_L1_error)
21837 
21838         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
21839  *         if not PyDataType_HASFIELDS(child):
21840  *             t = child.type_num
21841  *             if end - f < 5:             # <<<<<<<<<<<<<<
21842  *                 raise RuntimeError(u"Format string allocated too short.")
21843  *
21844  */
21845       }
21846 
21847       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
21848  *
21849  *             # Until ticket #99 is fixed, use integers to avoid warnings
21850  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
21851  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
21852  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
21853  */
21854       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
21855       __Pyx_GOTREF(__pyx_t_4);
21856       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
21857       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21858       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
21859       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21860       if (__pyx_t_6) {
21861         (__pyx_v_f[0]) = 98;
21862         goto __pyx_L15;
21863       }
21864 
21865       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
21866  *             # Until ticket #99 is fixed, use integers to avoid warnings
21867  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
21868  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
21869  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
21870  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
21871  */
21872       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
21873       __Pyx_GOTREF(__pyx_t_3);
21874       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
21875       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21876       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
21877       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21878       if (__pyx_t_6) {
21879         (__pyx_v_f[0]) = 66;
21880         goto __pyx_L15;
21881       }
21882 
21883       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
21884  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
21885  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
21886  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
21887  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
21888  *             elif t == NPY_INT:         f[0] = 105 #"i"
21889  */
21890       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
21891       __Pyx_GOTREF(__pyx_t_4);
21892       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
21893       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21894       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
21895       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21896       if (__pyx_t_6) {
21897         (__pyx_v_f[0]) = 0x68;
21898         goto __pyx_L15;
21899       }
21900 
21901       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
21902  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
21903  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
21904  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
21905  *             elif t == NPY_INT:         f[0] = 105 #"i"
21906  *             elif t == NPY_UINT:        f[0] =  73 #"I"
21907  */
21908       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
21909       __Pyx_GOTREF(__pyx_t_3);
21910       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
21911       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21912       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
21913       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21914       if (__pyx_t_6) {
21915         (__pyx_v_f[0]) = 72;
21916         goto __pyx_L15;
21917       }
21918 
21919       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
21920  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
21921  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
21922  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
21923  *             elif t == NPY_UINT:        f[0] =  73 #"I"
21924  *             elif t == NPY_LONG:        f[0] = 108 #"l"
21925  */
21926       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
21927       __Pyx_GOTREF(__pyx_t_4);
21928       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
21929       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21930       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
21931       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21932       if (__pyx_t_6) {
21933         (__pyx_v_f[0]) = 0x69;
21934         goto __pyx_L15;
21935       }
21936 
21937       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
21938  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
21939  *             elif t == NPY_INT:         f[0] = 105 #"i"
21940  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
21941  *             elif t == NPY_LONG:        f[0] = 108 #"l"
21942  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
21943  */
21944       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
21945       __Pyx_GOTREF(__pyx_t_3);
21946       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
21947       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21948       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
21949       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21950       if (__pyx_t_6) {
21951         (__pyx_v_f[0]) = 73;
21952         goto __pyx_L15;
21953       }
21954 
21955       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
21956  *             elif t == NPY_INT:         f[0] = 105 #"i"
21957  *             elif t == NPY_UINT:        f[0] =  73 #"I"
21958  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
21959  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
21960  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
21961  */
21962       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
21963       __Pyx_GOTREF(__pyx_t_4);
21964       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
21965       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21966       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
21967       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21968       if (__pyx_t_6) {
21969         (__pyx_v_f[0]) = 0x6C;
21970         goto __pyx_L15;
21971       }
21972 
21973       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
21974  *             elif t == NPY_UINT:        f[0] =  73 #"I"
21975  *             elif t == NPY_LONG:        f[0] = 108 #"l"
21976  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
21977  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
21978  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
21979  */
21980       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
21981       __Pyx_GOTREF(__pyx_t_3);
21982       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
21983       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21984       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
21985       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21986       if (__pyx_t_6) {
21987         (__pyx_v_f[0]) = 76;
21988         goto __pyx_L15;
21989       }
21990 
21991       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
21992  *             elif t == NPY_LONG:        f[0] = 108 #"l"
21993  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
21994  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
21995  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
21996  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
21997  */
21998       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
21999       __Pyx_GOTREF(__pyx_t_4);
22000       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
22001       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22002       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
22003       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22004       if (__pyx_t_6) {
22005         (__pyx_v_f[0]) = 0x71;
22006         goto __pyx_L15;
22007       }
22008 
22009       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
22010  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
22011  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
22012  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
22013  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
22014  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
22015  */
22016       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
22017       __Pyx_GOTREF(__pyx_t_3);
22018       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
22019       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22020       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
22021       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22022       if (__pyx_t_6) {
22023         (__pyx_v_f[0]) = 81;
22024         goto __pyx_L15;
22025       }
22026 
22027       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
22028  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
22029  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
22030  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
22031  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
22032  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
22033  */
22034       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
22035       __Pyx_GOTREF(__pyx_t_4);
22036       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
22037       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22038       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
22039       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22040       if (__pyx_t_6) {
22041         (__pyx_v_f[0]) = 0x66;
22042         goto __pyx_L15;
22043       }
22044 
22045       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
22046  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
22047  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
22048  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
22049  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
22050  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
22051  */
22052       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
22053       __Pyx_GOTREF(__pyx_t_3);
22054       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
22055       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22056       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
22057       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22058       if (__pyx_t_6) {
22059         (__pyx_v_f[0]) = 0x64;
22060         goto __pyx_L15;
22061       }
22062 
22063       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
22064  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
22065  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
22066  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
22067  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
22068  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
22069  */
22070       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
22071       __Pyx_GOTREF(__pyx_t_4);
22072       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
22073       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22074       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
22075       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22076       if (__pyx_t_6) {
22077         (__pyx_v_f[0]) = 0x67;
22078         goto __pyx_L15;
22079       }
22080 
22081       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
22082  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
22083  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
22084  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
22085  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
22086  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
22087  */
22088       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
22089       __Pyx_GOTREF(__pyx_t_3);
22090       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
22091       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22092       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
22093       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22094       if (__pyx_t_6) {
22095         (__pyx_v_f[0]) = 90;
22096         (__pyx_v_f[1]) = 0x66;
22097         __pyx_v_f = (__pyx_v_f + 1);
22098         goto __pyx_L15;
22099       }
22100 
22101       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
22102  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
22103  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
22104  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
22105  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
22106  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
22107  */
22108       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
22109       __Pyx_GOTREF(__pyx_t_4);
22110       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
22111       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22112       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
22113       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22114       if (__pyx_t_6) {
22115         (__pyx_v_f[0]) = 90;
22116         (__pyx_v_f[1]) = 0x64;
22117         __pyx_v_f = (__pyx_v_f + 1);
22118         goto __pyx_L15;
22119       }
22120 
22121       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
22122  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
22123  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
22124  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
22125  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
22126  *             else:
22127  */
22128       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
22129       __Pyx_GOTREF(__pyx_t_3);
22130       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
22131       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22132       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
22133       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22134       if (__pyx_t_6) {
22135         (__pyx_v_f[0]) = 90;
22136         (__pyx_v_f[1]) = 0x67;
22137         __pyx_v_f = (__pyx_v_f + 1);
22138         goto __pyx_L15;
22139       }
22140 
22141       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
22142  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
22143  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
22144  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
22145  *             else:
22146  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
22147  */
22148       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
22149       __Pyx_GOTREF(__pyx_t_4);
22150       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
22151       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22152       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
22153       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22154       if (likely(__pyx_t_6)) {
22155         (__pyx_v_f[0]) = 79;
22156         goto __pyx_L15;
22157       }
22158 
22159       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
22160  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
22161  *             else:
22162  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
22163  *             f += 1
22164  *         else:
22165  */
22166       /*else*/ {
22167         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
22168         __Pyx_GOTREF(__pyx_t_3);
22169         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
22170         __Pyx_GOTREF(__pyx_t_4);
22171         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22172         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22173         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22174         __PYX_ERR(3, 901, __pyx_L1_error)
22175       }
22176       __pyx_L15:;
22177 
22178       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
22179  *             else:
22180  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
22181  *             f += 1             # <<<<<<<<<<<<<<
22182  *         else:
22183  *             # Cython ignores struct boundary information ("T{...}"),
22184  */
22185       __pyx_v_f = (__pyx_v_f + 1);
22186 
22187       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
22188  *         offset[0] += child.itemsize
22189  *
22190  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
22191  *             t = child.type_num
22192  *             if end - f < 5:
22193  */
22194       goto __pyx_L13;
22195     }
22196 
22197     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
22198  *             # Cython ignores struct boundary information ("T{...}"),
22199  *             # so don't output it
22200  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
22201  *     return f
22202  *
22203  */
22204     /*else*/ {
22205       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
22206       __pyx_v_f = __pyx_t_9;
22207     }
22208     __pyx_L13:;
22209 
22210     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
22211  *     cdef tuple fields
22212  *
22213  *     for childname in descr.names:             # <<<<<<<<<<<<<<
22214  *         fields = descr.fields[childname]
22215  *         child, new_offset = fields
22216  */
22217   }
22218   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22219 
22220   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
22221  *             # so don't output it
22222  *             f = _util_dtypestring(child, f, end, offset)
22223  *     return f             # <<<<<<<<<<<<<<
22224  *
22225  *
22226  */
22227   __pyx_r = __pyx_v_f;
22228   goto __pyx_L0;
22229 
22230   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
22231  *         return ()
22232  *
22233  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
22234  *     # Recursive utility function used in __getbuffer__ to get format
22235  *     # string. The new location in the format string is returned.
22236  */
22237 
22238   /* function exit code */
22239   __pyx_L1_error:;
22240   __Pyx_XDECREF(__pyx_t_1);
22241   __Pyx_XDECREF(__pyx_t_3);
22242   __Pyx_XDECREF(__pyx_t_4);
22243   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
22244   __pyx_r = NULL;
22245   __pyx_L0:;
22246   __Pyx_XDECREF((PyObject *)__pyx_v_child);
22247   __Pyx_XDECREF(__pyx_v_fields);
22248   __Pyx_XDECREF(__pyx_v_childname);
22249   __Pyx_XDECREF(__pyx_v_new_offset);
22250   __Pyx_XDECREF(__pyx_v_t);
22251   __Pyx_RefNannyFinishContext();
22252   return __pyx_r;
22253 }
22254 
22255 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
22256  *     int _import_umath() except -1
22257  *
22258  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
22259  *     Py_INCREF(base) # important to do this before stealing the reference below!
22260  *     PyArray_SetBaseObject(arr, base)
22261  */
22262 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)22263 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
22264   __Pyx_RefNannyDeclarations
22265   __Pyx_RefNannySetupContext("set_array_base", 0);
22266 
22267   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
22268  *
22269  * cdef inline void set_array_base(ndarray arr, object base):
22270  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
22271  *     PyArray_SetBaseObject(arr, base)
22272  *
22273  */
22274   Py_INCREF(__pyx_v_base);
22275 
22276   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
22277  * cdef inline void set_array_base(ndarray arr, object base):
22278  *     Py_INCREF(base) # important to do this before stealing the reference below!
22279  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
22280  *
22281  * cdef inline object get_array_base(ndarray arr):
22282  */
22283   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
22284 
22285   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
22286  *     int _import_umath() except -1
22287  *
22288  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
22289  *     Py_INCREF(base) # important to do this before stealing the reference below!
22290  *     PyArray_SetBaseObject(arr, base)
22291  */
22292 
22293   /* function exit code */
22294   __Pyx_RefNannyFinishContext();
22295 }
22296 
22297 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
22298  *     PyArray_SetBaseObject(arr, base)
22299  *
22300  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
22301  *     base = PyArray_BASE(arr)
22302  *     if base is NULL:
22303  */
22304 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)22305 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
22306   PyObject *__pyx_v_base;
22307   PyObject *__pyx_r = NULL;
22308   __Pyx_RefNannyDeclarations
22309   int __pyx_t_1;
22310   __Pyx_RefNannySetupContext("get_array_base", 0);
22311 
22312   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
22313  *
22314  * cdef inline object get_array_base(ndarray arr):
22315  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
22316  *     if base is NULL:
22317  *         return None
22318  */
22319   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
22320 
22321   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
22322  * cdef inline object get_array_base(ndarray arr):
22323  *     base = PyArray_BASE(arr)
22324  *     if base is NULL:             # <<<<<<<<<<<<<<
22325  *         return None
22326  *     return <object>base
22327  */
22328   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
22329   if (__pyx_t_1) {
22330 
22331     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
22332  *     base = PyArray_BASE(arr)
22333  *     if base is NULL:
22334  *         return None             # <<<<<<<<<<<<<<
22335  *     return <object>base
22336  *
22337  */
22338     __Pyx_XDECREF(__pyx_r);
22339     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22340     goto __pyx_L0;
22341 
22342     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
22343  * cdef inline object get_array_base(ndarray arr):
22344  *     base = PyArray_BASE(arr)
22345  *     if base is NULL:             # <<<<<<<<<<<<<<
22346  *         return None
22347  *     return <object>base
22348  */
22349   }
22350 
22351   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
22352  *     if base is NULL:
22353  *         return None
22354  *     return <object>base             # <<<<<<<<<<<<<<
22355  *
22356  * # Versions of the import_* functions which are more suitable for
22357  */
22358   __Pyx_XDECREF(__pyx_r);
22359   __Pyx_INCREF(((PyObject *)__pyx_v_base));
22360   __pyx_r = ((PyObject *)__pyx_v_base);
22361   goto __pyx_L0;
22362 
22363   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
22364  *     PyArray_SetBaseObject(arr, base)
22365  *
22366  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
22367  *     base = PyArray_BASE(arr)
22368  *     if base is NULL:
22369  */
22370 
22371   /* function exit code */
22372   __pyx_L0:;
22373   __Pyx_XGIVEREF(__pyx_r);
22374   __Pyx_RefNannyFinishContext();
22375   return __pyx_r;
22376 }
22377 
22378 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
22379  * # Versions of the import_* functions which are more suitable for
22380  * # Cython code.
22381  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
22382  *     try:
22383  *         _import_array()
22384  */
22385 
__pyx_f_5numpy_import_array(void)22386 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
22387   int __pyx_r;
22388   __Pyx_RefNannyDeclarations
22389   PyObject *__pyx_t_1 = NULL;
22390   PyObject *__pyx_t_2 = NULL;
22391   PyObject *__pyx_t_3 = NULL;
22392   int __pyx_t_4;
22393   PyObject *__pyx_t_5 = NULL;
22394   PyObject *__pyx_t_6 = NULL;
22395   PyObject *__pyx_t_7 = NULL;
22396   PyObject *__pyx_t_8 = NULL;
22397   __Pyx_RefNannySetupContext("import_array", 0);
22398 
22399   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
22400  * # Cython code.
22401  * cdef inline int import_array() except -1:
22402  *     try:             # <<<<<<<<<<<<<<
22403  *         _import_array()
22404  *     except Exception:
22405  */
22406   {
22407     __Pyx_PyThreadState_declare
22408     __Pyx_PyThreadState_assign
22409     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22410     __Pyx_XGOTREF(__pyx_t_1);
22411     __Pyx_XGOTREF(__pyx_t_2);
22412     __Pyx_XGOTREF(__pyx_t_3);
22413     /*try:*/ {
22414 
22415       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
22416  * cdef inline int import_array() except -1:
22417  *     try:
22418  *         _import_array()             # <<<<<<<<<<<<<<
22419  *     except Exception:
22420  *         raise ImportError("numpy.core.multiarray failed to import")
22421  */
22422       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
22423 
22424       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
22425  * # Cython code.
22426  * cdef inline int import_array() except -1:
22427  *     try:             # <<<<<<<<<<<<<<
22428  *         _import_array()
22429  *     except Exception:
22430  */
22431     }
22432     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22433     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22434     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22435     goto __pyx_L8_try_end;
22436     __pyx_L3_error:;
22437 
22438     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
22439  *     try:
22440  *         _import_array()
22441  *     except Exception:             # <<<<<<<<<<<<<<
22442  *         raise ImportError("numpy.core.multiarray failed to import")
22443  *
22444  */
22445     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22446     if (__pyx_t_4) {
22447       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22448       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
22449       __Pyx_GOTREF(__pyx_t_5);
22450       __Pyx_GOTREF(__pyx_t_6);
22451       __Pyx_GOTREF(__pyx_t_7);
22452 
22453       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
22454  *         _import_array()
22455  *     except Exception:
22456  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
22457  *
22458  * cdef inline int import_umath() except -1:
22459  */
22460       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
22461       __Pyx_GOTREF(__pyx_t_8);
22462       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22463       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22464       __PYX_ERR(3, 1038, __pyx_L5_except_error)
22465     }
22466     goto __pyx_L5_except_error;
22467     __pyx_L5_except_error:;
22468 
22469     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
22470  * # Cython code.
22471  * cdef inline int import_array() except -1:
22472  *     try:             # <<<<<<<<<<<<<<
22473  *         _import_array()
22474  *     except Exception:
22475  */
22476     __Pyx_XGIVEREF(__pyx_t_1);
22477     __Pyx_XGIVEREF(__pyx_t_2);
22478     __Pyx_XGIVEREF(__pyx_t_3);
22479     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22480     goto __pyx_L1_error;
22481     __pyx_L8_try_end:;
22482   }
22483 
22484   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
22485  * # Versions of the import_* functions which are more suitable for
22486  * # Cython code.
22487  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
22488  *     try:
22489  *         _import_array()
22490  */
22491 
22492   /* function exit code */
22493   __pyx_r = 0;
22494   goto __pyx_L0;
22495   __pyx_L1_error:;
22496   __Pyx_XDECREF(__pyx_t_5);
22497   __Pyx_XDECREF(__pyx_t_6);
22498   __Pyx_XDECREF(__pyx_t_7);
22499   __Pyx_XDECREF(__pyx_t_8);
22500   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22501   __pyx_r = -1;
22502   __pyx_L0:;
22503   __Pyx_RefNannyFinishContext();
22504   return __pyx_r;
22505 }
22506 
22507 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
22508  *         raise ImportError("numpy.core.multiarray failed to import")
22509  *
22510  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
22511  *     try:
22512  *         _import_umath()
22513  */
22514 
__pyx_f_5numpy_import_umath(void)22515 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
22516   int __pyx_r;
22517   __Pyx_RefNannyDeclarations
22518   PyObject *__pyx_t_1 = NULL;
22519   PyObject *__pyx_t_2 = NULL;
22520   PyObject *__pyx_t_3 = NULL;
22521   int __pyx_t_4;
22522   PyObject *__pyx_t_5 = NULL;
22523   PyObject *__pyx_t_6 = NULL;
22524   PyObject *__pyx_t_7 = NULL;
22525   PyObject *__pyx_t_8 = NULL;
22526   __Pyx_RefNannySetupContext("import_umath", 0);
22527 
22528   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
22529  *
22530  * cdef inline int import_umath() except -1:
22531  *     try:             # <<<<<<<<<<<<<<
22532  *         _import_umath()
22533  *     except Exception:
22534  */
22535   {
22536     __Pyx_PyThreadState_declare
22537     __Pyx_PyThreadState_assign
22538     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22539     __Pyx_XGOTREF(__pyx_t_1);
22540     __Pyx_XGOTREF(__pyx_t_2);
22541     __Pyx_XGOTREF(__pyx_t_3);
22542     /*try:*/ {
22543 
22544       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
22545  * cdef inline int import_umath() except -1:
22546  *     try:
22547  *         _import_umath()             # <<<<<<<<<<<<<<
22548  *     except Exception:
22549  *         raise ImportError("numpy.core.umath failed to import")
22550  */
22551       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
22552 
22553       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
22554  *
22555  * cdef inline int import_umath() except -1:
22556  *     try:             # <<<<<<<<<<<<<<
22557  *         _import_umath()
22558  *     except Exception:
22559  */
22560     }
22561     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22562     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22563     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22564     goto __pyx_L8_try_end;
22565     __pyx_L3_error:;
22566 
22567     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
22568  *     try:
22569  *         _import_umath()
22570  *     except Exception:             # <<<<<<<<<<<<<<
22571  *         raise ImportError("numpy.core.umath failed to import")
22572  *
22573  */
22574     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22575     if (__pyx_t_4) {
22576       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22577       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
22578       __Pyx_GOTREF(__pyx_t_5);
22579       __Pyx_GOTREF(__pyx_t_6);
22580       __Pyx_GOTREF(__pyx_t_7);
22581 
22582       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
22583  *         _import_umath()
22584  *     except Exception:
22585  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
22586  *
22587  * cdef inline int import_ufunc() except -1:
22588  */
22589       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
22590       __Pyx_GOTREF(__pyx_t_8);
22591       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22592       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22593       __PYX_ERR(3, 1044, __pyx_L5_except_error)
22594     }
22595     goto __pyx_L5_except_error;
22596     __pyx_L5_except_error:;
22597 
22598     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
22599  *
22600  * cdef inline int import_umath() except -1:
22601  *     try:             # <<<<<<<<<<<<<<
22602  *         _import_umath()
22603  *     except Exception:
22604  */
22605     __Pyx_XGIVEREF(__pyx_t_1);
22606     __Pyx_XGIVEREF(__pyx_t_2);
22607     __Pyx_XGIVEREF(__pyx_t_3);
22608     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22609     goto __pyx_L1_error;
22610     __pyx_L8_try_end:;
22611   }
22612 
22613   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
22614  *         raise ImportError("numpy.core.multiarray failed to import")
22615  *
22616  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
22617  *     try:
22618  *         _import_umath()
22619  */
22620 
22621   /* function exit code */
22622   __pyx_r = 0;
22623   goto __pyx_L0;
22624   __pyx_L1_error:;
22625   __Pyx_XDECREF(__pyx_t_5);
22626   __Pyx_XDECREF(__pyx_t_6);
22627   __Pyx_XDECREF(__pyx_t_7);
22628   __Pyx_XDECREF(__pyx_t_8);
22629   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22630   __pyx_r = -1;
22631   __pyx_L0:;
22632   __Pyx_RefNannyFinishContext();
22633   return __pyx_r;
22634 }
22635 
22636 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
22637  *         raise ImportError("numpy.core.umath failed to import")
22638  *
22639  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
22640  *     try:
22641  *         _import_umath()
22642  */
22643 
__pyx_f_5numpy_import_ufunc(void)22644 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
22645   int __pyx_r;
22646   __Pyx_RefNannyDeclarations
22647   PyObject *__pyx_t_1 = NULL;
22648   PyObject *__pyx_t_2 = NULL;
22649   PyObject *__pyx_t_3 = NULL;
22650   int __pyx_t_4;
22651   PyObject *__pyx_t_5 = NULL;
22652   PyObject *__pyx_t_6 = NULL;
22653   PyObject *__pyx_t_7 = NULL;
22654   PyObject *__pyx_t_8 = NULL;
22655   __Pyx_RefNannySetupContext("import_ufunc", 0);
22656 
22657   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
22658  *
22659  * cdef inline int import_ufunc() except -1:
22660  *     try:             # <<<<<<<<<<<<<<
22661  *         _import_umath()
22662  *     except Exception:
22663  */
22664   {
22665     __Pyx_PyThreadState_declare
22666     __Pyx_PyThreadState_assign
22667     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22668     __Pyx_XGOTREF(__pyx_t_1);
22669     __Pyx_XGOTREF(__pyx_t_2);
22670     __Pyx_XGOTREF(__pyx_t_3);
22671     /*try:*/ {
22672 
22673       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
22674  * cdef inline int import_ufunc() except -1:
22675  *     try:
22676  *         _import_umath()             # <<<<<<<<<<<<<<
22677  *     except Exception:
22678  *         raise ImportError("numpy.core.umath failed to import")
22679  */
22680       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
22681 
22682       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
22683  *
22684  * cdef inline int import_ufunc() except -1:
22685  *     try:             # <<<<<<<<<<<<<<
22686  *         _import_umath()
22687  *     except Exception:
22688  */
22689     }
22690     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22691     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22692     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22693     goto __pyx_L8_try_end;
22694     __pyx_L3_error:;
22695 
22696     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
22697  *     try:
22698  *         _import_umath()
22699  *     except Exception:             # <<<<<<<<<<<<<<
22700  *         raise ImportError("numpy.core.umath failed to import")
22701  */
22702     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22703     if (__pyx_t_4) {
22704       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22705       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
22706       __Pyx_GOTREF(__pyx_t_5);
22707       __Pyx_GOTREF(__pyx_t_6);
22708       __Pyx_GOTREF(__pyx_t_7);
22709 
22710       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
22711  *         _import_umath()
22712  *     except Exception:
22713  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
22714  */
22715       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
22716       __Pyx_GOTREF(__pyx_t_8);
22717       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22718       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22719       __PYX_ERR(3, 1050, __pyx_L5_except_error)
22720     }
22721     goto __pyx_L5_except_error;
22722     __pyx_L5_except_error:;
22723 
22724     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
22725  *
22726  * cdef inline int import_ufunc() except -1:
22727  *     try:             # <<<<<<<<<<<<<<
22728  *         _import_umath()
22729  *     except Exception:
22730  */
22731     __Pyx_XGIVEREF(__pyx_t_1);
22732     __Pyx_XGIVEREF(__pyx_t_2);
22733     __Pyx_XGIVEREF(__pyx_t_3);
22734     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22735     goto __pyx_L1_error;
22736     __pyx_L8_try_end:;
22737   }
22738 
22739   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
22740  *         raise ImportError("numpy.core.umath failed to import")
22741  *
22742  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
22743  *     try:
22744  *         _import_umath()
22745  */
22746 
22747   /* function exit code */
22748   __pyx_r = 0;
22749   goto __pyx_L0;
22750   __pyx_L1_error:;
22751   __Pyx_XDECREF(__pyx_t_5);
22752   __Pyx_XDECREF(__pyx_t_6);
22753   __Pyx_XDECREF(__pyx_t_7);
22754   __Pyx_XDECREF(__pyx_t_8);
22755   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22756   __pyx_r = -1;
22757   __pyx_L0:;
22758   __Pyx_RefNannyFinishContext();
22759   return __pyx_r;
22760 }
22761 
22762 /* "oct_visitors.pxd":51
22763  *     cdef void visit(self, Oct*, np.uint8_t selected)
22764  *
22765  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
22766  *         cdef int d = (1 << self.oref)
22767  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
22768  */
22769 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)22770 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
22771   int __pyx_v_d;
22772   int __pyx_r;
22773   __Pyx_RefNannyDeclarations
22774   __Pyx_RefNannySetupContext("oind", 0);
22775 
22776   /* "oct_visitors.pxd":52
22777  *
22778  *     cdef inline int oind(self):
22779  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
22780  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
22781  *
22782  */
22783   __pyx_v_d = (1 << __pyx_v_self->oref);
22784 
22785   /* "oct_visitors.pxd":53
22786  *     cdef inline int oind(self):
22787  *         cdef int d = (1 << self.oref)
22788  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])             # <<<<<<<<<<<<<<
22789  *
22790  *     cdef inline int rind(self):
22791  */
22792   __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2]));
22793   goto __pyx_L0;
22794 
22795   /* "oct_visitors.pxd":51
22796  *     cdef void visit(self, Oct*, np.uint8_t selected)
22797  *
22798  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
22799  *         cdef int d = (1 << self.oref)
22800  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
22801  */
22802 
22803   /* function exit code */
22804   __pyx_L0:;
22805   __Pyx_RefNannyFinishContext();
22806   return __pyx_r;
22807 }
22808 
22809 /* "oct_visitors.pxd":55
22810  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
22811  *
22812  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
22813  *         cdef int d = (1 << self.oref)
22814  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
22815  */
22816 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)22817 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
22818   int __pyx_v_d;
22819   int __pyx_r;
22820   __Pyx_RefNannyDeclarations
22821   __Pyx_RefNannySetupContext("rind", 0);
22822 
22823   /* "oct_visitors.pxd":56
22824  *
22825  *     cdef inline int rind(self):
22826  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
22827  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
22828  *
22829  */
22830   __pyx_v_d = (1 << __pyx_v_self->oref);
22831 
22832   /* "oct_visitors.pxd":57
22833  *     cdef inline int rind(self):
22834  *         cdef int d = (1 << self.oref)
22835  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])             # <<<<<<<<<<<<<<
22836  *
22837  * cdef class CountTotalOcts(OctVisitor):
22838  */
22839   __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0]));
22840   goto __pyx_L0;
22841 
22842   /* "oct_visitors.pxd":55
22843  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
22844  *
22845  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
22846  *         cdef int d = (1 << self.oref)
22847  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
22848  */
22849 
22850   /* function exit code */
22851   __pyx_L0:;
22852   __Pyx_RefNannyFinishContext();
22853   return __pyx_r;
22854 }
22855 
22856 /* "oct_visitors.pxd":142
22857  *     cdef np.uint64_t[:] morton_ind
22858  *
22859  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
22860  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
22861  *     return (((i*2)+j)*2+k)
22862  */
22863 
__pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)22864 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
22865   int __pyx_r;
22866 
22867   /* "oct_visitors.pxd":144
22868  * cdef inline int cind(int i, int j, int k) nogil:
22869  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
22870  *     return (((i*2)+j)*2+k)             # <<<<<<<<<<<<<<
22871  *
22872  * from oct_container cimport OctreeContainer
22873  */
22874   __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k);
22875   goto __pyx_L0;
22876 
22877   /* "oct_visitors.pxd":142
22878  *     cdef np.uint64_t[:] morton_ind
22879  *
22880  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
22881  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
22882  *     return (((i*2)+j)*2+k)
22883  */
22884 
22885   /* function exit code */
22886   __pyx_L0:;
22887   return __pyx_r;
22888 }
22889 
22890 /* "oct_visitors.pxd":165
22891  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
22892  *
22893  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
22894  *         cdef int d = (1 << self.oref)
22895  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
22896  */
22897 
__pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor * __pyx_v_self)22898 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self) {
22899   int __pyx_v_d;
22900   __pyx_t_5numpy_uint8_t __pyx_r;
22901   __Pyx_RefNannyDeclarations
22902   __Pyx_RefNannySetupContext("neighbour_rind", 0);
22903 
22904   /* "oct_visitors.pxd":166
22905  *
22906  *     cdef inline np.uint8_t neighbour_rind(self):
22907  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
22908  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
22909  *
22910  */
22911   __pyx_v_d = (1 << __pyx_v_self->__pyx_base.oref);
22912 
22913   /* "oct_visitors.pxd":167
22914  *     cdef inline np.uint8_t neighbour_rind(self):
22915  *         cdef int d = (1 << self.oref)
22916  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])             # <<<<<<<<<<<<<<
22917  *
22918  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):
22919  */
22920   __pyx_r = (((((__pyx_v_self->neigh_ind[2]) * __pyx_v_d) + (__pyx_v_self->neigh_ind[1])) * __pyx_v_d) + (__pyx_v_self->neigh_ind[0]));
22921   goto __pyx_L0;
22922 
22923   /* "oct_visitors.pxd":165
22924  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
22925  *
22926  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
22927  *         cdef int d = (1 << self.oref)
22928  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
22929  */
22930 
22931   /* function exit code */
22932   __pyx_L0:;
22933   __Pyx_RefNannyFinishContext();
22934   return __pyx_r;
22935 }
22936 
22937 /* "yt/utilities/lib/fp_utils.pxd":13
22938  *
22939  *
22940  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
22941  *     if i0 > i1: return i0
22942  *     return i1
22943  */
22944 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)22945 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
22946   __pyx_t_5numpy_int64_t __pyx_r;
22947   int __pyx_t_1;
22948 
22949   /* "yt/utilities/lib/fp_utils.pxd":14
22950  *
22951  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
22952  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
22953  *     return i1
22954  *
22955  */
22956   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
22957   if (__pyx_t_1) {
22958     __pyx_r = __pyx_v_i0;
22959     goto __pyx_L0;
22960   }
22961 
22962   /* "yt/utilities/lib/fp_utils.pxd":15
22963  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
22964  *     if i0 > i1: return i0
22965  *     return i1             # <<<<<<<<<<<<<<
22966  *
22967  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
22968  */
22969   __pyx_r = __pyx_v_i1;
22970   goto __pyx_L0;
22971 
22972   /* "yt/utilities/lib/fp_utils.pxd":13
22973  *
22974  *
22975  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
22976  *     if i0 > i1: return i0
22977  *     return i1
22978  */
22979 
22980   /* function exit code */
22981   __pyx_L0:;
22982   return __pyx_r;
22983 }
22984 
22985 /* "yt/utilities/lib/fp_utils.pxd":17
22986  *     return i1
22987  *
22988  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
22989  *     if f0 > f1: return f0
22990  *     return f1
22991  */
22992 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)22993 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
22994   __pyx_t_5numpy_float64_t __pyx_r;
22995   int __pyx_t_1;
22996 
22997   /* "yt/utilities/lib/fp_utils.pxd":18
22998  *
22999  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
23000  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
23001  *     return f1
23002  *
23003  */
23004   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
23005   if (__pyx_t_1) {
23006     __pyx_r = __pyx_v_f0;
23007     goto __pyx_L0;
23008   }
23009 
23010   /* "yt/utilities/lib/fp_utils.pxd":19
23011  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
23012  *     if f0 > f1: return f0
23013  *     return f1             # <<<<<<<<<<<<<<
23014  *
23015  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
23016  */
23017   __pyx_r = __pyx_v_f1;
23018   goto __pyx_L0;
23019 
23020   /* "yt/utilities/lib/fp_utils.pxd":17
23021  *     return i1
23022  *
23023  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
23024  *     if f0 > f1: return f0
23025  *     return f1
23026  */
23027 
23028   /* function exit code */
23029   __pyx_L0:;
23030   return __pyx_r;
23031 }
23032 
23033 /* "yt/utilities/lib/fp_utils.pxd":21
23034  *     return f1
23035  *
23036  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23037  *     if i0 < i1: return i0
23038  *     return i1
23039  */
23040 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)23041 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
23042   __pyx_t_5numpy_int64_t __pyx_r;
23043   int __pyx_t_1;
23044 
23045   /* "yt/utilities/lib/fp_utils.pxd":22
23046  *
23047  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
23048  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
23049  *     return i1
23050  *
23051  */
23052   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
23053   if (__pyx_t_1) {
23054     __pyx_r = __pyx_v_i0;
23055     goto __pyx_L0;
23056   }
23057 
23058   /* "yt/utilities/lib/fp_utils.pxd":23
23059  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
23060  *     if i0 < i1: return i0
23061  *     return i1             # <<<<<<<<<<<<<<
23062  *
23063  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
23064  */
23065   __pyx_r = __pyx_v_i1;
23066   goto __pyx_L0;
23067 
23068   /* "yt/utilities/lib/fp_utils.pxd":21
23069  *     return f1
23070  *
23071  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23072  *     if i0 < i1: return i0
23073  *     return i1
23074  */
23075 
23076   /* function exit code */
23077   __pyx_L0:;
23078   return __pyx_r;
23079 }
23080 
23081 /* "yt/utilities/lib/fp_utils.pxd":25
23082  *     return i1
23083  *
23084  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
23085  *     if f0 < f1: return f0
23086  *     return f1
23087  */
23088 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)23089 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0, __pyx_t_5numpy_float64_t __pyx_v_f1) {
23090   __pyx_t_5numpy_float64_t __pyx_r;
23091   int __pyx_t_1;
23092 
23093   /* "yt/utilities/lib/fp_utils.pxd":26
23094  *
23095  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
23096  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
23097  *     return f1
23098  *
23099  */
23100   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
23101   if (__pyx_t_1) {
23102     __pyx_r = __pyx_v_f0;
23103     goto __pyx_L0;
23104   }
23105 
23106   /* "yt/utilities/lib/fp_utils.pxd":27
23107  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
23108  *     if f0 < f1: return f0
23109  *     return f1             # <<<<<<<<<<<<<<
23110  *
23111  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
23112  */
23113   __pyx_r = __pyx_v_f1;
23114   goto __pyx_L0;
23115 
23116   /* "yt/utilities/lib/fp_utils.pxd":25
23117  *     return i1
23118  *
23119  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
23120  *     if f0 < f1: return f0
23121  *     return f1
23122  */
23123 
23124   /* function exit code */
23125   __pyx_L0:;
23126   return __pyx_r;
23127 }
23128 
23129 /* "yt/utilities/lib/fp_utils.pxd":29
23130  *     return f1
23131  *
23132  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
23133  *     if f0 < 0.0: return -f0
23134  *     return f0
23135  */
23136 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)23137 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
23138   __pyx_t_5numpy_float64_t __pyx_r;
23139   int __pyx_t_1;
23140 
23141   /* "yt/utilities/lib/fp_utils.pxd":30
23142  *
23143  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
23144  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
23145  *     return f0
23146  *
23147  */
23148   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
23149   if (__pyx_t_1) {
23150     __pyx_r = (-__pyx_v_f0);
23151     goto __pyx_L0;
23152   }
23153 
23154   /* "yt/utilities/lib/fp_utils.pxd":31
23155  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
23156  *     if f0 < 0.0: return -f0
23157  *     return f0             # <<<<<<<<<<<<<<
23158  *
23159  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23160  */
23161   __pyx_r = __pyx_v_f0;
23162   goto __pyx_L0;
23163 
23164   /* "yt/utilities/lib/fp_utils.pxd":29
23165  *     return f1
23166  *
23167  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
23168  *     if f0 < 0.0: return -f0
23169  *     return f0
23170  */
23171 
23172   /* function exit code */
23173   __pyx_L0:;
23174   return __pyx_r;
23175 }
23176 
23177 /* "yt/utilities/lib/fp_utils.pxd":33
23178  *     return f0
23179  *
23180  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
23181  *     if i < a: return a
23182  *     if i > b: return b
23183  */
23184 
__pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)23185 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
23186   __pyx_t_5numpy_int64_t __pyx_r;
23187   int __pyx_t_1;
23188 
23189   /* "yt/utilities/lib/fp_utils.pxd":34
23190  *
23191  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23192  *     if i < a: return a             # <<<<<<<<<<<<<<
23193  *     if i > b: return b
23194  *     return i
23195  */
23196   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
23197   if (__pyx_t_1) {
23198     __pyx_r = __pyx_v_a;
23199     goto __pyx_L0;
23200   }
23201 
23202   /* "yt/utilities/lib/fp_utils.pxd":35
23203  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23204  *     if i < a: return a
23205  *     if i > b: return b             # <<<<<<<<<<<<<<
23206  *     return i
23207  *
23208  */
23209   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
23210   if (__pyx_t_1) {
23211     __pyx_r = __pyx_v_b;
23212     goto __pyx_L0;
23213   }
23214 
23215   /* "yt/utilities/lib/fp_utils.pxd":36
23216  *     if i < a: return a
23217  *     if i > b: return b
23218  *     return i             # <<<<<<<<<<<<<<
23219  *
23220  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23221  */
23222   __pyx_r = __pyx_v_i;
23223   goto __pyx_L0;
23224 
23225   /* "yt/utilities/lib/fp_utils.pxd":33
23226  *     return f0
23227  *
23228  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
23229  *     if i < a: return a
23230  *     if i > b: return b
23231  */
23232 
23233   /* function exit code */
23234   __pyx_L0:;
23235   return __pyx_r;
23236 }
23237 
23238 /* "yt/utilities/lib/fp_utils.pxd":38
23239  *     return i
23240  *
23241  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
23242  *     if i < a: return a
23243  *     if i > b: return b
23244  */
23245 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i,__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)23246 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64clip(__pyx_t_5numpy_int64_t __pyx_v_i, __pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
23247   __pyx_t_5numpy_int64_t __pyx_r;
23248   int __pyx_t_1;
23249 
23250   /* "yt/utilities/lib/fp_utils.pxd":39
23251  *
23252  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23253  *     if i < a: return a             # <<<<<<<<<<<<<<
23254  *     if i > b: return b
23255  *     return i
23256  */
23257   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
23258   if (__pyx_t_1) {
23259     __pyx_r = __pyx_v_a;
23260     goto __pyx_L0;
23261   }
23262 
23263   /* "yt/utilities/lib/fp_utils.pxd":40
23264  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
23265  *     if i < a: return a
23266  *     if i > b: return b             # <<<<<<<<<<<<<<
23267  *     return i
23268  *
23269  */
23270   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
23271   if (__pyx_t_1) {
23272     __pyx_r = __pyx_v_b;
23273     goto __pyx_L0;
23274   }
23275 
23276   /* "yt/utilities/lib/fp_utils.pxd":41
23277  *     if i < a: return a
23278  *     if i > b: return b
23279  *     return i             # <<<<<<<<<<<<<<
23280  *
23281  * cdef inline np.float64_t fclip(np.float64_t f,
23282  */
23283   __pyx_r = __pyx_v_i;
23284   goto __pyx_L0;
23285 
23286   /* "yt/utilities/lib/fp_utils.pxd":38
23287  *     return i
23288  *
23289  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
23290  *     if i < a: return a
23291  *     if i > b: return b
23292  */
23293 
23294   /* function exit code */
23295   __pyx_L0:;
23296   return __pyx_r;
23297 }
23298 
23299 /* "yt/utilities/lib/fp_utils.pxd":43
23300  *     return i
23301  *
23302  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
23303  *                       np.float64_t a, np.float64_t b) nogil:
23304  *     return fmin(fmax(f, a), b)
23305  */
23306 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f,__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)23307 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fclip(__pyx_t_5numpy_float64_t __pyx_v_f, __pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
23308   __pyx_t_5numpy_float64_t __pyx_r;
23309 
23310   /* "yt/utilities/lib/fp_utils.pxd":45
23311  * cdef inline np.float64_t fclip(np.float64_t f,
23312  *                       np.float64_t a, np.float64_t b) nogil:
23313  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
23314  *
23315  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
23316  */
23317   __pyx_r = __pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_v_f, __pyx_v_a), __pyx_v_b);
23318   goto __pyx_L0;
23319 
23320   /* "yt/utilities/lib/fp_utils.pxd":43
23321  *     return i
23322  *
23323  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
23324  *                       np.float64_t a, np.float64_t b) nogil:
23325  *     return fmin(fmax(f, a), b)
23326  */
23327 
23328   /* function exit code */
23329   __pyx_L0:;
23330   return __pyx_r;
23331 }
23332 
23333 /* "yt/utilities/lib/fp_utils.pxd":47
23334  *     return fmin(fmax(f, a), b)
23335  *
23336  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23337  *     if i0 > i1: return i0
23338  *     return i1
23339  */
23340 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)23341 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
23342   __pyx_t_5numpy_int64_t __pyx_r;
23343   int __pyx_t_1;
23344 
23345   /* "yt/utilities/lib/fp_utils.pxd":48
23346  *
23347  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
23348  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
23349  *     return i1
23350  *
23351  */
23352   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
23353   if (__pyx_t_1) {
23354     __pyx_r = __pyx_v_i0;
23355     goto __pyx_L0;
23356   }
23357 
23358   /* "yt/utilities/lib/fp_utils.pxd":49
23359  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
23360  *     if i0 > i1: return i0
23361  *     return i1             # <<<<<<<<<<<<<<
23362  *
23363  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
23364  */
23365   __pyx_r = __pyx_v_i1;
23366   goto __pyx_L0;
23367 
23368   /* "yt/utilities/lib/fp_utils.pxd":47
23369  *     return fmin(fmax(f, a), b)
23370  *
23371  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23372  *     if i0 > i1: return i0
23373  *     return i1
23374  */
23375 
23376   /* function exit code */
23377   __pyx_L0:;
23378   return __pyx_r;
23379 }
23380 
23381 /* "yt/utilities/lib/fp_utils.pxd":51
23382  *     return i1
23383  *
23384  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23385  *     if i0 < i1: return i0
23386  *     return i1
23387  */
23388 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)23389 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0, __pyx_t_5numpy_int64_t __pyx_v_i1) {
23390   __pyx_t_5numpy_int64_t __pyx_r;
23391   int __pyx_t_1;
23392 
23393   /* "yt/utilities/lib/fp_utils.pxd":52
23394  *
23395  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
23396  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
23397  *     return i1
23398  *
23399  */
23400   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
23401   if (__pyx_t_1) {
23402     __pyx_r = __pyx_v_i0;
23403     goto __pyx_L0;
23404   }
23405 
23406   /* "yt/utilities/lib/fp_utils.pxd":53
23407  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
23408  *     if i0 < i1: return i0
23409  *     return i1             # <<<<<<<<<<<<<<
23410  *
23411  * cdef inline _ensure_code(arr):
23412  */
23413   __pyx_r = __pyx_v_i1;
23414   goto __pyx_L0;
23415 
23416   /* "yt/utilities/lib/fp_utils.pxd":51
23417  *     return i1
23418  *
23419  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
23420  *     if i0 < i1: return i0
23421  *     return i1
23422  */
23423 
23424   /* function exit code */
23425   __pyx_L0:;
23426   return __pyx_r;
23427 }
23428 
23429 /* "yt/utilities/lib/fp_utils.pxd":55
23430  *     return i1
23431  *
23432  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
23433  *     if hasattr(arr, "units"):
23434  *         if "code_length" == str(arr.units):
23435  */
23436 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)23437 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
23438   PyObject *__pyx_r = NULL;
23439   __Pyx_RefNannyDeclarations
23440   int __pyx_t_1;
23441   int __pyx_t_2;
23442   PyObject *__pyx_t_3 = NULL;
23443   PyObject *__pyx_t_4 = NULL;
23444   PyObject *__pyx_t_5 = NULL;
23445   __Pyx_RefNannySetupContext("_ensure_code", 0);
23446 
23447   /* "yt/utilities/lib/fp_utils.pxd":56
23448  *
23449  * cdef inline _ensure_code(arr):
23450  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
23451  *         if "code_length" == str(arr.units):
23452  *             return arr
23453  */
23454   __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 56, __pyx_L1_error)
23455   __pyx_t_2 = (__pyx_t_1 != 0);
23456   if (__pyx_t_2) {
23457 
23458     /* "yt/utilities/lib/fp_utils.pxd":57
23459  * cdef inline _ensure_code(arr):
23460  *     if hasattr(arr, "units"):
23461  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
23462  *             return arr
23463  *         arr.convert_to_units("code_length")
23464  */
23465     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 57, __pyx_L1_error)
23466     __Pyx_GOTREF(__pyx_t_3);
23467     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 57, __pyx_L1_error)
23468     __Pyx_GOTREF(__pyx_t_4);
23469     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23470     __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 57, __pyx_L1_error)
23471     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23472     if (__pyx_t_2) {
23473 
23474       /* "yt/utilities/lib/fp_utils.pxd":58
23475  *     if hasattr(arr, "units"):
23476  *         if "code_length" == str(arr.units):
23477  *             return arr             # <<<<<<<<<<<<<<
23478  *         arr.convert_to_units("code_length")
23479  *     return arr
23480  */
23481       __Pyx_XDECREF(__pyx_r);
23482       __Pyx_INCREF(__pyx_v_arr);
23483       __pyx_r = __pyx_v_arr;
23484       goto __pyx_L0;
23485 
23486       /* "yt/utilities/lib/fp_utils.pxd":57
23487  * cdef inline _ensure_code(arr):
23488  *     if hasattr(arr, "units"):
23489  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
23490  *             return arr
23491  *         arr.convert_to_units("code_length")
23492  */
23493     }
23494 
23495     /* "yt/utilities/lib/fp_utils.pxd":59
23496  *         if "code_length" == str(arr.units):
23497  *             return arr
23498  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
23499  *     return arr
23500  */
23501     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error)
23502     __Pyx_GOTREF(__pyx_t_3);
23503     __pyx_t_5 = NULL;
23504     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
23505       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
23506       if (likely(__pyx_t_5)) {
23507         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23508         __Pyx_INCREF(__pyx_t_5);
23509         __Pyx_INCREF(function);
23510         __Pyx_DECREF_SET(__pyx_t_3, function);
23511       }
23512     }
23513     __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_n_s_code_length) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_code_length);
23514     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23515     if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 59, __pyx_L1_error)
23516     __Pyx_GOTREF(__pyx_t_4);
23517     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23518     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23519 
23520     /* "yt/utilities/lib/fp_utils.pxd":56
23521  *
23522  * cdef inline _ensure_code(arr):
23523  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
23524  *         if "code_length" == str(arr.units):
23525  *             return arr
23526  */
23527   }
23528 
23529   /* "yt/utilities/lib/fp_utils.pxd":60
23530  *             return arr
23531  *         arr.convert_to_units("code_length")
23532  *     return arr             # <<<<<<<<<<<<<<
23533  */
23534   __Pyx_XDECREF(__pyx_r);
23535   __Pyx_INCREF(__pyx_v_arr);
23536   __pyx_r = __pyx_v_arr;
23537   goto __pyx_L0;
23538 
23539   /* "yt/utilities/lib/fp_utils.pxd":55
23540  *     return i1
23541  *
23542  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
23543  *     if hasattr(arr, "units"):
23544  *         if "code_length" == str(arr.units):
23545  */
23546 
23547   /* function exit code */
23548   __pyx_L1_error:;
23549   __Pyx_XDECREF(__pyx_t_3);
23550   __Pyx_XDECREF(__pyx_t_4);
23551   __Pyx_XDECREF(__pyx_t_5);
23552   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
23553   __pyx_r = 0;
23554   __pyx_L0:;
23555   __Pyx_XGIVEREF(__pyx_r);
23556   __Pyx_RefNannyFinishContext();
23557   return __pyx_r;
23558 }
23559 
23560 /* "yt/utilities/lib/geometry_utils.pxd":24
23561  * @cython.boundscheck(False)
23562  * @cython.wraparound(False)
23563  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
23564  *     cdef np.float64_t m
23565  *     cdef int e0 = 0
23566  */
23567 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_int64_t * __pyx_v_e)23568 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_int64_t *__pyx_v_e) {
23569   __pyx_t_5numpy_float64_t __pyx_v_m;
23570   int __pyx_v_e0;
23571   __pyx_t_5numpy_int64_t __pyx_r;
23572   __Pyx_RefNannyDeclarations
23573   __Pyx_RefNannySetupContext("ifrexp", 0);
23574 
23575   /* "yt/utilities/lib/geometry_utils.pxd":26
23576  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):
23577  *     cdef np.float64_t m
23578  *     cdef int e0 = 0             # <<<<<<<<<<<<<<
23579  *     m = frexp(x,&e0)
23580  *     e[0] = <np.int64_t>e0
23581  */
23582   __pyx_v_e0 = 0;
23583 
23584   /* "yt/utilities/lib/geometry_utils.pxd":27
23585  *     cdef np.float64_t m
23586  *     cdef int e0 = 0
23587  *     m = frexp(x,&e0)             # <<<<<<<<<<<<<<
23588  *     e[0] = <np.int64_t>e0
23589  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
23590  */
23591   __pyx_v_m = frexp(__pyx_v_x, (&__pyx_v_e0));
23592 
23593   /* "yt/utilities/lib/geometry_utils.pxd":28
23594  *     cdef int e0 = 0
23595  *     m = frexp(x,&e0)
23596  *     e[0] = <np.int64_t>e0             # <<<<<<<<<<<<<<
23597  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
23598  *
23599  */
23600   (__pyx_v_e[0]) = ((__pyx_t_5numpy_int64_t)__pyx_v_e0);
23601 
23602   /* "yt/utilities/lib/geometry_utils.pxd":29
23603  *     m = frexp(x,&e0)
23604  *     e[0] = <np.int64_t>e0
23605  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)             # <<<<<<<<<<<<<<
23606  *
23607  * @cython.cdivision(True)
23608  */
23609   __pyx_r = ((__pyx_t_5numpy_int64_t)ldexp(__pyx_v_m, ((int)DBL_MANT_DIG)));
23610   goto __pyx_L0;
23611 
23612   /* "yt/utilities/lib/geometry_utils.pxd":24
23613  * @cython.boundscheck(False)
23614  * @cython.wraparound(False)
23615  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
23616  *     cdef np.float64_t m
23617  *     cdef int e0 = 0
23618  */
23619 
23620   /* function exit code */
23621   __pyx_L0:;
23622   __Pyx_RefNannyFinishContext();
23623   return __pyx_r;
23624 }
23625 
23626 /* "yt/utilities/lib/geometry_utils.pxd":34
23627  * @cython.boundscheck(False)
23628  * @cython.wraparound(False)
23629  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
23630  *     """Get the most significant differing bit between a and b."""
23631  *     cdef np.int64_t c, ndx
23632  */
23633 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)23634 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
23635   __pyx_t_5numpy_int64_t __pyx_v_c;
23636   __pyx_t_5numpy_int64_t __pyx_v_ndx;
23637   __pyx_t_5numpy_int64_t __pyx_r;
23638   __Pyx_RefNannyDeclarations
23639   int __pyx_t_1;
23640   __Pyx_RefNannySetupContext("msdb", 0);
23641 
23642   /* "yt/utilities/lib/geometry_utils.pxd":37
23643  *     """Get the most significant differing bit between a and b."""
23644  *     cdef np.int64_t c, ndx
23645  *     c = a ^ b             # <<<<<<<<<<<<<<
23646  *     ndx = 0
23647  *     while (0 < c):
23648  */
23649   __pyx_v_c = (__pyx_v_a ^ __pyx_v_b);
23650 
23651   /* "yt/utilities/lib/geometry_utils.pxd":38
23652  *     cdef np.int64_t c, ndx
23653  *     c = a ^ b
23654  *     ndx = 0             # <<<<<<<<<<<<<<
23655  *     while (0 < c):
23656  *         c = (c >> 1)
23657  */
23658   __pyx_v_ndx = 0;
23659 
23660   /* "yt/utilities/lib/geometry_utils.pxd":39
23661  *     c = a ^ b
23662  *     ndx = 0
23663  *     while (0 < c):             # <<<<<<<<<<<<<<
23664  *         c = (c >> 1)
23665  *         ndx+=1
23666  */
23667   while (1) {
23668     __pyx_t_1 = ((0 < __pyx_v_c) != 0);
23669     if (!__pyx_t_1) break;
23670 
23671     /* "yt/utilities/lib/geometry_utils.pxd":40
23672  *     ndx = 0
23673  *     while (0 < c):
23674  *         c = (c >> 1)             # <<<<<<<<<<<<<<
23675  *         ndx+=1
23676  *     return ndx
23677  */
23678     __pyx_v_c = (__pyx_v_c >> 1);
23679 
23680     /* "yt/utilities/lib/geometry_utils.pxd":41
23681  *     while (0 < c):
23682  *         c = (c >> 1)
23683  *         ndx+=1             # <<<<<<<<<<<<<<
23684  *     return ndx
23685  *
23686  */
23687     __pyx_v_ndx = (__pyx_v_ndx + 1);
23688   }
23689 
23690   /* "yt/utilities/lib/geometry_utils.pxd":42
23691  *         c = (c >> 1)
23692  *         ndx+=1
23693  *     return ndx             # <<<<<<<<<<<<<<
23694  *
23695  * @cython.cdivision(True)
23696  */
23697   __pyx_r = __pyx_v_ndx;
23698   goto __pyx_L0;
23699 
23700   /* "yt/utilities/lib/geometry_utils.pxd":34
23701  * @cython.boundscheck(False)
23702  * @cython.wraparound(False)
23703  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
23704  *     """Get the most significant differing bit between a and b."""
23705  *     cdef np.int64_t c, ndx
23706  */
23707 
23708   /* function exit code */
23709   __pyx_L0:;
23710   __Pyx_RefNannyFinishContext();
23711   return __pyx_r;
23712 }
23713 
23714 /* "yt/utilities/lib/geometry_utils.pxd":47
23715  * @cython.boundscheck(False)
23716  * @cython.wraparound(False)
23717  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
23718  *     """Get the exponent of the highest differing bit between a and b"""
23719  *     # Get mantissa and exponents for each number
23720  */
23721 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)23722 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
23723   __pyx_t_5numpy_int64_t __pyx_v_a_m;
23724   __pyx_t_5numpy_int64_t __pyx_v_a_e;
23725   __pyx_t_5numpy_int64_t __pyx_v_b_m;
23726   __pyx_t_5numpy_int64_t __pyx_v_b_e;
23727   __pyx_t_5numpy_int64_t __pyx_v_x;
23728   __pyx_t_5numpy_int64_t __pyx_v_y;
23729   __pyx_t_5numpy_int64_t __pyx_v_z;
23730   __pyx_t_5numpy_int64_t __pyx_r;
23731   __Pyx_RefNannyDeclarations
23732   int __pyx_t_1;
23733   __Pyx_RefNannySetupContext("xor_msb", 0);
23734 
23735   /* "yt/utilities/lib/geometry_utils.pxd":51
23736  *     # Get mantissa and exponents for each number
23737  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
23738  *     b_e = 0             # <<<<<<<<<<<<<<
23739  *     a_e = 0
23740  *     a_m = ifrexp(a,&a_e)
23741  */
23742   __pyx_v_b_e = 0;
23743 
23744   /* "yt/utilities/lib/geometry_utils.pxd":52
23745  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
23746  *     b_e = 0
23747  *     a_e = 0             # <<<<<<<<<<<<<<
23748  *     a_m = ifrexp(a,&a_e)
23749  *     b_m = ifrexp(b,&b_e)
23750  */
23751   __pyx_v_a_e = 0;
23752 
23753   /* "yt/utilities/lib/geometry_utils.pxd":53
23754  *     b_e = 0
23755  *     a_e = 0
23756  *     a_m = ifrexp(a,&a_e)             # <<<<<<<<<<<<<<
23757  *     b_m = ifrexp(b,&b_e)
23758  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
23759  */
23760   __pyx_v_a_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_a, (&__pyx_v_a_e));
23761 
23762   /* "yt/utilities/lib/geometry_utils.pxd":54
23763  *     a_e = 0
23764  *     a_m = ifrexp(a,&a_e)
23765  *     b_m = ifrexp(b,&b_e)             # <<<<<<<<<<<<<<
23766  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
23767  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
23768  */
23769   __pyx_v_b_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_b, (&__pyx_v_b_e));
23770 
23771   /* "yt/utilities/lib/geometry_utils.pxd":55
23772  *     a_m = ifrexp(a,&a_e)
23773  *     b_m = ifrexp(b,&b_e)
23774  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
23775  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
23776  *     # Compare mantissa if exponents equal
23777  */
23778   __pyx_v_x = ((__pyx_t_5numpy_int64_t)((__pyx_v_a_e + 1) * DBL_MANT_DIG));
23779 
23780   /* "yt/utilities/lib/geometry_utils.pxd":56
23781  *     b_m = ifrexp(b,&b_e)
23782  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
23783  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
23784  *     # Compare mantissa if exponents equal
23785  *     if x == y:
23786  */
23787   __pyx_v_y = ((__pyx_t_5numpy_int64_t)((__pyx_v_b_e + 1) * DBL_MANT_DIG));
23788 
23789   /* "yt/utilities/lib/geometry_utils.pxd":58
23790  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
23791  *     # Compare mantissa if exponents equal
23792  *     if x == y:             # <<<<<<<<<<<<<<
23793  *         if a_m == b_m: return 0
23794  *         z = msdb(a_m,b_m)
23795  */
23796   __pyx_t_1 = ((__pyx_v_x == __pyx_v_y) != 0);
23797   if (__pyx_t_1) {
23798 
23799     /* "yt/utilities/lib/geometry_utils.pxd":59
23800  *     # Compare mantissa if exponents equal
23801  *     if x == y:
23802  *         if a_m == b_m: return 0             # <<<<<<<<<<<<<<
23803  *         z = msdb(a_m,b_m)
23804  *         #if 1: return z
23805  */
23806     __pyx_t_1 = ((__pyx_v_a_m == __pyx_v_b_m) != 0);
23807     if (__pyx_t_1) {
23808       __pyx_r = 0;
23809       goto __pyx_L0;
23810     }
23811 
23812     /* "yt/utilities/lib/geometry_utils.pxd":60
23813  *     if x == y:
23814  *         if a_m == b_m: return 0
23815  *         z = msdb(a_m,b_m)             # <<<<<<<<<<<<<<
23816  *         #if 1: return z
23817  *         x = x - z
23818  */
23819     __pyx_v_z = __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_v_a_m, __pyx_v_b_m);
23820 
23821     /* "yt/utilities/lib/geometry_utils.pxd":62
23822  *         z = msdb(a_m,b_m)
23823  *         #if 1: return z
23824  *         x = x - z             # <<<<<<<<<<<<<<
23825  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
23826  *     # Otherwise return largest exponent
23827  */
23828     __pyx_v_x = (__pyx_v_x - __pyx_v_z);
23829 
23830     /* "yt/utilities/lib/geometry_utils.pxd":63
23831  *         #if 1: return z
23832  *         x = x - z
23833  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)             # <<<<<<<<<<<<<<
23834  *     # Otherwise return largest exponent
23835  *     if y < x:
23836  */
23837     __pyx_r = (__pyx_v_x - 1);
23838     goto __pyx_L0;
23839 
23840     /* "yt/utilities/lib/geometry_utils.pxd":58
23841  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
23842  *     # Compare mantissa if exponents equal
23843  *     if x == y:             # <<<<<<<<<<<<<<
23844  *         if a_m == b_m: return 0
23845  *         z = msdb(a_m,b_m)
23846  */
23847   }
23848 
23849   /* "yt/utilities/lib/geometry_utils.pxd":65
23850  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
23851  *     # Otherwise return largest exponent
23852  *     if y < x:             # <<<<<<<<<<<<<<
23853  *         return x
23854  *     else:
23855  */
23856   __pyx_t_1 = ((__pyx_v_y < __pyx_v_x) != 0);
23857   if (__pyx_t_1) {
23858 
23859     /* "yt/utilities/lib/geometry_utils.pxd":66
23860  *     # Otherwise return largest exponent
23861  *     if y < x:
23862  *         return x             # <<<<<<<<<<<<<<
23863  *     else:
23864  *         return y
23865  */
23866     __pyx_r = __pyx_v_x;
23867     goto __pyx_L0;
23868 
23869     /* "yt/utilities/lib/geometry_utils.pxd":65
23870  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
23871  *     # Otherwise return largest exponent
23872  *     if y < x:             # <<<<<<<<<<<<<<
23873  *         return x
23874  *     else:
23875  */
23876   }
23877 
23878   /* "yt/utilities/lib/geometry_utils.pxd":68
23879  *         return x
23880  *     else:
23881  *         return y             # <<<<<<<<<<<<<<
23882  *
23883  * @cython.cdivision(True)
23884  */
23885   /*else*/ {
23886     __pyx_r = __pyx_v_y;
23887     goto __pyx_L0;
23888   }
23889 
23890   /* "yt/utilities/lib/geometry_utils.pxd":47
23891  * @cython.boundscheck(False)
23892  * @cython.wraparound(False)
23893  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
23894  *     """Get the exponent of the highest differing bit between a and b"""
23895  *     # Get mantissa and exponents for each number
23896  */
23897 
23898   /* function exit code */
23899   __pyx_L0:;
23900   __Pyx_RefNannyFinishContext();
23901   return __pyx_r;
23902 }
23903 
23904 /* "yt/utilities/lib/geometry_utils.pxd":73
23905  * @cython.boundscheck(False)
23906  * @cython.wraparound(False)
23907  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
23908  *     cdef int j, out, dim
23909  *     cdef np.int64_t x, y
23910  */
23911 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q)23912 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q) {
23913   int __pyx_v_j;
23914   int __pyx_v_out;
23915   int __pyx_v_dim;
23916   __pyx_t_5numpy_int64_t __pyx_v_x;
23917   __pyx_t_5numpy_int64_t __pyx_v_y;
23918   int __pyx_r;
23919   __Pyx_RefNannyDeclarations
23920   int __pyx_t_1;
23921   int __pyx_t_2;
23922   __Pyx_RefNannySetupContext("compare_floats_morton", 0);
23923 
23924   /* "yt/utilities/lib/geometry_utils.pxd":76
23925  *     cdef int j, out, dim
23926  *     cdef np.int64_t x, y
23927  *     x = -9999999999             # <<<<<<<<<<<<<<
23928  *     y = 0
23929  *     dim = 0
23930  */
23931   __pyx_v_x = -9999999999LL;
23932 
23933   /* "yt/utilities/lib/geometry_utils.pxd":77
23934  *     cdef np.int64_t x, y
23935  *     x = -9999999999
23936  *     y = 0             # <<<<<<<<<<<<<<
23937  *     dim = 0
23938  *     for j in range(3):#[::-1]:
23939  */
23940   __pyx_v_y = 0;
23941 
23942   /* "yt/utilities/lib/geometry_utils.pxd":78
23943  *     x = -9999999999
23944  *     y = 0
23945  *     dim = 0             # <<<<<<<<<<<<<<
23946  *     for j in range(3):#[::-1]:
23947  *         y = xor_msb(p[j],q[j])
23948  */
23949   __pyx_v_dim = 0;
23950 
23951   /* "yt/utilities/lib/geometry_utils.pxd":79
23952  *     y = 0
23953  *     dim = 0
23954  *     for j in range(3):#[::-1]:             # <<<<<<<<<<<<<<
23955  *         y = xor_msb(p[j],q[j])
23956  *         if x < y:
23957  */
23958   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
23959     __pyx_v_j = __pyx_t_1;
23960 
23961     /* "yt/utilities/lib/geometry_utils.pxd":80
23962  *     dim = 0
23963  *     for j in range(3):#[::-1]:
23964  *         y = xor_msb(p[j],q[j])             # <<<<<<<<<<<<<<
23965  *         if x < y:
23966  *            x = y
23967  */
23968     __pyx_v_y = __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb((__pyx_v_p[__pyx_v_j]), (__pyx_v_q[__pyx_v_j]));
23969 
23970     /* "yt/utilities/lib/geometry_utils.pxd":81
23971  *     for j in range(3):#[::-1]:
23972  *         y = xor_msb(p[j],q[j])
23973  *         if x < y:             # <<<<<<<<<<<<<<
23974  *            x = y
23975  *            dim = j
23976  */
23977     __pyx_t_2 = ((__pyx_v_x < __pyx_v_y) != 0);
23978     if (__pyx_t_2) {
23979 
23980       /* "yt/utilities/lib/geometry_utils.pxd":82
23981  *         y = xor_msb(p[j],q[j])
23982  *         if x < y:
23983  *            x = y             # <<<<<<<<<<<<<<
23984  *            dim = j
23985  *     if p[dim] < q[dim]:
23986  */
23987       __pyx_v_x = __pyx_v_y;
23988 
23989       /* "yt/utilities/lib/geometry_utils.pxd":83
23990  *         if x < y:
23991  *            x = y
23992  *            dim = j             # <<<<<<<<<<<<<<
23993  *     if p[dim] < q[dim]:
23994  *         out = 1
23995  */
23996       __pyx_v_dim = __pyx_v_j;
23997 
23998       /* "yt/utilities/lib/geometry_utils.pxd":81
23999  *     for j in range(3):#[::-1]:
24000  *         y = xor_msb(p[j],q[j])
24001  *         if x < y:             # <<<<<<<<<<<<<<
24002  *            x = y
24003  *            dim = j
24004  */
24005     }
24006   }
24007 
24008   /* "yt/utilities/lib/geometry_utils.pxd":84
24009  *            x = y
24010  *            dim = j
24011  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
24012  *         out = 1
24013  *     else:
24014  */
24015   __pyx_t_2 = (((__pyx_v_p[__pyx_v_dim]) < (__pyx_v_q[__pyx_v_dim])) != 0);
24016   if (__pyx_t_2) {
24017 
24018     /* "yt/utilities/lib/geometry_utils.pxd":85
24019  *            dim = j
24020  *     if p[dim] < q[dim]:
24021  *         out = 1             # <<<<<<<<<<<<<<
24022  *     else:
24023  *         out = 0
24024  */
24025     __pyx_v_out = 1;
24026 
24027     /* "yt/utilities/lib/geometry_utils.pxd":84
24028  *            x = y
24029  *            dim = j
24030  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
24031  *         out = 1
24032  *     else:
24033  */
24034     goto __pyx_L6;
24035   }
24036 
24037   /* "yt/utilities/lib/geometry_utils.pxd":87
24038  *         out = 1
24039  *     else:
24040  *         out = 0             # <<<<<<<<<<<<<<
24041  *     return out
24042  *
24043  */
24044   /*else*/ {
24045     __pyx_v_out = 0;
24046   }
24047   __pyx_L6:;
24048 
24049   /* "yt/utilities/lib/geometry_utils.pxd":88
24050  *     else:
24051  *         out = 0
24052  *     return out             # <<<<<<<<<<<<<<
24053  *
24054  * @cython.cdivision(True)
24055  */
24056   __pyx_r = __pyx_v_out;
24057   goto __pyx_L0;
24058 
24059   /* "yt/utilities/lib/geometry_utils.pxd":73
24060  * @cython.boundscheck(False)
24061  * @cython.wraparound(False)
24062  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
24063  *     cdef int j, out, dim
24064  *     cdef np.int64_t x, y
24065  */
24066 
24067   /* function exit code */
24068   __pyx_L0:;
24069   __Pyx_RefNannyFinishContext();
24070   return __pyx_r;
24071 }
24072 
24073 /* "yt/utilities/lib/geometry_utils.pxd":93
24074  * @cython.boundscheck(False)
24075  * @cython.wraparound(False)
24076  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
24077  *     cdef int j
24078  *     cdef np.float64_t d
24079  */
24080 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_q)24081 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_q) {
24082   int __pyx_v_j;
24083   __pyx_t_5numpy_float64_t __pyx_v_d;
24084   __pyx_t_5numpy_float64_t __pyx_r;
24085   __Pyx_RefNannyDeclarations
24086   int __pyx_t_1;
24087   Py_ssize_t __pyx_t_2;
24088   int __pyx_t_3;
24089   Py_ssize_t __pyx_t_4;
24090   __Pyx_RefNannySetupContext("euclidean_distance", 0);
24091 
24092   /* "yt/utilities/lib/geometry_utils.pxd":96
24093  *     cdef int j
24094  *     cdef np.float64_t d
24095  *     d = 0.0             # <<<<<<<<<<<<<<
24096  *     for j in range(3):
24097  *         d+=(p[j]-q[j])**2
24098  */
24099   __pyx_v_d = 0.0;
24100 
24101   /* "yt/utilities/lib/geometry_utils.pxd":97
24102  *     cdef np.float64_t d
24103  *     d = 0.0
24104  *     for j in range(3):             # <<<<<<<<<<<<<<
24105  *         d+=(p[j]-q[j])**2
24106  *     return sqrt(d)
24107  */
24108   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24109     __pyx_v_j = __pyx_t_1;
24110 
24111     /* "yt/utilities/lib/geometry_utils.pxd":98
24112  *     d = 0.0
24113  *     for j in range(3):
24114  *         d+=(p[j]-q[j])**2             # <<<<<<<<<<<<<<
24115  *     return sqrt(d)
24116  *
24117  */
24118     __pyx_t_2 = __pyx_v_j;
24119     __pyx_t_3 = -1;
24120     if (__pyx_t_2 < 0) {
24121       __pyx_t_2 += __pyx_v_p.shape[0];
24122       if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0;
24123     } else if (unlikely(__pyx_t_2 >= __pyx_v_p.shape[0])) __pyx_t_3 = 0;
24124     if (unlikely(__pyx_t_3 != -1)) {
24125       __Pyx_RaiseBufferIndexError(__pyx_t_3);
24126       __PYX_ERR(5, 98, __pyx_L1_error)
24127     }
24128     __pyx_t_4 = __pyx_v_j;
24129     __pyx_t_3 = -1;
24130     if (__pyx_t_4 < 0) {
24131       __pyx_t_4 += __pyx_v_q.shape[0];
24132       if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
24133     } else if (unlikely(__pyx_t_4 >= __pyx_v_q.shape[0])) __pyx_t_3 = 0;
24134     if (unlikely(__pyx_t_3 != -1)) {
24135       __Pyx_RaiseBufferIndexError(__pyx_t_3);
24136       __PYX_ERR(5, 98, __pyx_L1_error)
24137     }
24138     __pyx_v_d = (__pyx_v_d + pow(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_p.data + __pyx_t_2 * __pyx_v_p.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_4 * __pyx_v_q.strides[0]) )))), 2.0));
24139   }
24140 
24141   /* "yt/utilities/lib/geometry_utils.pxd":99
24142  *     for j in range(3):
24143  *         d+=(p[j]-q[j])**2
24144  *     return sqrt(d)             # <<<<<<<<<<<<<<
24145  *
24146  * # Todo: allow radius reported independently in each dimension for rectangular domain
24147  */
24148   __pyx_r = sqrt(__pyx_v_d);
24149   goto __pyx_L0;
24150 
24151   /* "yt/utilities/lib/geometry_utils.pxd":93
24152  * @cython.boundscheck(False)
24153  * @cython.wraparound(False)
24154  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
24155  *     cdef int j
24156  *     cdef np.float64_t d
24157  */
24158 
24159   /* function exit code */
24160   __pyx_L1_error:;
24161   __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
24162   __pyx_r = 0;
24163   __pyx_L0:;
24164   __Pyx_RefNannyFinishContext();
24165   return __pyx_r;
24166 }
24167 
24168 /* "yt/utilities/lib/geometry_utils.pxd":105
24169  * @cython.boundscheck(False)
24170  * @cython.wraparound(False)
24171  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
24172  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
24173  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
24174  */
24175 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q,__pyx_t_5numpy_int32_t __pyx_v_order,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_float64_t * __pyx_v_cx,__pyx_t_5numpy_float64_t * __pyx_v_cy,__pyx_t_5numpy_float64_t * __pyx_v_cz)24176 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q, __pyx_t_5numpy_int32_t __pyx_v_order, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_float64_t *__pyx_v_cx, __pyx_t_5numpy_float64_t *__pyx_v_cy, __pyx_t_5numpy_float64_t *__pyx_v_cz) {
24177   int __pyx_v_j;
24178   __pyx_t_5numpy_float64_t __pyx_v_c[3];
24179   __pyx_t_5numpy_uint64_t __pyx_v_pidx[3];
24180   __pyx_t_5numpy_uint64_t __pyx_v_pidx_next[3];
24181   __pyx_t_5numpy_uint64_t __pyx_v_qidx_next[3];
24182   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
24183   __pyx_t_5numpy_float64_t __pyx_v_rad;
24184   int __pyx_v_lvl;
24185   int __pyx_v_done;
24186   __pyx_t_5numpy_float64_t __pyx_r;
24187   __Pyx_RefNannyDeclarations
24188   int __pyx_t_1;
24189   int __pyx_t_2;
24190   __Pyx_RefNannySetupContext("smallest_quadtree_box", 0);
24191 
24192   /* "yt/utilities/lib/geometry_utils.pxd":112
24193  *     cdef np.uint64_t pidx[3]
24194  *     # cdef np.uint64_t qidx[3]
24195  *     for j in range(3):             # <<<<<<<<<<<<<<
24196  *         pidx[j] = 0
24197  *         # qidx[j] = 0
24198  */
24199   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24200     __pyx_v_j = __pyx_t_1;
24201 
24202     /* "yt/utilities/lib/geometry_utils.pxd":113
24203  *     # cdef np.uint64_t qidx[3]
24204  *     for j in range(3):
24205  *         pidx[j] = 0             # <<<<<<<<<<<<<<
24206  *         # qidx[j] = 0
24207  *     cdef np.uint64_t pidx_next[3]
24208  */
24209     (__pyx_v_pidx[__pyx_v_j]) = 0;
24210   }
24211 
24212   /* "yt/utilities/lib/geometry_utils.pxd":119
24213  *     cdef np.float64_t dds[3]
24214  *     cdef np.float64_t rad
24215  *     cdef int lvl = 0             # <<<<<<<<<<<<<<
24216  *     cdef int done = 0
24217  *     while not done:
24218  */
24219   __pyx_v_lvl = 0;
24220 
24221   /* "yt/utilities/lib/geometry_utils.pxd":120
24222  *     cdef np.float64_t rad
24223  *     cdef int lvl = 0
24224  *     cdef int done = 0             # <<<<<<<<<<<<<<
24225  *     while not done:
24226  *         if (lvl+1 >= order):
24227  */
24228   __pyx_v_done = 0;
24229 
24230   /* "yt/utilities/lib/geometry_utils.pxd":121
24231  *     cdef int lvl = 0
24232  *     cdef int done = 0
24233  *     while not done:             # <<<<<<<<<<<<<<
24234  *         if (lvl+1 >= order):
24235  *             done = 1
24236  */
24237   while (1) {
24238     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
24239     if (!__pyx_t_2) break;
24240 
24241     /* "yt/utilities/lib/geometry_utils.pxd":122
24242  *     cdef int done = 0
24243  *     while not done:
24244  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
24245  *             done = 1
24246  *         for j in range(3):
24247  */
24248     __pyx_t_2 = (((__pyx_v_lvl + 1) >= __pyx_v_order) != 0);
24249     if (__pyx_t_2) {
24250 
24251       /* "yt/utilities/lib/geometry_utils.pxd":123
24252  *     while not done:
24253  *         if (lvl+1 >= order):
24254  *             done = 1             # <<<<<<<<<<<<<<
24255  *         for j in range(3):
24256  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
24257  */
24258       __pyx_v_done = 1;
24259 
24260       /* "yt/utilities/lib/geometry_utils.pxd":122
24261  *     cdef int done = 0
24262  *     while not done:
24263  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
24264  *             done = 1
24265  *         for j in range(3):
24266  */
24267     }
24268 
24269     /* "yt/utilities/lib/geometry_utils.pxd":124
24270  *         if (lvl+1 >= order):
24271  *             done = 1
24272  *         for j in range(3):             # <<<<<<<<<<<<<<
24273  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
24274  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
24275  */
24276     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24277       __pyx_v_j = __pyx_t_1;
24278 
24279       /* "yt/utilities/lib/geometry_utils.pxd":125
24280  *             done = 1
24281  *         for j in range(3):
24282  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))             # <<<<<<<<<<<<<<
24283  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
24284  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
24285  */
24286       (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << (((int)__pyx_v_lvl) + 1)));
24287 
24288       /* "yt/utilities/lib/geometry_utils.pxd":126
24289  *         for j in range(3):
24290  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
24291  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
24292  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
24293  *         for j in range(3):
24294  */
24295       (__pyx_v_pidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_p[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
24296 
24297       /* "yt/utilities/lib/geometry_utils.pxd":127
24298  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
24299  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
24300  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
24301  *         for j in range(3):
24302  *             if pidx_next[j]!=qidx_next[j]:
24303  */
24304       (__pyx_v_qidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_q[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
24305     }
24306 
24307     /* "yt/utilities/lib/geometry_utils.pxd":128
24308  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
24309  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
24310  *         for j in range(3):             # <<<<<<<<<<<<<<
24311  *             if pidx_next[j]!=qidx_next[j]:
24312  *                 done = 1
24313  */
24314     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24315       __pyx_v_j = __pyx_t_1;
24316 
24317       /* "yt/utilities/lib/geometry_utils.pxd":129
24318  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
24319  *         for j in range(3):
24320  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
24321  *                 done = 1
24322  *                 break
24323  */
24324       __pyx_t_2 = (((__pyx_v_pidx_next[__pyx_v_j]) != (__pyx_v_qidx_next[__pyx_v_j])) != 0);
24325       if (__pyx_t_2) {
24326 
24327         /* "yt/utilities/lib/geometry_utils.pxd":130
24328  *         for j in range(3):
24329  *             if pidx_next[j]!=qidx_next[j]:
24330  *                 done = 1             # <<<<<<<<<<<<<<
24331  *                 break
24332  *         if not done:
24333  */
24334         __pyx_v_done = 1;
24335 
24336         /* "yt/utilities/lib/geometry_utils.pxd":131
24337  *             if pidx_next[j]!=qidx_next[j]:
24338  *                 done = 1
24339  *                 break             # <<<<<<<<<<<<<<
24340  *         if not done:
24341  *             for j in range(3):
24342  */
24343         goto __pyx_L11_break;
24344 
24345         /* "yt/utilities/lib/geometry_utils.pxd":129
24346  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
24347  *         for j in range(3):
24348  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
24349  *                 done = 1
24350  *                 break
24351  */
24352       }
24353     }
24354     __pyx_L11_break:;
24355 
24356     /* "yt/utilities/lib/geometry_utils.pxd":132
24357  *                 done = 1
24358  *                 break
24359  *         if not done:             # <<<<<<<<<<<<<<
24360  *             for j in range(3):
24361  *                 pidx[j] = pidx_next[j]
24362  */
24363     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
24364     if (__pyx_t_2) {
24365 
24366       /* "yt/utilities/lib/geometry_utils.pxd":133
24367  *                 break
24368  *         if not done:
24369  *             for j in range(3):             # <<<<<<<<<<<<<<
24370  *                 pidx[j] = pidx_next[j]
24371  *                 # qidx[j] = qidx_next[j]
24372  */
24373       for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24374         __pyx_v_j = __pyx_t_1;
24375 
24376         /* "yt/utilities/lib/geometry_utils.pxd":134
24377  *         if not done:
24378  *             for j in range(3):
24379  *                 pidx[j] = pidx_next[j]             # <<<<<<<<<<<<<<
24380  *                 # qidx[j] = qidx_next[j]
24381  *             lvl+=1
24382  */
24383         (__pyx_v_pidx[__pyx_v_j]) = (__pyx_v_pidx_next[__pyx_v_j]);
24384       }
24385 
24386       /* "yt/utilities/lib/geometry_utils.pxd":136
24387  *                 pidx[j] = pidx_next[j]
24388  *                 # qidx[j] = qidx_next[j]
24389  *             lvl+=1             # <<<<<<<<<<<<<<
24390  *     rad = 0.0
24391  *     for j in range(3):
24392  */
24393       __pyx_v_lvl = (__pyx_v_lvl + 1);
24394 
24395       /* "yt/utilities/lib/geometry_utils.pxd":132
24396  *                 done = 1
24397  *                 break
24398  *         if not done:             # <<<<<<<<<<<<<<
24399  *             for j in range(3):
24400  *                 pidx[j] = pidx_next[j]
24401  */
24402     }
24403   }
24404 
24405   /* "yt/utilities/lib/geometry_utils.pxd":137
24406  *                 # qidx[j] = qidx_next[j]
24407  *             lvl+=1
24408  *     rad = 0.0             # <<<<<<<<<<<<<<
24409  *     for j in range(3):
24410  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
24411  */
24412   __pyx_v_rad = 0.0;
24413 
24414   /* "yt/utilities/lib/geometry_utils.pxd":138
24415  *             lvl+=1
24416  *     rad = 0.0
24417  *     for j in range(3):             # <<<<<<<<<<<<<<
24418  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
24419  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
24420  */
24421   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
24422     __pyx_v_j = __pyx_t_1;
24423 
24424     /* "yt/utilities/lib/geometry_utils.pxd":139
24425  *     rad = 0.0
24426  *     for j in range(3):
24427  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)             # <<<<<<<<<<<<<<
24428  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
24429  *         rad+=((dds[j]/2.0)**2)
24430  */
24431     (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << __pyx_v_lvl));
24432 
24433     /* "yt/utilities/lib/geometry_utils.pxd":140
24434  *     for j in range(3):
24435  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
24436  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)             # <<<<<<<<<<<<<<
24437  *         rad+=((dds[j]/2.0)**2)
24438  *     cx[0] = c[0]
24439  */
24440     (__pyx_v_c[__pyx_v_j]) = ((__pyx_v_dds[__pyx_v_j]) * (((__pyx_t_5numpy_float64_t)(__pyx_v_pidx[__pyx_v_j])) + 0.5));
24441 
24442     /* "yt/utilities/lib/geometry_utils.pxd":141
24443  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
24444  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
24445  *         rad+=((dds[j]/2.0)**2)             # <<<<<<<<<<<<<<
24446  *     cx[0] = c[0]
24447  *     cy[0] = c[1]
24448  */
24449     __pyx_v_rad = (__pyx_v_rad + pow(((__pyx_v_dds[__pyx_v_j]) / 2.0), 2.0));
24450   }
24451 
24452   /* "yt/utilities/lib/geometry_utils.pxd":142
24453  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
24454  *         rad+=((dds[j]/2.0)**2)
24455  *     cx[0] = c[0]             # <<<<<<<<<<<<<<
24456  *     cy[0] = c[1]
24457  *     cz[0] = c[2]
24458  */
24459   (__pyx_v_cx[0]) = (__pyx_v_c[0]);
24460 
24461   /* "yt/utilities/lib/geometry_utils.pxd":143
24462  *         rad+=((dds[j]/2.0)**2)
24463  *     cx[0] = c[0]
24464  *     cy[0] = c[1]             # <<<<<<<<<<<<<<
24465  *     cz[0] = c[2]
24466  *     return sqrt(rad)
24467  */
24468   (__pyx_v_cy[0]) = (__pyx_v_c[1]);
24469 
24470   /* "yt/utilities/lib/geometry_utils.pxd":144
24471  *     cx[0] = c[0]
24472  *     cy[0] = c[1]
24473  *     cz[0] = c[2]             # <<<<<<<<<<<<<<
24474  *     return sqrt(rad)
24475  *
24476  */
24477   (__pyx_v_cz[0]) = (__pyx_v_c[2]);
24478 
24479   /* "yt/utilities/lib/geometry_utils.pxd":145
24480  *     cy[0] = c[1]
24481  *     cz[0] = c[2]
24482  *     return sqrt(rad)             # <<<<<<<<<<<<<<
24483  *
24484  * #-----------------------------------------------------------------------------
24485  */
24486   __pyx_r = sqrt(__pyx_v_rad);
24487   goto __pyx_L0;
24488 
24489   /* "yt/utilities/lib/geometry_utils.pxd":105
24490  * @cython.boundscheck(False)
24491  * @cython.wraparound(False)
24492  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
24493  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
24494  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
24495  */
24496 
24497   /* function exit code */
24498   __pyx_L0:;
24499   __Pyx_RefNannyFinishContext();
24500   return __pyx_r;
24501 }
24502 
24503 /* "yt/utilities/lib/geometry_utils.pxd":152
24504  * @cython.boundscheck(False)
24505  * @cython.wraparound(False)
24506  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
24507  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
24508  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
24509  */
24510 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x)24511 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x) {
24512   __pyx_t_5numpy_uint64_t __pyx_r;
24513   __Pyx_RefNannyDeclarations
24514   __Pyx_RefNannySetupContext("spread_64bits_by3", 0);
24515 
24516   /* "yt/utilities/lib/geometry_utils.pxd":153
24517  * @cython.wraparound(False)
24518  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
24519  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
24520  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
24521  *
24522  */
24523   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
24524 
24525   /* "yt/utilities/lib/geometry_utils.pxd":154
24526  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
24527  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
24528  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
24529  *
24530  * #-----------------------------------------------------------------------------
24531  */
24532   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) * ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
24533 
24534   /* "yt/utilities/lib/geometry_utils.pxd":152
24535  * @cython.boundscheck(False)
24536  * @cython.wraparound(False)
24537  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
24538  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
24539  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
24540  */
24541 
24542   /* function exit code */
24543   __pyx_r = 0;
24544   __Pyx_RefNannyFinishContext();
24545   return __pyx_r;
24546 }
24547 
24548 /* "yt/utilities/lib/geometry_utils.pxd":161
24549  * @cython.boundscheck(False)
24550  * @cython.wraparound(False)
24551  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
24552  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
24553  *     # Only reversible up to 2097151
24554  */
24555 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)24556 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
24557   __pyx_t_5numpy_uint64_t __pyx_r;
24558   __Pyx_RefNannyDeclarations
24559   __Pyx_RefNannySetupContext("spread_64bits_by2", 0);
24560 
24561   /* "yt/utilities/lib/geometry_utils.pxd":166
24562  *     # Select highest 21 bits (Required to be reversible to 21st bit)
24563  *     # x = ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---k jihg fedc ba98 7654 3210
24564  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
24565  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
24566  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
24567  */
24568   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
24569 
24570   /* "yt/utilities/lib/geometry_utils.pxd":168
24571  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
24572  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
24573  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
24574  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
24575  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
24576  */
24577   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
24578 
24579   /* "yt/utilities/lib/geometry_utils.pxd":170
24580  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
24581  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
24582  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
24583  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
24584  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
24585  */
24586   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 10)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
24587 
24588   /* "yt/utilities/lib/geometry_utils.pxd":172
24589  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
24590  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
24591  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
24592  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
24593  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
24594  */
24595   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
24596 
24597   /* "yt/utilities/lib/geometry_utils.pxd":174
24598  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
24599  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
24600  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
24601  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24602  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
24603  */
24604   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
24605 
24606   /* "yt/utilities/lib/geometry_utils.pxd":176
24607  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
24608  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24609  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
24610  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24611  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
24612  */
24613   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
24614 
24615   /* "yt/utilities/lib/geometry_utils.pxd":178
24616  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
24617  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24618  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
24619  *     return x
24620  *
24621  */
24622   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
24623 
24624   /* "yt/utilities/lib/geometry_utils.pxd":179
24625  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24626  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
24627  *     return x             # <<<<<<<<<<<<<<
24628  *
24629  * @cython.cdivision(True)
24630  */
24631   __pyx_r = __pyx_v_x;
24632   goto __pyx_L0;
24633 
24634   /* "yt/utilities/lib/geometry_utils.pxd":161
24635  * @cython.boundscheck(False)
24636  * @cython.wraparound(False)
24637  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
24638  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
24639  *     # Only reversible up to 2097151
24640  */
24641 
24642   /* function exit code */
24643   __pyx_L0:;
24644   __Pyx_RefNannyFinishContext();
24645   return __pyx_r;
24646 }
24647 
24648 /* "yt/utilities/lib/geometry_utils.pxd":184
24649  * @cython.boundscheck(False)
24650  * @cython.wraparound(False)
24651  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
24652  *     # Reversed magic
24653  *     x=x&(<np.uint64_t>0x1249249249249249)
24654  */
24655 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)24656 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
24657   __pyx_t_5numpy_uint64_t __pyx_r;
24658   __Pyx_RefNannyDeclarations
24659   __Pyx_RefNannySetupContext("compact_64bits_by2", 0);
24660 
24661   /* "yt/utilities/lib/geometry_utils.pxd":186
24662  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):
24663  *     # Reversed magic
24664  *     x=x&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
24665  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
24666  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
24667  */
24668   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
24669 
24670   /* "yt/utilities/lib/geometry_utils.pxd":187
24671  *     # Reversed magic
24672  *     x=x&(<np.uint64_t>0x1249249249249249)
24673  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
24674  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
24675  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
24676  */
24677   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
24678 
24679   /* "yt/utilities/lib/geometry_utils.pxd":188
24680  *     x=x&(<np.uint64_t>0x1249249249249249)
24681  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
24682  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
24683  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
24684  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
24685  */
24686   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
24687 
24688   /* "yt/utilities/lib/geometry_utils.pxd":189
24689  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
24690  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
24691  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
24692  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
24693  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
24694  */
24695   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
24696 
24697   /* "yt/utilities/lib/geometry_utils.pxd":190
24698  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
24699  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
24700  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
24701  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
24702  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
24703  */
24704   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
24705 
24706   /* "yt/utilities/lib/geometry_utils.pxd":191
24707  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
24708  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
24709  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
24710  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
24711  *     return x
24712  */
24713   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 10)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
24714 
24715   /* "yt/utilities/lib/geometry_utils.pxd":192
24716  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
24717  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
24718  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)             # <<<<<<<<<<<<<<
24719  *     return x
24720  *
24721  */
24722   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 20)) & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
24723 
24724   /* "yt/utilities/lib/geometry_utils.pxd":193
24725  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
24726  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
24727  *     return x             # <<<<<<<<<<<<<<
24728  *
24729  * #-----------------------------------------------------------------------------
24730  */
24731   __pyx_r = __pyx_v_x;
24732   goto __pyx_L0;
24733 
24734   /* "yt/utilities/lib/geometry_utils.pxd":184
24735  * @cython.boundscheck(False)
24736  * @cython.wraparound(False)
24737  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
24738  *     # Reversed magic
24739  *     x=x&(<np.uint64_t>0x1249249249249249)
24740  */
24741 
24742   /* function exit code */
24743   __pyx_L0:;
24744   __Pyx_RefNannyFinishContext();
24745   return __pyx_r;
24746 }
24747 
24748 /* "yt/utilities/lib/geometry_utils.pxd":200
24749  * @cython.boundscheck(False)
24750  * @cython.wraparound(False)
24751  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
24752  *     # Only reversible up to 1023
24753  *     # Select highest 10 bits (Required to be reversible to 10st bit)
24754  */
24755 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)24756 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
24757   __pyx_t_5numpy_uint32_t __pyx_r;
24758   __Pyx_RefNannyDeclarations
24759   __Pyx_RefNannySetupContext("spread_32bits_by2", 0);
24760 
24761   /* "yt/utilities/lib/geometry_utils.pxd":204
24762  *     # Select highest 10 bits (Required to be reversible to 10st bit)
24763  *     # x = ---- ---- ---- ---- ---- --98 7654 3210
24764  *     x=(x&(<np.uint32_t>0x000003FF))             # <<<<<<<<<<<<<<
24765  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
24766  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
24767  */
24768   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x000003FF));
24769 
24770   /* "yt/utilities/lib/geometry_utils.pxd":206
24771  *     x=(x&(<np.uint32_t>0x000003FF))
24772  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
24773  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
24774  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
24775  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
24776  */
24777   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 16)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
24778 
24779   /* "yt/utilities/lib/geometry_utils.pxd":208
24780  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
24781  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
24782  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
24783  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
24784  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
24785  */
24786   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 8)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
24787 
24788   /* "yt/utilities/lib/geometry_utils.pxd":210
24789  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
24790  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
24791  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
24792  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24793  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
24794  */
24795   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
24796 
24797   /* "yt/utilities/lib/geometry_utils.pxd":212
24798  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
24799  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24800  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
24801  *     return x
24802  *
24803  */
24804   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint32_t)0x09249249));
24805 
24806   /* "yt/utilities/lib/geometry_utils.pxd":213
24807  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
24808  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
24809  *     return x             # <<<<<<<<<<<<<<
24810  *
24811  * @cython.cdivision(True)
24812  */
24813   __pyx_r = __pyx_v_x;
24814   goto __pyx_L0;
24815 
24816   /* "yt/utilities/lib/geometry_utils.pxd":200
24817  * @cython.boundscheck(False)
24818  * @cython.wraparound(False)
24819  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
24820  *     # Only reversible up to 1023
24821  *     # Select highest 10 bits (Required to be reversible to 10st bit)
24822  */
24823 
24824   /* function exit code */
24825   __pyx_L0:;
24826   __Pyx_RefNannyFinishContext();
24827   return __pyx_r;
24828 }
24829 
24830 /* "yt/utilities/lib/geometry_utils.pxd":218
24831  * @cython.boundscheck(False)
24832  * @cython.wraparound(False)
24833  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
24834  *     # Reversed magic
24835  *     x=x&(<np.uint32_t>0x09249249)
24836  */
24837 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)24838 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
24839   __pyx_t_5numpy_uint32_t __pyx_r;
24840   __Pyx_RefNannyDeclarations
24841   __Pyx_RefNannySetupContext("compact_32bits_by2", 0);
24842 
24843   /* "yt/utilities/lib/geometry_utils.pxd":220
24844  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):
24845  *     # Reversed magic
24846  *     x=x&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
24847  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
24848  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
24849  */
24850   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x09249249));
24851 
24852   /* "yt/utilities/lib/geometry_utils.pxd":221
24853  *     # Reversed magic
24854  *     x=x&(<np.uint32_t>0x09249249)
24855  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
24856  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
24857  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
24858  */
24859   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
24860 
24861   /* "yt/utilities/lib/geometry_utils.pxd":222
24862  *     x=x&(<np.uint32_t>0x09249249)
24863  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
24864  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
24865  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
24866  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
24867  */
24868   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
24869 
24870   /* "yt/utilities/lib/geometry_utils.pxd":223
24871  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
24872  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
24873  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
24874  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
24875  *     return x
24876  */
24877   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 8)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
24878 
24879   /* "yt/utilities/lib/geometry_utils.pxd":224
24880  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
24881  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
24882  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)             # <<<<<<<<<<<<<<
24883  *     return x
24884  *
24885  */
24886   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 16)) & ((__pyx_t_5numpy_uint32_t)0x000003FF));
24887 
24888   /* "yt/utilities/lib/geometry_utils.pxd":225
24889  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
24890  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
24891  *     return x             # <<<<<<<<<<<<<<
24892  *
24893  * @cython.cdivision(True)
24894  */
24895   __pyx_r = __pyx_v_x;
24896   goto __pyx_L0;
24897 
24898   /* "yt/utilities/lib/geometry_utils.pxd":218
24899  * @cython.boundscheck(False)
24900  * @cython.wraparound(False)
24901  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
24902  *     # Reversed magic
24903  *     x=x&(<np.uint32_t>0x09249249)
24904  */
24905 
24906   /* function exit code */
24907   __pyx_L0:;
24908   __Pyx_RefNannyFinishContext();
24909   return __pyx_r;
24910 }
24911 
24912 /* "yt/utilities/lib/geometry_utils.pxd":230
24913  * @cython.boundscheck(False)
24914  * @cython.wraparound(False)
24915  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
24916  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
24917  *     return a ^ ((a ^ b) & mask)
24918  */
24919 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a,__pyx_t_5numpy_uint64_t __pyx_v_b,__pyx_t_5numpy_uint64_t __pyx_v_mask)24920 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a, __pyx_t_5numpy_uint64_t __pyx_v_b, __pyx_t_5numpy_uint64_t __pyx_v_mask) {
24921   __pyx_t_5numpy_uint64_t __pyx_r;
24922   __Pyx_RefNannyDeclarations
24923   __Pyx_RefNannySetupContext("masked_merge_64bit", 0);
24924 
24925   /* "yt/utilities/lib/geometry_utils.pxd":232
24926  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):
24927  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
24928  *     return a ^ ((a ^ b) & mask)             # <<<<<<<<<<<<<<
24929  *
24930  * @cython.cdivision(True)
24931  */
24932   __pyx_r = (__pyx_v_a ^ ((__pyx_v_a ^ __pyx_v_b) & __pyx_v_mask));
24933   goto __pyx_L0;
24934 
24935   /* "yt/utilities/lib/geometry_utils.pxd":230
24936  * @cython.boundscheck(False)
24937  * @cython.wraparound(False)
24938  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
24939  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
24940  *     return a ^ ((a ^ b) & mask)
24941  */
24942 
24943   /* function exit code */
24944   __pyx_L0:;
24945   __Pyx_RefNannyFinishContext();
24946   return __pyx_r;
24947 }
24948 
24949 /* "yt/utilities/lib/geometry_utils.pxd":235
24950  *
24951  * @cython.cdivision(True)
24952  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
24953  *     cdef np.uint64_t mi
24954  *     mi = 0
24955  */
24956 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind,__pyx_t_5numpy_uint64_t __pyx_v_y_ind,__pyx_t_5numpy_uint64_t __pyx_v_z_ind)24957 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind, __pyx_t_5numpy_uint64_t __pyx_v_y_ind, __pyx_t_5numpy_uint64_t __pyx_v_z_ind) {
24958   __pyx_t_5numpy_uint64_t __pyx_v_mi;
24959   __pyx_t_5numpy_uint64_t __pyx_r;
24960   __Pyx_RefNannyDeclarations
24961   __Pyx_RefNannySetupContext("encode_morton_64bit", 0);
24962 
24963   /* "yt/utilities/lib/geometry_utils.pxd":237
24964  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):
24965  *     cdef np.uint64_t mi
24966  *     mi = 0             # <<<<<<<<<<<<<<
24967  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
24968  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
24969  */
24970   __pyx_v_mi = 0;
24971 
24972   /* "yt/utilities/lib/geometry_utils.pxd":238
24973  *     cdef np.uint64_t mi
24974  *     mi = 0
24975  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT             # <<<<<<<<<<<<<<
24976  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
24977  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
24978  */
24979   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_z_ind) << 0));
24980 
24981   /* "yt/utilities/lib/geometry_utils.pxd":239
24982  *     mi = 0
24983  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
24984  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT             # <<<<<<<<<<<<<<
24985  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
24986  *     return mi
24987  */
24988   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_y_ind) << 1));
24989 
24990   /* "yt/utilities/lib/geometry_utils.pxd":240
24991  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
24992  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
24993  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT             # <<<<<<<<<<<<<<
24994  *     return mi
24995  *
24996  */
24997   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_x_ind) << 2));
24998 
24999   /* "yt/utilities/lib/geometry_utils.pxd":241
25000  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
25001  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
25002  *     return mi             # <<<<<<<<<<<<<<
25003  *
25004  * @cython.cdivision(True)
25005  */
25006   __pyx_r = __pyx_v_mi;
25007   goto __pyx_L0;
25008 
25009   /* "yt/utilities/lib/geometry_utils.pxd":235
25010  *
25011  * @cython.cdivision(True)
25012  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
25013  *     cdef np.uint64_t mi
25014  *     mi = 0
25015  */
25016 
25017   /* function exit code */
25018   __pyx_L0:;
25019   __Pyx_RefNannyFinishContext();
25020   return __pyx_r;
25021 }
25022 
25023 /* "yt/utilities/lib/geometry_utils.pxd":244
25024  *
25025  * @cython.cdivision(True)
25026  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
25027  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
25028  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
25029  */
25030 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi,__pyx_t_5numpy_uint64_t * __pyx_v_p)25031 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
25032   __Pyx_RefNannyDeclarations
25033   __Pyx_RefNannySetupContext("decode_morton_64bit", 0);
25034 
25035   /* "yt/utilities/lib/geometry_utils.pxd":245
25036  * @cython.cdivision(True)
25037  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
25038  *     p[0] = compact_64bits_by2(mi>>XSHIFT)             # <<<<<<<<<<<<<<
25039  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
25040  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
25041  */
25042   (__pyx_v_p[0]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 2));
25043 
25044   /* "yt/utilities/lib/geometry_utils.pxd":246
25045  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
25046  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
25047  *     p[1] = compact_64bits_by2(mi>>YSHIFT)             # <<<<<<<<<<<<<<
25048  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
25049  *
25050  */
25051   (__pyx_v_p[1]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 1));
25052 
25053   /* "yt/utilities/lib/geometry_utils.pxd":247
25054  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
25055  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
25056  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)             # <<<<<<<<<<<<<<
25057  *
25058  * @cython.cdivision(True)
25059  */
25060   (__pyx_v_p[2]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 0));
25061 
25062   /* "yt/utilities/lib/geometry_utils.pxd":244
25063  *
25064  * @cython.cdivision(True)
25065  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
25066  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
25067  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
25068  */
25069 
25070   /* function exit code */
25071   __Pyx_RefNannyFinishContext();
25072 }
25073 
25074 /* "yt/utilities/lib/geometry_utils.pxd":250
25075  *
25076  * @cython.cdivision(True)
25077  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25078  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
25079  *     cdef int i
25080  */
25081 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order)25082 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order) {
25083   int __pyx_v_i;
25084   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
25085   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
25086   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
25087   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
25088   __pyx_t_5numpy_uint64_t __pyx_v_mi;
25089   __pyx_t_5numpy_uint64_t __pyx_r;
25090   __Pyx_RefNannyDeclarations
25091   int __pyx_t_1;
25092   __Pyx_RefNannySetupContext("bounded_morton", 0);
25093 
25094   /* "yt/utilities/lib/geometry_utils.pxd":256
25095  *     cdef np.uint64_t x_ind, y_ind, z_ind
25096  *     cdef np.uint64_t mi
25097  *     for i in range(3):             # <<<<<<<<<<<<<<
25098  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
25099  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25100  */
25101   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
25102     __pyx_v_i = __pyx_t_1;
25103 
25104     /* "yt/utilities/lib/geometry_utils.pxd":257
25105  *     cdef np.uint64_t mi
25106  *     for i in range(3):
25107  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)             # <<<<<<<<<<<<<<
25108  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25109  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25110  */
25111     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order));
25112   }
25113 
25114   /* "yt/utilities/lib/geometry_utils.pxd":258
25115  *     for i in range(3):
25116  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
25117  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
25118  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25119  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25120  */
25121   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
25122 
25123   /* "yt/utilities/lib/geometry_utils.pxd":259
25124  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
25125  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25126  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
25127  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25128  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25129  */
25130   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
25131 
25132   /* "yt/utilities/lib/geometry_utils.pxd":260
25133  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25134  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25135  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
25136  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25137  *     return mi
25138  */
25139   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
25140 
25141   /* "yt/utilities/lib/geometry_utils.pxd":261
25142  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25143  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25144  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
25145  *     return mi
25146  *
25147  */
25148   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
25149 
25150   /* "yt/utilities/lib/geometry_utils.pxd":262
25151  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25152  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25153  *     return mi             # <<<<<<<<<<<<<<
25154  *
25155  * @cython.cdivision(True)
25156  */
25157   __pyx_r = __pyx_v_mi;
25158   goto __pyx_L0;
25159 
25160   /* "yt/utilities/lib/geometry_utils.pxd":250
25161  *
25162  * @cython.cdivision(True)
25163  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25164  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
25165  *     cdef int i
25166  */
25167 
25168   /* function exit code */
25169   __pyx_L0:;
25170   __Pyx_RefNannyFinishContext();
25171   return __pyx_r;
25172 }
25173 
25174 /* "yt/utilities/lib/geometry_utils.pxd":265
25175  *
25176  * @cython.cdivision(True)
25177  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25178  *                                np.float64_t *DLE, np.float64_t *DRE,
25179  *                                np.int32_t order1, np.int32_t order2):
25180  */
25181 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order1,__pyx_t_5numpy_int32_t __pyx_v_order2)25182 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order1, __pyx_t_5numpy_int32_t __pyx_v_order2) {
25183   int __pyx_v_i;
25184   __pyx_t_5numpy_float64_t __pyx_v_dds1[3];
25185   __pyx_t_5numpy_float64_t __pyx_v_dds2[3];
25186   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
25187   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
25188   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
25189   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
25190   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
25191   __pyx_t_5numpy_uint64_t __pyx_r;
25192   __Pyx_RefNannyDeclarations
25193   int __pyx_t_1;
25194   __Pyx_RefNannySetupContext("bounded_morton_relative", 0);
25195 
25196   /* "yt/utilities/lib/geometry_utils.pxd":274
25197  *     cdef np.uint64_t x_ind, y_ind, z_ind
25198  *     cdef np.uint64_t mi2
25199  *     for i in range(3):             # <<<<<<<<<<<<<<
25200  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
25201  *         dds2[i] = dds1[i] / (1 << order2)
25202  */
25203   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
25204     __pyx_v_i = __pyx_t_1;
25205 
25206     /* "yt/utilities/lib/geometry_utils.pxd":275
25207  *     cdef np.uint64_t mi2
25208  *     for i in range(3):
25209  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)             # <<<<<<<<<<<<<<
25210  *         dds2[i] = dds1[i] / (1 << order2)
25211  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25212  */
25213     (__pyx_v_dds1[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order1));
25214 
25215     /* "yt/utilities/lib/geometry_utils.pxd":276
25216  *     for i in range(3):
25217  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
25218  *         dds2[i] = dds1[i] / (1 << order2)             # <<<<<<<<<<<<<<
25219  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25220  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25221  */
25222     (__pyx_v_dds2[__pyx_v_i]) = ((__pyx_v_dds1[__pyx_v_i]) / (1 << __pyx_v_order2));
25223   }
25224 
25225   /* "yt/utilities/lib/geometry_utils.pxd":277
25226  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
25227  *         dds2[i] = dds1[i] / (1 << order2)
25228  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
25229  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25230  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25231  */
25232   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
25233 
25234   /* "yt/utilities/lib/geometry_utils.pxd":278
25235  *         dds2[i] = dds1[i] / (1 << order2)
25236  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25237  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
25238  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25239  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25240  */
25241   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
25242 
25243   /* "yt/utilities/lib/geometry_utils.pxd":279
25244  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25245  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25246  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
25247  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25248  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25249  */
25250   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
25251 
25252   /* "yt/utilities/lib/geometry_utils.pxd":280
25253  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25254  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25255  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
25256  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25257  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25258  */
25259   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
25260 
25261   /* "yt/utilities/lib/geometry_utils.pxd":281
25262  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25263  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25264  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
25265  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25266  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25267  */
25268   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
25269 
25270   /* "yt/utilities/lib/geometry_utils.pxd":282
25271  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25272  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25273  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
25274  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25275  *     return mi2
25276  */
25277   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
25278 
25279   /* "yt/utilities/lib/geometry_utils.pxd":283
25280  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25281  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25282  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
25283  *     return mi2
25284  *
25285  */
25286   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
25287 
25288   /* "yt/utilities/lib/geometry_utils.pxd":284
25289  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25290  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25291  *     return mi2             # <<<<<<<<<<<<<<
25292  *
25293  *
25294  */
25295   __pyx_r = __pyx_v_mi2;
25296   goto __pyx_L0;
25297 
25298   /* "yt/utilities/lib/geometry_utils.pxd":265
25299  *
25300  * @cython.cdivision(True)
25301  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25302  *                                np.float64_t *DLE, np.float64_t *DRE,
25303  *                                np.int32_t order1, np.int32_t order2):
25304  */
25305 
25306   /* function exit code */
25307   __pyx_L0:;
25308   __Pyx_RefNannyFinishContext();
25309   return __pyx_r;
25310 }
25311 
25312 /* "yt/utilities/lib/geometry_utils.pxd":289
25313  * # This dosn't seem to be much, if at all, faster...
25314  * @cython.cdivision(True)
25315  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25316  *                                np.float64_t *DLE, np.float64_t *dds):
25317  *     cdef np.uint64_t x_ind, y_ind, z_ind
25318  */
25319 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds)25320 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds) {
25321   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
25322   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
25323   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
25324   __pyx_t_5numpy_uint64_t __pyx_v_mi;
25325   __pyx_t_5numpy_uint64_t __pyx_r;
25326   __Pyx_RefNannyDeclarations
25327   __Pyx_RefNannySetupContext("bounded_morton_dds", 0);
25328 
25329   /* "yt/utilities/lib/geometry_utils.pxd":293
25330  *     cdef np.uint64_t x_ind, y_ind, z_ind
25331  *     cdef np.uint64_t mi
25332  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
25333  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25334  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25335  */
25336   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
25337 
25338   /* "yt/utilities/lib/geometry_utils.pxd":294
25339  *     cdef np.uint64_t mi
25340  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25341  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
25342  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25343  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25344  */
25345   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
25346 
25347   /* "yt/utilities/lib/geometry_utils.pxd":295
25348  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
25349  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25350  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
25351  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25352  *     return mi
25353  */
25354   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
25355 
25356   /* "yt/utilities/lib/geometry_utils.pxd":296
25357  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
25358  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25359  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
25360  *     return mi
25361  *
25362  */
25363   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
25364 
25365   /* "yt/utilities/lib/geometry_utils.pxd":297
25366  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
25367  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
25368  *     return mi             # <<<<<<<<<<<<<<
25369  *
25370  * @cython.cdivision(True)
25371  */
25372   __pyx_r = __pyx_v_mi;
25373   goto __pyx_L0;
25374 
25375   /* "yt/utilities/lib/geometry_utils.pxd":289
25376  * # This dosn't seem to be much, if at all, faster...
25377  * @cython.cdivision(True)
25378  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25379  *                                np.float64_t *DLE, np.float64_t *dds):
25380  *     cdef np.uint64_t x_ind, y_ind, z_ind
25381  */
25382 
25383   /* function exit code */
25384   __pyx_L0:;
25385   __Pyx_RefNannyFinishContext();
25386   return __pyx_r;
25387 }
25388 
25389 /* "yt/utilities/lib/geometry_utils.pxd":300
25390  *
25391  * @cython.cdivision(True)
25392  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25393  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
25394  *     cdef np.float64_t DLE2[3]
25395  */
25396 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2)25397 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2) {
25398   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
25399   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
25400   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
25401   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
25402   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
25403   __pyx_t_5numpy_uint64_t __pyx_r;
25404   __Pyx_RefNannyDeclarations
25405   __Pyx_RefNannySetupContext("bounded_morton_relative_dds", 0);
25406 
25407   /* "yt/utilities/lib/geometry_utils.pxd":305
25408  *     cdef np.uint64_t x_ind, y_ind, z_ind
25409  *     cdef np.uint64_t mi2
25410  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
25411  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25412  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25413  */
25414   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
25415 
25416   /* "yt/utilities/lib/geometry_utils.pxd":306
25417  *     cdef np.uint64_t mi2
25418  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25419  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
25420  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25421  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25422  */
25423   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
25424 
25425   /* "yt/utilities/lib/geometry_utils.pxd":307
25426  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25427  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25428  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
25429  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25430  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25431  */
25432   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
25433 
25434   /* "yt/utilities/lib/geometry_utils.pxd":308
25435  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25436  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25437  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
25438  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25439  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25440  */
25441   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
25442 
25443   /* "yt/utilities/lib/geometry_utils.pxd":309
25444  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25445  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25446  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
25447  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25448  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25449  */
25450   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
25451 
25452   /* "yt/utilities/lib/geometry_utils.pxd":310
25453  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25454  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25455  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
25456  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25457  *     return mi2
25458  */
25459   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
25460 
25461   /* "yt/utilities/lib/geometry_utils.pxd":311
25462  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25463  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25464  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
25465  *     return mi2
25466  *
25467  */
25468   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
25469 
25470   /* "yt/utilities/lib/geometry_utils.pxd":312
25471  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25472  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
25473  *     return mi2             # <<<<<<<<<<<<<<
25474  *
25475  *
25476  */
25477   __pyx_r = __pyx_v_mi2;
25478   goto __pyx_L0;
25479 
25480   /* "yt/utilities/lib/geometry_utils.pxd":300
25481  *
25482  * @cython.cdivision(True)
25483  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25484  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
25485  *     cdef np.float64_t DLE2[3]
25486  */
25487 
25488   /* function exit code */
25489   __pyx_L0:;
25490   __Pyx_RefNannyFinishContext();
25491   return __pyx_r;
25492 }
25493 
25494 /* "yt/utilities/lib/geometry_utils.pxd":316
25495  *
25496  * @cython.cdivision(True)
25497  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25498  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
25499  *     cdef np.uint64_t mi
25500  */
25501 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds,__pyx_t_5numpy_uint64_t * __pyx_v_p)25502 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
25503   __pyx_t_5numpy_uint64_t __pyx_v_mi;
25504   __pyx_t_5numpy_uint64_t __pyx_r;
25505   __Pyx_RefNannyDeclarations
25506   __Pyx_RefNannySetupContext("bounded_morton_split_dds", 0);
25507 
25508   /* "yt/utilities/lib/geometry_utils.pxd":319
25509  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
25510  *     cdef np.uint64_t mi
25511  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
25512  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
25513  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
25514  */
25515   (__pyx_v_p[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
25516 
25517   /* "yt/utilities/lib/geometry_utils.pxd":320
25518  *     cdef np.uint64_t mi
25519  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
25520  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
25521  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
25522  *     mi = encode_morton_64bit(p[0], p[1], p[2])
25523  */
25524   (__pyx_v_p[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
25525 
25526   /* "yt/utilities/lib/geometry_utils.pxd":321
25527  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
25528  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
25529  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
25530  *     mi = encode_morton_64bit(p[0], p[1], p[2])
25531  *     return mi
25532  */
25533   (__pyx_v_p[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
25534 
25535   /* "yt/utilities/lib/geometry_utils.pxd":322
25536  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
25537  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
25538  *     mi = encode_morton_64bit(p[0], p[1], p[2])             # <<<<<<<<<<<<<<
25539  *     return mi
25540  *
25541  */
25542   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p[0]), (__pyx_v_p[1]), (__pyx_v_p[2]));
25543 
25544   /* "yt/utilities/lib/geometry_utils.pxd":323
25545  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
25546  *     mi = encode_morton_64bit(p[0], p[1], p[2])
25547  *     return mi             # <<<<<<<<<<<<<<
25548  *
25549  * @cython.cdivision(True)
25550  */
25551   __pyx_r = __pyx_v_mi;
25552   goto __pyx_L0;
25553 
25554   /* "yt/utilities/lib/geometry_utils.pxd":316
25555  *
25556  * @cython.cdivision(True)
25557  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25558  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
25559  *     cdef np.uint64_t mi
25560  */
25561 
25562   /* function exit code */
25563   __pyx_L0:;
25564   __Pyx_RefNannyFinishContext();
25565   return __pyx_r;
25566 }
25567 
25568 /* "yt/utilities/lib/geometry_utils.pxd":326
25569  *
25570  * @cython.cdivision(True)
25571  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25572  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
25573  *                                np.uint64_t *p2):
25574  */
25575 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2,__pyx_t_5numpy_uint64_t * __pyx_v_p2)25576 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2, __pyx_t_5numpy_uint64_t *__pyx_v_p2) {
25577   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
25578   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
25579   __pyx_t_5numpy_uint64_t __pyx_r;
25580   __Pyx_RefNannyDeclarations
25581   __Pyx_RefNannySetupContext("bounded_morton_split_relative_dds", 0);
25582 
25583   /* "yt/utilities/lib/geometry_utils.pxd":331
25584  *     cdef np.float64_t DLE2[3]
25585  *     cdef np.uint64_t mi2
25586  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
25587  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25588  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25589  */
25590   (__pyx_v_DLE2[0]) = ((__pyx_v_DLE[0]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0])));
25591 
25592   /* "yt/utilities/lib/geometry_utils.pxd":332
25593  *     cdef np.uint64_t mi2
25594  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25595  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
25596  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25597  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25598  */
25599   (__pyx_v_DLE2[1]) = ((__pyx_v_DLE[1]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1])));
25600 
25601   /* "yt/utilities/lib/geometry_utils.pxd":333
25602  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
25603  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25604  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
25605  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25606  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25607  */
25608   (__pyx_v_DLE2[2]) = ((__pyx_v_DLE[2]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2])));
25609 
25610   /* "yt/utilities/lib/geometry_utils.pxd":334
25611  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
25612  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25613  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
25614  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25615  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25616  */
25617   (__pyx_v_p2[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
25618 
25619   /* "yt/utilities/lib/geometry_utils.pxd":335
25620  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
25621  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25622  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
25623  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25624  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
25625  */
25626   (__pyx_v_p2[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
25627 
25628   /* "yt/utilities/lib/geometry_utils.pxd":336
25629  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
25630  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25631  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
25632  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
25633  *     return mi2
25634  */
25635   (__pyx_v_p2[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
25636 
25637   /* "yt/utilities/lib/geometry_utils.pxd":337
25638  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
25639  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25640  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])             # <<<<<<<<<<<<<<
25641  *     return mi2
25642  *
25643  */
25644   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p2[0]), (__pyx_v_p2[1]), (__pyx_v_p2[2]));
25645 
25646   /* "yt/utilities/lib/geometry_utils.pxd":338
25647  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
25648  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
25649  *     return mi2             # <<<<<<<<<<<<<<
25650  *
25651  *
25652  */
25653   __pyx_r = __pyx_v_mi2;
25654   goto __pyx_L0;
25655 
25656   /* "yt/utilities/lib/geometry_utils.pxd":326
25657  *
25658  * @cython.cdivision(True)
25659  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
25660  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
25661  *                                np.uint64_t *p2):
25662  */
25663 
25664   /* function exit code */
25665   __pyx_L0:;
25666   __Pyx_RefNannyFinishContext();
25667   return __pyx_r;
25668 }
25669 
25670 /* "selection_routines.pxd":81
25671  *     cdef public SelectorObject sel2
25672  *
25673  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
25674  *                                         np.float64_t dw, bint periodic) nogil:
25675  *     cdef np.float64_t rel = x1 - x2
25676  */
25677 
__pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1,__pyx_t_5numpy_float64_t __pyx_v_x2,__pyx_t_5numpy_float64_t __pyx_v_dw,int __pyx_v_periodic)25678 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) {
25679   __pyx_t_5numpy_float64_t __pyx_v_rel;
25680   __pyx_t_5numpy_float64_t __pyx_r;
25681   int __pyx_t_1;
25682 
25683   /* "selection_routines.pxd":83
25684  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,
25685  *                                         np.float64_t dw, bint periodic) nogil:
25686  *     cdef np.float64_t rel = x1 - x2             # <<<<<<<<<<<<<<
25687  *     if not periodic: return rel
25688  *     if rel > dw * 0.5:
25689  */
25690   __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2);
25691 
25692   /* "selection_routines.pxd":84
25693  *                                         np.float64_t dw, bint periodic) nogil:
25694  *     cdef np.float64_t rel = x1 - x2
25695  *     if not periodic: return rel             # <<<<<<<<<<<<<<
25696  *     if rel > dw * 0.5:
25697  *         rel -= dw
25698  */
25699   __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0);
25700   if (__pyx_t_1) {
25701     __pyx_r = __pyx_v_rel;
25702     goto __pyx_L0;
25703   }
25704 
25705   /* "selection_routines.pxd":85
25706  *     cdef np.float64_t rel = x1 - x2
25707  *     if not periodic: return rel
25708  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
25709  *         rel -= dw
25710  *     elif rel < -dw * 0.5:
25711  */
25712   __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0);
25713   if (__pyx_t_1) {
25714 
25715     /* "selection_routines.pxd":86
25716  *     if not periodic: return rel
25717  *     if rel > dw * 0.5:
25718  *         rel -= dw             # <<<<<<<<<<<<<<
25719  *     elif rel < -dw * 0.5:
25720  *         rel += dw
25721  */
25722     __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw);
25723 
25724     /* "selection_routines.pxd":85
25725  *     cdef np.float64_t rel = x1 - x2
25726  *     if not periodic: return rel
25727  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
25728  *         rel -= dw
25729  *     elif rel < -dw * 0.5:
25730  */
25731     goto __pyx_L4;
25732   }
25733 
25734   /* "selection_routines.pxd":87
25735  *     if rel > dw * 0.5:
25736  *         rel -= dw
25737  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
25738  *         rel += dw
25739  *     return rel
25740  */
25741   __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0);
25742   if (__pyx_t_1) {
25743 
25744     /* "selection_routines.pxd":88
25745  *         rel -= dw
25746  *     elif rel < -dw * 0.5:
25747  *         rel += dw             # <<<<<<<<<<<<<<
25748  *     return rel
25749  */
25750     __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw);
25751 
25752     /* "selection_routines.pxd":87
25753  *     if rel > dw * 0.5:
25754  *         rel -= dw
25755  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
25756  *         rel += dw
25757  *     return rel
25758  */
25759   }
25760   __pyx_L4:;
25761 
25762   /* "selection_routines.pxd":89
25763  *     elif rel < -dw * 0.5:
25764  *         rel += dw
25765  *     return rel             # <<<<<<<<<<<<<<
25766  */
25767   __pyx_r = __pyx_v_rel;
25768   goto __pyx_L0;
25769 
25770   /* "selection_routines.pxd":81
25771  *     cdef public SelectorObject sel2
25772  *
25773  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
25774  *                                         np.float64_t dw, bint periodic) nogil:
25775  *     cdef np.float64_t rel = x1 - x2
25776  */
25777 
25778   /* function exit code */
25779   __pyx_L0:;
25780   return __pyx_r;
25781 }
25782 
25783 /* "yt/geometry/oct_container.pxd":48
25784  *
25785  * cdef class OctObjectPool(ObjectPool):
25786  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
25787  *         return <OctAllocationContainer*> (&self.containers[i])
25788  *
25789  */
25790 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,int __pyx_v_i)25791 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) {
25792   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r;
25793   __Pyx_RefNannyDeclarations
25794   __Pyx_RefNannySetupContext("get_cont", 0);
25795 
25796   /* "yt/geometry/oct_container.pxd":49
25797  * cdef class OctObjectPool(ObjectPool):
25798  *     cdef inline OctAllocationContainer *get_cont(self, int i):
25799  *         return <OctAllocationContainer*> (&self.containers[i])             # <<<<<<<<<<<<<<
25800  *
25801  * cdef OctList *OctList_append(OctList *list, Oct *o)
25802  */
25803   __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])));
25804   goto __pyx_L0;
25805 
25806   /* "yt/geometry/oct_container.pxd":48
25807  *
25808  * cdef class OctObjectPool(ObjectPool):
25809  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
25810  *         return <OctAllocationContainer*> (&self.containers[i])
25811  *
25812  */
25813 
25814   /* function exit code */
25815   __pyx_L0:;
25816   __Pyx_RefNannyFinishContext();
25817   return __pyx_r;
25818 }
25819 
25820 /* "FromPyStructUtility":11
25821  *
25822  * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded")
25823  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *:             # <<<<<<<<<<<<<<
25824  *     cdef struct_type result
25825  *     if not PyMapping_Check(obj):
25826  */
25827 
__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject * __pyx_v_obj)25828 static struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *__pyx_v_obj) {
25829   struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded __pyx_v_result;
25830   PyObject *__pyx_v_value = NULL;
25831   struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded __pyx_r;
25832   __Pyx_RefNannyDeclarations
25833   int __pyx_t_1;
25834   PyObject *__pyx_t_2 = NULL;
25835   PyObject *__pyx_t_3 = NULL;
25836   PyObject *__pyx_t_4 = NULL;
25837   PyObject *__pyx_t_5 = NULL;
25838   int __pyx_t_6;
25839   PyObject *__pyx_t_7 = NULL;
25840   PyObject *__pyx_t_8 = NULL;
25841   PyObject *__pyx_t_9 = NULL;
25842   __pyx_t_5numpy_int64_t __pyx_t_10;
25843   __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", 0);
25844 
25845   /* "FromPyStructUtility":13
25846  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *:
25847  *     cdef struct_type result
25848  *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
25849  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
25850  *
25851  */
25852   __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
25853   if (__pyx_t_1) {
25854 
25855     /* "FromPyStructUtility":14
25856  *     cdef struct_type result
25857  *     if not PyMapping_Check(obj):
25858  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
25859  *
25860  *     try:
25861  */
25862     __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
25863     __Pyx_GOTREF(__pyx_t_2);
25864     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25865 
25866     /* "FromPyStructUtility":13
25867  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *:
25868  *     cdef struct_type result
25869  *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
25870  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
25871  *
25872  */
25873   }
25874 
25875   /* "FromPyStructUtility":16
25876  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
25877  *
25878  *     try:             # <<<<<<<<<<<<<<
25879  *         value = obj['file_ind']
25880  *     except KeyError:
25881  */
25882   {
25883     __Pyx_PyThreadState_declare
25884     __Pyx_PyThreadState_assign
25885     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
25886     __Pyx_XGOTREF(__pyx_t_3);
25887     __Pyx_XGOTREF(__pyx_t_4);
25888     __Pyx_XGOTREF(__pyx_t_5);
25889     /*try:*/ {
25890 
25891       /* "FromPyStructUtility":17
25892  *
25893  *     try:
25894  *         value = obj['file_ind']             # <<<<<<<<<<<<<<
25895  *     except KeyError:
25896  *         raise ValueError("No value specified for struct attribute 'file_ind'")
25897  */
25898       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_file_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L4_error)
25899       __Pyx_GOTREF(__pyx_t_2);
25900       __pyx_v_value = __pyx_t_2;
25901       __pyx_t_2 = 0;
25902 
25903       /* "FromPyStructUtility":16
25904  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
25905  *
25906  *     try:             # <<<<<<<<<<<<<<
25907  *         value = obj['file_ind']
25908  *     except KeyError:
25909  */
25910     }
25911     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25912     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25913     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25914     goto __pyx_L9_try_end;
25915     __pyx_L4_error:;
25916     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25917 
25918     /* "FromPyStructUtility":18
25919  *     try:
25920  *         value = obj['file_ind']
25921  *     except KeyError:             # <<<<<<<<<<<<<<
25922  *         raise ValueError("No value specified for struct attribute 'file_ind'")
25923  *     result.file_ind = value
25924  */
25925     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
25926     if (__pyx_t_6) {
25927       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
25928       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 18, __pyx_L6_except_error)
25929       __Pyx_GOTREF(__pyx_t_2);
25930       __Pyx_GOTREF(__pyx_t_7);
25931       __Pyx_GOTREF(__pyx_t_8);
25932 
25933       /* "FromPyStructUtility":19
25934  *         value = obj['file_ind']
25935  *     except KeyError:
25936  *         raise ValueError("No value specified for struct attribute 'file_ind'")             # <<<<<<<<<<<<<<
25937  *     result.file_ind = value
25938  *     try:
25939  */
25940       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 19, __pyx_L6_except_error)
25941       __Pyx_GOTREF(__pyx_t_9);
25942       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
25943       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
25944       __PYX_ERR(1, 19, __pyx_L6_except_error)
25945     }
25946     goto __pyx_L6_except_error;
25947     __pyx_L6_except_error:;
25948 
25949     /* "FromPyStructUtility":16
25950  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
25951  *
25952  *     try:             # <<<<<<<<<<<<<<
25953  *         value = obj['file_ind']
25954  *     except KeyError:
25955  */
25956     __Pyx_XGIVEREF(__pyx_t_3);
25957     __Pyx_XGIVEREF(__pyx_t_4);
25958     __Pyx_XGIVEREF(__pyx_t_5);
25959     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
25960     goto __pyx_L1_error;
25961     __pyx_L9_try_end:;
25962   }
25963 
25964   /* "FromPyStructUtility":20
25965  *     except KeyError:
25966  *         raise ValueError("No value specified for struct attribute 'file_ind'")
25967  *     result.file_ind = value             # <<<<<<<<<<<<<<
25968  *     try:
25969  *         value = obj['domain_ind']
25970  */
25971   __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error)
25972   __pyx_v_result.file_ind = __pyx_t_10;
25973 
25974   /* "FromPyStructUtility":21
25975  *         raise ValueError("No value specified for struct attribute 'file_ind'")
25976  *     result.file_ind = value
25977  *     try:             # <<<<<<<<<<<<<<
25978  *         value = obj['domain_ind']
25979  *     except KeyError:
25980  */
25981   {
25982     __Pyx_PyThreadState_declare
25983     __Pyx_PyThreadState_assign
25984     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
25985     __Pyx_XGOTREF(__pyx_t_5);
25986     __Pyx_XGOTREF(__pyx_t_4);
25987     __Pyx_XGOTREF(__pyx_t_3);
25988     /*try:*/ {
25989 
25990       /* "FromPyStructUtility":22
25991  *     result.file_ind = value
25992  *     try:
25993  *         value = obj['domain_ind']             # <<<<<<<<<<<<<<
25994  *     except KeyError:
25995  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
25996  */
25997       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_domain_ind); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 22, __pyx_L12_error)
25998       __Pyx_GOTREF(__pyx_t_8);
25999       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
26000       __pyx_t_8 = 0;
26001 
26002       /* "FromPyStructUtility":21
26003  *         raise ValueError("No value specified for struct attribute 'file_ind'")
26004  *     result.file_ind = value
26005  *     try:             # <<<<<<<<<<<<<<
26006  *         value = obj['domain_ind']
26007  *     except KeyError:
26008  */
26009     }
26010     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26011     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26012     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26013     goto __pyx_L17_try_end;
26014     __pyx_L12_error:;
26015     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26016     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26017     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26018     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26019 
26020     /* "FromPyStructUtility":23
26021  *     try:
26022  *         value = obj['domain_ind']
26023  *     except KeyError:             # <<<<<<<<<<<<<<
26024  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
26025  *     result.domain_ind = value
26026  */
26027     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
26028     if (__pyx_t_6) {
26029       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
26030       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L14_except_error)
26031       __Pyx_GOTREF(__pyx_t_8);
26032       __Pyx_GOTREF(__pyx_t_7);
26033       __Pyx_GOTREF(__pyx_t_2);
26034 
26035       /* "FromPyStructUtility":24
26036  *         value = obj['domain_ind']
26037  *     except KeyError:
26038  *         raise ValueError("No value specified for struct attribute 'domain_ind'")             # <<<<<<<<<<<<<<
26039  *     result.domain_ind = value
26040  *     try:
26041  */
26042       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 24, __pyx_L14_except_error)
26043       __Pyx_GOTREF(__pyx_t_9);
26044       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
26045       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26046       __PYX_ERR(1, 24, __pyx_L14_except_error)
26047     }
26048     goto __pyx_L14_except_error;
26049     __pyx_L14_except_error:;
26050 
26051     /* "FromPyStructUtility":21
26052  *         raise ValueError("No value specified for struct attribute 'file_ind'")
26053  *     result.file_ind = value
26054  *     try:             # <<<<<<<<<<<<<<
26055  *         value = obj['domain_ind']
26056  *     except KeyError:
26057  */
26058     __Pyx_XGIVEREF(__pyx_t_5);
26059     __Pyx_XGIVEREF(__pyx_t_4);
26060     __Pyx_XGIVEREF(__pyx_t_3);
26061     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
26062     goto __pyx_L1_error;
26063     __pyx_L17_try_end:;
26064   }
26065 
26066   /* "FromPyStructUtility":25
26067  *     except KeyError:
26068  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
26069  *     result.domain_ind = value             # <<<<<<<<<<<<<<
26070  *     try:
26071  *         value = obj['domain']
26072  */
26073   __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error)
26074   __pyx_v_result.domain_ind = __pyx_t_10;
26075 
26076   /* "FromPyStructUtility":26
26077  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
26078  *     result.domain_ind = value
26079  *     try:             # <<<<<<<<<<<<<<
26080  *         value = obj['domain']
26081  *     except KeyError:
26082  */
26083   {
26084     __Pyx_PyThreadState_declare
26085     __Pyx_PyThreadState_assign
26086     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
26087     __Pyx_XGOTREF(__pyx_t_3);
26088     __Pyx_XGOTREF(__pyx_t_4);
26089     __Pyx_XGOTREF(__pyx_t_5);
26090     /*try:*/ {
26091 
26092       /* "FromPyStructUtility":27
26093  *     result.domain_ind = value
26094  *     try:
26095  *         value = obj['domain']             # <<<<<<<<<<<<<<
26096  *     except KeyError:
26097  *         raise ValueError("No value specified for struct attribute 'domain'")
26098  */
26099       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L20_error)
26100       __Pyx_GOTREF(__pyx_t_2);
26101       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
26102       __pyx_t_2 = 0;
26103 
26104       /* "FromPyStructUtility":26
26105  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
26106  *     result.domain_ind = value
26107  *     try:             # <<<<<<<<<<<<<<
26108  *         value = obj['domain']
26109  *     except KeyError:
26110  */
26111     }
26112     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26113     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26114     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26115     goto __pyx_L25_try_end;
26116     __pyx_L20_error:;
26117     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26118     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26119     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26120     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26121 
26122     /* "FromPyStructUtility":28
26123  *     try:
26124  *         value = obj['domain']
26125  *     except KeyError:             # <<<<<<<<<<<<<<
26126  *         raise ValueError("No value specified for struct attribute 'domain'")
26127  *     result.domain = value
26128  */
26129     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
26130     if (__pyx_t_6) {
26131       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
26132       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 28, __pyx_L22_except_error)
26133       __Pyx_GOTREF(__pyx_t_2);
26134       __Pyx_GOTREF(__pyx_t_7);
26135       __Pyx_GOTREF(__pyx_t_8);
26136 
26137       /* "FromPyStructUtility":29
26138  *         value = obj['domain']
26139  *     except KeyError:
26140  *         raise ValueError("No value specified for struct attribute 'domain'")             # <<<<<<<<<<<<<<
26141  *     result.domain = value
26142  *     try:
26143  */
26144       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 29, __pyx_L22_except_error)
26145       __Pyx_GOTREF(__pyx_t_9);
26146       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
26147       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26148       __PYX_ERR(1, 29, __pyx_L22_except_error)
26149     }
26150     goto __pyx_L22_except_error;
26151     __pyx_L22_except_error:;
26152 
26153     /* "FromPyStructUtility":26
26154  *         raise ValueError("No value specified for struct attribute 'domain_ind'")
26155  *     result.domain_ind = value
26156  *     try:             # <<<<<<<<<<<<<<
26157  *         value = obj['domain']
26158  *     except KeyError:
26159  */
26160     __Pyx_XGIVEREF(__pyx_t_3);
26161     __Pyx_XGIVEREF(__pyx_t_4);
26162     __Pyx_XGIVEREF(__pyx_t_5);
26163     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
26164     goto __pyx_L1_error;
26165     __pyx_L25_try_end:;
26166   }
26167 
26168   /* "FromPyStructUtility":30
26169  *     except KeyError:
26170  *         raise ValueError("No value specified for struct attribute 'domain'")
26171  *     result.domain = value             # <<<<<<<<<<<<<<
26172  *     try:
26173  *         value = obj['padding']
26174  */
26175   __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error)
26176   __pyx_v_result.domain = __pyx_t_10;
26177 
26178   /* "FromPyStructUtility":31
26179  *         raise ValueError("No value specified for struct attribute 'domain'")
26180  *     result.domain = value
26181  *     try:             # <<<<<<<<<<<<<<
26182  *         value = obj['padding']
26183  *     except KeyError:
26184  */
26185   {
26186     __Pyx_PyThreadState_declare
26187     __Pyx_PyThreadState_assign
26188     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
26189     __Pyx_XGOTREF(__pyx_t_5);
26190     __Pyx_XGOTREF(__pyx_t_4);
26191     __Pyx_XGOTREF(__pyx_t_3);
26192     /*try:*/ {
26193 
26194       /* "FromPyStructUtility":32
26195  *     result.domain = value
26196  *     try:
26197  *         value = obj['padding']             # <<<<<<<<<<<<<<
26198  *     except KeyError:
26199  *         raise ValueError("No value specified for struct attribute 'padding'")
26200  */
26201       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_padding); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 32, __pyx_L28_error)
26202       __Pyx_GOTREF(__pyx_t_8);
26203       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
26204       __pyx_t_8 = 0;
26205 
26206       /* "FromPyStructUtility":31
26207  *         raise ValueError("No value specified for struct attribute 'domain'")
26208  *     result.domain = value
26209  *     try:             # <<<<<<<<<<<<<<
26210  *         value = obj['padding']
26211  *     except KeyError:
26212  */
26213     }
26214     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26215     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26216     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26217     goto __pyx_L33_try_end;
26218     __pyx_L28_error:;
26219     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26220     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26221     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26222     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26223 
26224     /* "FromPyStructUtility":33
26225  *     try:
26226  *         value = obj['padding']
26227  *     except KeyError:             # <<<<<<<<<<<<<<
26228  *         raise ValueError("No value specified for struct attribute 'padding'")
26229  *     result.padding = value
26230  */
26231     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
26232     if (__pyx_t_6) {
26233       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
26234       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L30_except_error)
26235       __Pyx_GOTREF(__pyx_t_8);
26236       __Pyx_GOTREF(__pyx_t_7);
26237       __Pyx_GOTREF(__pyx_t_2);
26238 
26239       /* "FromPyStructUtility":34
26240  *         value = obj['padding']
26241  *     except KeyError:
26242  *         raise ValueError("No value specified for struct attribute 'padding'")             # <<<<<<<<<<<<<<
26243  *     result.padding = value
26244  *     return result
26245  */
26246       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 34, __pyx_L30_except_error)
26247       __Pyx_GOTREF(__pyx_t_9);
26248       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
26249       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26250       __PYX_ERR(1, 34, __pyx_L30_except_error)
26251     }
26252     goto __pyx_L30_except_error;
26253     __pyx_L30_except_error:;
26254 
26255     /* "FromPyStructUtility":31
26256  *         raise ValueError("No value specified for struct attribute 'domain'")
26257  *     result.domain = value
26258  *     try:             # <<<<<<<<<<<<<<
26259  *         value = obj['padding']
26260  *     except KeyError:
26261  */
26262     __Pyx_XGIVEREF(__pyx_t_5);
26263     __Pyx_XGIVEREF(__pyx_t_4);
26264     __Pyx_XGIVEREF(__pyx_t_3);
26265     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
26266     goto __pyx_L1_error;
26267     __pyx_L33_try_end:;
26268   }
26269 
26270   /* "FromPyStructUtility":35
26271  *     except KeyError:
26272  *         raise ValueError("No value specified for struct attribute 'padding'")
26273  *     result.padding = value             # <<<<<<<<<<<<<<
26274  *     return result
26275  *
26276  */
26277   __pyx_t_10 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L1_error)
26278   __pyx_v_result.padding = __pyx_t_10;
26279 
26280   /* "FromPyStructUtility":36
26281  *         raise ValueError("No value specified for struct attribute 'padding'")
26282  *     result.padding = value
26283  *     return result             # <<<<<<<<<<<<<<
26284  *
26285  *
26286  */
26287   __pyx_r = __pyx_v_result;
26288   goto __pyx_L0;
26289 
26290   /* "FromPyStructUtility":11
26291  *
26292  * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded")
26293  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj) except *:             # <<<<<<<<<<<<<<
26294  *     cdef struct_type result
26295  *     if not PyMapping_Check(obj):
26296  */
26297 
26298   /* function exit code */
26299   __pyx_L1_error:;
26300   __Pyx_XDECREF(__pyx_t_2);
26301   __Pyx_XDECREF(__pyx_t_7);
26302   __Pyx_XDECREF(__pyx_t_8);
26303   __Pyx_XDECREF(__pyx_t_9);
26304   __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
26305   __Pyx_pretend_to_initialize(&__pyx_r);
26306   __pyx_L0:;
26307   __Pyx_XDECREF(__pyx_v_value);
26308   __Pyx_RefNannyFinishContext();
26309   return __pyx_r;
26310 }
26311 
26312 /* "View.MemoryView":122
26313  *         cdef bint dtype_is_object
26314  *
26315  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
26316  *                   mode="c", bint allocate_buffer=True):
26317  *
26318  */
26319 
26320 /* Python wrapper */
26321 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_array___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26322 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26323   PyObject *__pyx_v_shape = 0;
26324   Py_ssize_t __pyx_v_itemsize;
26325   PyObject *__pyx_v_format = 0;
26326   PyObject *__pyx_v_mode = 0;
26327   int __pyx_v_allocate_buffer;
26328   int __pyx_r;
26329   __Pyx_RefNannyDeclarations
26330   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
26331   {
26332     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
26333     PyObject* values[5] = {0,0,0,0,0};
26334     values[3] = ((PyObject *)__pyx_n_s_c);
26335     if (unlikely(__pyx_kwds)) {
26336       Py_ssize_t kw_args;
26337       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26338       switch (pos_args) {
26339         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
26340         CYTHON_FALLTHROUGH;
26341         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
26342         CYTHON_FALLTHROUGH;
26343         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26344         CYTHON_FALLTHROUGH;
26345         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26346         CYTHON_FALLTHROUGH;
26347         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26348         CYTHON_FALLTHROUGH;
26349         case  0: break;
26350         default: goto __pyx_L5_argtuple_error;
26351       }
26352       kw_args = PyDict_Size(__pyx_kwds);
26353       switch (pos_args) {
26354         case  0:
26355         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
26356         else goto __pyx_L5_argtuple_error;
26357         CYTHON_FALLTHROUGH;
26358         case  1:
26359         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
26360         else {
26361           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
26362         }
26363         CYTHON_FALLTHROUGH;
26364         case  2:
26365         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
26366         else {
26367           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
26368         }
26369         CYTHON_FALLTHROUGH;
26370         case  3:
26371         if (kw_args > 0) {
26372           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
26373           if (value) { values[3] = value; kw_args--; }
26374         }
26375         CYTHON_FALLTHROUGH;
26376         case  4:
26377         if (kw_args > 0) {
26378           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
26379           if (value) { values[4] = value; kw_args--; }
26380         }
26381       }
26382       if (unlikely(kw_args > 0)) {
26383         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
26384       }
26385     } else {
26386       switch (PyTuple_GET_SIZE(__pyx_args)) {
26387         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
26388         CYTHON_FALLTHROUGH;
26389         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
26390         CYTHON_FALLTHROUGH;
26391         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26392         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26393         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26394         break;
26395         default: goto __pyx_L5_argtuple_error;
26396       }
26397     }
26398     __pyx_v_shape = ((PyObject*)values[0]);
26399     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
26400     __pyx_v_format = values[2];
26401     __pyx_v_mode = values[3];
26402     if (values[4]) {
26403       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
26404     } else {
26405 
26406       /* "View.MemoryView":123
26407  *
26408  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
26409  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
26410  *
26411  *         cdef int idx
26412  */
26413       __pyx_v_allocate_buffer = ((int)1);
26414     }
26415   }
26416   goto __pyx_L4_argument_unpacking_done;
26417   __pyx_L5_argtuple_error:;
26418   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
26419   __pyx_L3_error:;
26420   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26421   __Pyx_RefNannyFinishContext();
26422   return -1;
26423   __pyx_L4_argument_unpacking_done:;
26424   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
26425   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
26426     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
26427   }
26428   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
26429 
26430   /* "View.MemoryView":122
26431  *         cdef bint dtype_is_object
26432  *
26433  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
26434  *                   mode="c", bint allocate_buffer=True):
26435  *
26436  */
26437 
26438   /* function exit code */
26439   goto __pyx_L0;
26440   __pyx_L1_error:;
26441   __pyx_r = -1;
26442   __pyx_L0:;
26443   __Pyx_RefNannyFinishContext();
26444   return __pyx_r;
26445 }
26446 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,PyObject * __pyx_v_format,PyObject * __pyx_v_mode,int __pyx_v_allocate_buffer)26447 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
26448   int __pyx_v_idx;
26449   Py_ssize_t __pyx_v_i;
26450   Py_ssize_t __pyx_v_dim;
26451   PyObject **__pyx_v_p;
26452   char __pyx_v_order;
26453   int __pyx_r;
26454   __Pyx_RefNannyDeclarations
26455   Py_ssize_t __pyx_t_1;
26456   int __pyx_t_2;
26457   PyObject *__pyx_t_3 = NULL;
26458   int __pyx_t_4;
26459   PyObject *__pyx_t_5 = NULL;
26460   PyObject *__pyx_t_6 = NULL;
26461   char *__pyx_t_7;
26462   int __pyx_t_8;
26463   Py_ssize_t __pyx_t_9;
26464   PyObject *__pyx_t_10 = NULL;
26465   Py_ssize_t __pyx_t_11;
26466   __Pyx_RefNannySetupContext("__cinit__", 0);
26467   __Pyx_INCREF(__pyx_v_format);
26468 
26469   /* "View.MemoryView":129
26470  *         cdef PyObject **p
26471  *
26472  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
26473  *         self.itemsize = itemsize
26474  *
26475  */
26476   if (unlikely(__pyx_v_shape == Py_None)) {
26477     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
26478     __PYX_ERR(1, 129, __pyx_L1_error)
26479   }
26480   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
26481   __pyx_v_self->ndim = ((int)__pyx_t_1);
26482 
26483   /* "View.MemoryView":130
26484  *
26485  *         self.ndim = <int> len(shape)
26486  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
26487  *
26488  *         if not self.ndim:
26489  */
26490   __pyx_v_self->itemsize = __pyx_v_itemsize;
26491 
26492   /* "View.MemoryView":132
26493  *         self.itemsize = itemsize
26494  *
26495  *         if not self.ndim:             # <<<<<<<<<<<<<<
26496  *             raise ValueError("Empty shape tuple for cython.array")
26497  *
26498  */
26499   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
26500   if (unlikely(__pyx_t_2)) {
26501 
26502     /* "View.MemoryView":133
26503  *
26504  *         if not self.ndim:
26505  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
26506  *
26507  *         if itemsize <= 0:
26508  */
26509     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
26510     __Pyx_GOTREF(__pyx_t_3);
26511     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26512     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26513     __PYX_ERR(1, 133, __pyx_L1_error)
26514 
26515     /* "View.MemoryView":132
26516  *         self.itemsize = itemsize
26517  *
26518  *         if not self.ndim:             # <<<<<<<<<<<<<<
26519  *             raise ValueError("Empty shape tuple for cython.array")
26520  *
26521  */
26522   }
26523 
26524   /* "View.MemoryView":135
26525  *             raise ValueError("Empty shape tuple for cython.array")
26526  *
26527  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
26528  *             raise ValueError("itemsize <= 0 for cython.array")
26529  *
26530  */
26531   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
26532   if (unlikely(__pyx_t_2)) {
26533 
26534     /* "View.MemoryView":136
26535  *
26536  *         if itemsize <= 0:
26537  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
26538  *
26539  *         if not isinstance(format, bytes):
26540  */
26541     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
26542     __Pyx_GOTREF(__pyx_t_3);
26543     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26544     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26545     __PYX_ERR(1, 136, __pyx_L1_error)
26546 
26547     /* "View.MemoryView":135
26548  *             raise ValueError("Empty shape tuple for cython.array")
26549  *
26550  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
26551  *             raise ValueError("itemsize <= 0 for cython.array")
26552  *
26553  */
26554   }
26555 
26556   /* "View.MemoryView":138
26557  *             raise ValueError("itemsize <= 0 for cython.array")
26558  *
26559  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
26560  *             format = format.encode('ASCII')
26561  *         self._format = format  # keep a reference to the byte string
26562  */
26563   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
26564   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
26565   if (__pyx_t_4) {
26566 
26567     /* "View.MemoryView":139
26568  *
26569  *         if not isinstance(format, bytes):
26570  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
26571  *         self._format = format  # keep a reference to the byte string
26572  *         self.format = self._format
26573  */
26574     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
26575     __Pyx_GOTREF(__pyx_t_5);
26576     __pyx_t_6 = NULL;
26577     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
26578       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
26579       if (likely(__pyx_t_6)) {
26580         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
26581         __Pyx_INCREF(__pyx_t_6);
26582         __Pyx_INCREF(function);
26583         __Pyx_DECREF_SET(__pyx_t_5, function);
26584       }
26585     }
26586     __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
26587     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26588     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
26589     __Pyx_GOTREF(__pyx_t_3);
26590     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26591     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
26592     __pyx_t_3 = 0;
26593 
26594     /* "View.MemoryView":138
26595  *             raise ValueError("itemsize <= 0 for cython.array")
26596  *
26597  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
26598  *             format = format.encode('ASCII')
26599  *         self._format = format  # keep a reference to the byte string
26600  */
26601   }
26602 
26603   /* "View.MemoryView":140
26604  *         if not isinstance(format, bytes):
26605  *             format = format.encode('ASCII')
26606  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
26607  *         self.format = self._format
26608  *
26609  */
26610   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
26611   __pyx_t_3 = __pyx_v_format;
26612   __Pyx_INCREF(__pyx_t_3);
26613   __Pyx_GIVEREF(__pyx_t_3);
26614   __Pyx_GOTREF(__pyx_v_self->_format);
26615   __Pyx_DECREF(__pyx_v_self->_format);
26616   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
26617   __pyx_t_3 = 0;
26618 
26619   /* "View.MemoryView":141
26620  *             format = format.encode('ASCII')
26621  *         self._format = format  # keep a reference to the byte string
26622  *         self.format = self._format             # <<<<<<<<<<<<<<
26623  *
26624  *
26625  */
26626   if (unlikely(__pyx_v_self->_format == Py_None)) {
26627     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
26628     __PYX_ERR(1, 141, __pyx_L1_error)
26629   }
26630   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
26631   __pyx_v_self->format = __pyx_t_7;
26632 
26633   /* "View.MemoryView":144
26634  *
26635  *
26636  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
26637  *         self._strides = self._shape + self.ndim
26638  *
26639  */
26640   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
26641 
26642   /* "View.MemoryView":145
26643  *
26644  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
26645  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
26646  *
26647  *         if not self._shape:
26648  */
26649   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
26650 
26651   /* "View.MemoryView":147
26652  *         self._strides = self._shape + self.ndim
26653  *
26654  *         if not self._shape:             # <<<<<<<<<<<<<<
26655  *             raise MemoryError("unable to allocate shape and strides.")
26656  *
26657  */
26658   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
26659   if (unlikely(__pyx_t_4)) {
26660 
26661     /* "View.MemoryView":148
26662  *
26663  *         if not self._shape:
26664  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
26665  *
26666  *
26667  */
26668     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
26669     __Pyx_GOTREF(__pyx_t_3);
26670     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26671     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26672     __PYX_ERR(1, 148, __pyx_L1_error)
26673 
26674     /* "View.MemoryView":147
26675  *         self._strides = self._shape + self.ndim
26676  *
26677  *         if not self._shape:             # <<<<<<<<<<<<<<
26678  *             raise MemoryError("unable to allocate shape and strides.")
26679  *
26680  */
26681   }
26682 
26683   /* "View.MemoryView":151
26684  *
26685  *
26686  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
26687  *             if dim <= 0:
26688  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
26689  */
26690   __pyx_t_8 = 0;
26691   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
26692   for (;;) {
26693     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
26694     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26695     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
26696     #else
26697     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
26698     __Pyx_GOTREF(__pyx_t_5);
26699     #endif
26700     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
26701     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26702     __pyx_v_dim = __pyx_t_9;
26703     __pyx_v_idx = __pyx_t_8;
26704     __pyx_t_8 = (__pyx_t_8 + 1);
26705 
26706     /* "View.MemoryView":152
26707  *
26708  *         for idx, dim in enumerate(shape):
26709  *             if dim <= 0:             # <<<<<<<<<<<<<<
26710  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
26711  *             self._shape[idx] = dim
26712  */
26713     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
26714     if (unlikely(__pyx_t_4)) {
26715 
26716       /* "View.MemoryView":153
26717  *         for idx, dim in enumerate(shape):
26718  *             if dim <= 0:
26719  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
26720  *             self._shape[idx] = dim
26721  *
26722  */
26723       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
26724       __Pyx_GOTREF(__pyx_t_5);
26725       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
26726       __Pyx_GOTREF(__pyx_t_6);
26727       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
26728       __Pyx_GOTREF(__pyx_t_10);
26729       __Pyx_GIVEREF(__pyx_t_5);
26730       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
26731       __Pyx_GIVEREF(__pyx_t_6);
26732       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
26733       __pyx_t_5 = 0;
26734       __pyx_t_6 = 0;
26735       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
26736       __Pyx_GOTREF(__pyx_t_6);
26737       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26738       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
26739       __Pyx_GOTREF(__pyx_t_10);
26740       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26741       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
26742       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26743       __PYX_ERR(1, 153, __pyx_L1_error)
26744 
26745       /* "View.MemoryView":152
26746  *
26747  *         for idx, dim in enumerate(shape):
26748  *             if dim <= 0:             # <<<<<<<<<<<<<<
26749  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
26750  *             self._shape[idx] = dim
26751  */
26752     }
26753 
26754     /* "View.MemoryView":154
26755  *             if dim <= 0:
26756  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
26757  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
26758  *
26759  *         cdef char order
26760  */
26761     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
26762 
26763     /* "View.MemoryView":151
26764  *
26765  *
26766  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
26767  *             if dim <= 0:
26768  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
26769  */
26770   }
26771   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26772 
26773   /* "View.MemoryView":157
26774  *
26775  *         cdef char order
26776  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
26777  *             order = b'F'
26778  *             self.mode = u'fortran'
26779  */
26780   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
26781   if (__pyx_t_4) {
26782 
26783     /* "View.MemoryView":158
26784  *         cdef char order
26785  *         if mode == 'fortran':
26786  *             order = b'F'             # <<<<<<<<<<<<<<
26787  *             self.mode = u'fortran'
26788  *         elif mode == 'c':
26789  */
26790     __pyx_v_order = 'F';
26791 
26792     /* "View.MemoryView":159
26793  *         if mode == 'fortran':
26794  *             order = b'F'
26795  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
26796  *         elif mode == 'c':
26797  *             order = b'C'
26798  */
26799     __Pyx_INCREF(__pyx_n_u_fortran);
26800     __Pyx_GIVEREF(__pyx_n_u_fortran);
26801     __Pyx_GOTREF(__pyx_v_self->mode);
26802     __Pyx_DECREF(__pyx_v_self->mode);
26803     __pyx_v_self->mode = __pyx_n_u_fortran;
26804 
26805     /* "View.MemoryView":157
26806  *
26807  *         cdef char order
26808  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
26809  *             order = b'F'
26810  *             self.mode = u'fortran'
26811  */
26812     goto __pyx_L10;
26813   }
26814 
26815   /* "View.MemoryView":160
26816  *             order = b'F'
26817  *             self.mode = u'fortran'
26818  *         elif mode == 'c':             # <<<<<<<<<<<<<<
26819  *             order = b'C'
26820  *             self.mode = u'c'
26821  */
26822   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
26823   if (likely(__pyx_t_4)) {
26824 
26825     /* "View.MemoryView":161
26826  *             self.mode = u'fortran'
26827  *         elif mode == 'c':
26828  *             order = b'C'             # <<<<<<<<<<<<<<
26829  *             self.mode = u'c'
26830  *         else:
26831  */
26832     __pyx_v_order = 'C';
26833 
26834     /* "View.MemoryView":162
26835  *         elif mode == 'c':
26836  *             order = b'C'
26837  *             self.mode = u'c'             # <<<<<<<<<<<<<<
26838  *         else:
26839  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
26840  */
26841     __Pyx_INCREF(__pyx_n_u_c);
26842     __Pyx_GIVEREF(__pyx_n_u_c);
26843     __Pyx_GOTREF(__pyx_v_self->mode);
26844     __Pyx_DECREF(__pyx_v_self->mode);
26845     __pyx_v_self->mode = __pyx_n_u_c;
26846 
26847     /* "View.MemoryView":160
26848  *             order = b'F'
26849  *             self.mode = u'fortran'
26850  *         elif mode == 'c':             # <<<<<<<<<<<<<<
26851  *             order = b'C'
26852  *             self.mode = u'c'
26853  */
26854     goto __pyx_L10;
26855   }
26856 
26857   /* "View.MemoryView":164
26858  *             self.mode = u'c'
26859  *         else:
26860  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
26861  *
26862  *         self.len = fill_contig_strides_array(self._shape, self._strides,
26863  */
26864   /*else*/ {
26865     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
26866     __Pyx_GOTREF(__pyx_t_3);
26867     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
26868     __Pyx_GOTREF(__pyx_t_10);
26869     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26870     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
26871     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26872     __PYX_ERR(1, 164, __pyx_L1_error)
26873   }
26874   __pyx_L10:;
26875 
26876   /* "View.MemoryView":166
26877  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
26878  *
26879  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
26880  *                                              itemsize, self.ndim, order)
26881  *
26882  */
26883   __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
26884 
26885   /* "View.MemoryView":169
26886  *                                              itemsize, self.ndim, order)
26887  *
26888  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
26889  *         self.dtype_is_object = format == b'O'
26890  *         if allocate_buffer:
26891  */
26892   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
26893 
26894   /* "View.MemoryView":170
26895  *
26896  *         self.free_data = allocate_buffer
26897  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
26898  *         if allocate_buffer:
26899  *
26900  */
26901   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
26902   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
26903   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26904   __pyx_v_self->dtype_is_object = __pyx_t_4;
26905 
26906   /* "View.MemoryView":171
26907  *         self.free_data = allocate_buffer
26908  *         self.dtype_is_object = format == b'O'
26909  *         if allocate_buffer:             # <<<<<<<<<<<<<<
26910  *
26911  *
26912  */
26913   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
26914   if (__pyx_t_4) {
26915 
26916     /* "View.MemoryView":174
26917  *
26918  *
26919  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
26920  *             if not self.data:
26921  *                 raise MemoryError("unable to allocate array data.")
26922  */
26923     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
26924 
26925     /* "View.MemoryView":175
26926  *
26927  *             self.data = <char *>malloc(self.len)
26928  *             if not self.data:             # <<<<<<<<<<<<<<
26929  *                 raise MemoryError("unable to allocate array data.")
26930  *
26931  */
26932     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
26933     if (unlikely(__pyx_t_4)) {
26934 
26935       /* "View.MemoryView":176
26936  *             self.data = <char *>malloc(self.len)
26937  *             if not self.data:
26938  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
26939  *
26940  *             if self.dtype_is_object:
26941  */
26942       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
26943       __Pyx_GOTREF(__pyx_t_10);
26944       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
26945       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
26946       __PYX_ERR(1, 176, __pyx_L1_error)
26947 
26948       /* "View.MemoryView":175
26949  *
26950  *             self.data = <char *>malloc(self.len)
26951  *             if not self.data:             # <<<<<<<<<<<<<<
26952  *                 raise MemoryError("unable to allocate array data.")
26953  *
26954  */
26955     }
26956 
26957     /* "View.MemoryView":178
26958  *                 raise MemoryError("unable to allocate array data.")
26959  *
26960  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
26961  *                 p = <PyObject **> self.data
26962  *                 for i in range(self.len / itemsize):
26963  */
26964     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
26965     if (__pyx_t_4) {
26966 
26967       /* "View.MemoryView":179
26968  *
26969  *             if self.dtype_is_object:
26970  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
26971  *                 for i in range(self.len / itemsize):
26972  *                     p[i] = Py_None
26973  */
26974       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
26975 
26976       /* "View.MemoryView":180
26977  *             if self.dtype_is_object:
26978  *                 p = <PyObject **> self.data
26979  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
26980  *                     p[i] = Py_None
26981  *                     Py_INCREF(Py_None)
26982  */
26983       if (unlikely(__pyx_v_itemsize == 0)) {
26984         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
26985         __PYX_ERR(1, 180, __pyx_L1_error)
26986       }
26987       else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
26988         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
26989         __PYX_ERR(1, 180, __pyx_L1_error)
26990       }
26991       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
26992       __pyx_t_9 = __pyx_t_1;
26993       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
26994         __pyx_v_i = __pyx_t_11;
26995 
26996         /* "View.MemoryView":181
26997  *                 p = <PyObject **> self.data
26998  *                 for i in range(self.len / itemsize):
26999  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
27000  *                     Py_INCREF(Py_None)
27001  *
27002  */
27003         (__pyx_v_p[__pyx_v_i]) = Py_None;
27004 
27005         /* "View.MemoryView":182
27006  *                 for i in range(self.len / itemsize):
27007  *                     p[i] = Py_None
27008  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
27009  *
27010  *     @cname('getbuffer')
27011  */
27012         Py_INCREF(Py_None);
27013       }
27014 
27015       /* "View.MemoryView":178
27016  *                 raise MemoryError("unable to allocate array data.")
27017  *
27018  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
27019  *                 p = <PyObject **> self.data
27020  *                 for i in range(self.len / itemsize):
27021  */
27022     }
27023 
27024     /* "View.MemoryView":171
27025  *         self.free_data = allocate_buffer
27026  *         self.dtype_is_object = format == b'O'
27027  *         if allocate_buffer:             # <<<<<<<<<<<<<<
27028  *
27029  *
27030  */
27031   }
27032 
27033   /* "View.MemoryView":122
27034  *         cdef bint dtype_is_object
27035  *
27036  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
27037  *                   mode="c", bint allocate_buffer=True):
27038  *
27039  */
27040 
27041   /* function exit code */
27042   __pyx_r = 0;
27043   goto __pyx_L0;
27044   __pyx_L1_error:;
27045   __Pyx_XDECREF(__pyx_t_3);
27046   __Pyx_XDECREF(__pyx_t_5);
27047   __Pyx_XDECREF(__pyx_t_6);
27048   __Pyx_XDECREF(__pyx_t_10);
27049   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27050   __pyx_r = -1;
27051   __pyx_L0:;
27052   __Pyx_XDECREF(__pyx_v_format);
27053   __Pyx_RefNannyFinishContext();
27054   return __pyx_r;
27055 }
27056 
27057 /* "View.MemoryView":185
27058  *
27059  *     @cname('getbuffer')
27060  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
27061  *         cdef int bufmode = -1
27062  *         if self.mode == u"c":
27063  */
27064 
27065 /* Python wrapper */
27066 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_array_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)27067 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
27068   int __pyx_r;
27069   __Pyx_RefNannyDeclarations
27070   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
27071   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
27072 
27073   /* function exit code */
27074   __Pyx_RefNannyFinishContext();
27075   return __pyx_r;
27076 }
27077 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)27078 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
27079   int __pyx_v_bufmode;
27080   int __pyx_r;
27081   __Pyx_RefNannyDeclarations
27082   int __pyx_t_1;
27083   int __pyx_t_2;
27084   PyObject *__pyx_t_3 = NULL;
27085   char *__pyx_t_4;
27086   Py_ssize_t __pyx_t_5;
27087   int __pyx_t_6;
27088   Py_ssize_t *__pyx_t_7;
27089   if (__pyx_v_info == NULL) {
27090     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
27091     return -1;
27092   }
27093   __Pyx_RefNannySetupContext("__getbuffer__", 0);
27094   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
27095   __Pyx_GIVEREF(__pyx_v_info->obj);
27096 
27097   /* "View.MemoryView":186
27098  *     @cname('getbuffer')
27099  *     def __getbuffer__(self, Py_buffer *info, int flags):
27100  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
27101  *         if self.mode == u"c":
27102  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27103  */
27104   __pyx_v_bufmode = -1;
27105 
27106   /* "View.MemoryView":187
27107  *     def __getbuffer__(self, Py_buffer *info, int flags):
27108  *         cdef int bufmode = -1
27109  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
27110  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27111  *         elif self.mode == u"fortran":
27112  */
27113   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
27114   __pyx_t_2 = (__pyx_t_1 != 0);
27115   if (__pyx_t_2) {
27116 
27117     /* "View.MemoryView":188
27118  *         cdef int bufmode = -1
27119  *         if self.mode == u"c":
27120  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
27121  *         elif self.mode == u"fortran":
27122  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27123  */
27124     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
27125 
27126     /* "View.MemoryView":187
27127  *     def __getbuffer__(self, Py_buffer *info, int flags):
27128  *         cdef int bufmode = -1
27129  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
27130  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27131  *         elif self.mode == u"fortran":
27132  */
27133     goto __pyx_L3;
27134   }
27135 
27136   /* "View.MemoryView":189
27137  *         if self.mode == u"c":
27138  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27139  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
27140  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27141  *         if not (flags & bufmode):
27142  */
27143   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
27144   __pyx_t_1 = (__pyx_t_2 != 0);
27145   if (__pyx_t_1) {
27146 
27147     /* "View.MemoryView":190
27148  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27149  *         elif self.mode == u"fortran":
27150  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
27151  *         if not (flags & bufmode):
27152  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
27153  */
27154     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
27155 
27156     /* "View.MemoryView":189
27157  *         if self.mode == u"c":
27158  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27159  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
27160  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27161  *         if not (flags & bufmode):
27162  */
27163   }
27164   __pyx_L3:;
27165 
27166   /* "View.MemoryView":191
27167  *         elif self.mode == u"fortran":
27168  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27169  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
27170  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
27171  *         info.buf = self.data
27172  */
27173   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
27174   if (unlikely(__pyx_t_1)) {
27175 
27176     /* "View.MemoryView":192
27177  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27178  *         if not (flags & bufmode):
27179  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
27180  *         info.buf = self.data
27181  *         info.len = self.len
27182  */
27183     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
27184     __Pyx_GOTREF(__pyx_t_3);
27185     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27186     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27187     __PYX_ERR(1, 192, __pyx_L1_error)
27188 
27189     /* "View.MemoryView":191
27190  *         elif self.mode == u"fortran":
27191  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
27192  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
27193  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
27194  *         info.buf = self.data
27195  */
27196   }
27197 
27198   /* "View.MemoryView":193
27199  *         if not (flags & bufmode):
27200  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
27201  *         info.buf = self.data             # <<<<<<<<<<<<<<
27202  *         info.len = self.len
27203  *         info.ndim = self.ndim
27204  */
27205   __pyx_t_4 = __pyx_v_self->data;
27206   __pyx_v_info->buf = __pyx_t_4;
27207 
27208   /* "View.MemoryView":194
27209  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
27210  *         info.buf = self.data
27211  *         info.len = self.len             # <<<<<<<<<<<<<<
27212  *         info.ndim = self.ndim
27213  *         info.shape = self._shape
27214  */
27215   __pyx_t_5 = __pyx_v_self->len;
27216   __pyx_v_info->len = __pyx_t_5;
27217 
27218   /* "View.MemoryView":195
27219  *         info.buf = self.data
27220  *         info.len = self.len
27221  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
27222  *         info.shape = self._shape
27223  *         info.strides = self._strides
27224  */
27225   __pyx_t_6 = __pyx_v_self->ndim;
27226   __pyx_v_info->ndim = __pyx_t_6;
27227 
27228   /* "View.MemoryView":196
27229  *         info.len = self.len
27230  *         info.ndim = self.ndim
27231  *         info.shape = self._shape             # <<<<<<<<<<<<<<
27232  *         info.strides = self._strides
27233  *         info.suboffsets = NULL
27234  */
27235   __pyx_t_7 = __pyx_v_self->_shape;
27236   __pyx_v_info->shape = __pyx_t_7;
27237 
27238   /* "View.MemoryView":197
27239  *         info.ndim = self.ndim
27240  *         info.shape = self._shape
27241  *         info.strides = self._strides             # <<<<<<<<<<<<<<
27242  *         info.suboffsets = NULL
27243  *         info.itemsize = self.itemsize
27244  */
27245   __pyx_t_7 = __pyx_v_self->_strides;
27246   __pyx_v_info->strides = __pyx_t_7;
27247 
27248   /* "View.MemoryView":198
27249  *         info.shape = self._shape
27250  *         info.strides = self._strides
27251  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
27252  *         info.itemsize = self.itemsize
27253  *         info.readonly = 0
27254  */
27255   __pyx_v_info->suboffsets = NULL;
27256 
27257   /* "View.MemoryView":199
27258  *         info.strides = self._strides
27259  *         info.suboffsets = NULL
27260  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
27261  *         info.readonly = 0
27262  *
27263  */
27264   __pyx_t_5 = __pyx_v_self->itemsize;
27265   __pyx_v_info->itemsize = __pyx_t_5;
27266 
27267   /* "View.MemoryView":200
27268  *         info.suboffsets = NULL
27269  *         info.itemsize = self.itemsize
27270  *         info.readonly = 0             # <<<<<<<<<<<<<<
27271  *
27272  *         if flags & PyBUF_FORMAT:
27273  */
27274   __pyx_v_info->readonly = 0;
27275 
27276   /* "View.MemoryView":202
27277  *         info.readonly = 0
27278  *
27279  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
27280  *             info.format = self.format
27281  *         else:
27282  */
27283   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
27284   if (__pyx_t_1) {
27285 
27286     /* "View.MemoryView":203
27287  *
27288  *         if flags & PyBUF_FORMAT:
27289  *             info.format = self.format             # <<<<<<<<<<<<<<
27290  *         else:
27291  *             info.format = NULL
27292  */
27293     __pyx_t_4 = __pyx_v_self->format;
27294     __pyx_v_info->format = __pyx_t_4;
27295 
27296     /* "View.MemoryView":202
27297  *         info.readonly = 0
27298  *
27299  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
27300  *             info.format = self.format
27301  *         else:
27302  */
27303     goto __pyx_L5;
27304   }
27305 
27306   /* "View.MemoryView":205
27307  *             info.format = self.format
27308  *         else:
27309  *             info.format = NULL             # <<<<<<<<<<<<<<
27310  *
27311  *         info.obj = self
27312  */
27313   /*else*/ {
27314     __pyx_v_info->format = NULL;
27315   }
27316   __pyx_L5:;
27317 
27318   /* "View.MemoryView":207
27319  *             info.format = NULL
27320  *
27321  *         info.obj = self             # <<<<<<<<<<<<<<
27322  *
27323  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
27324  */
27325   __Pyx_INCREF(((PyObject *)__pyx_v_self));
27326   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
27327   __Pyx_GOTREF(__pyx_v_info->obj);
27328   __Pyx_DECREF(__pyx_v_info->obj);
27329   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
27330 
27331   /* "View.MemoryView":185
27332  *
27333  *     @cname('getbuffer')
27334  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
27335  *         cdef int bufmode = -1
27336  *         if self.mode == u"c":
27337  */
27338 
27339   /* function exit code */
27340   __pyx_r = 0;
27341   goto __pyx_L0;
27342   __pyx_L1_error:;
27343   __Pyx_XDECREF(__pyx_t_3);
27344   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27345   __pyx_r = -1;
27346   if (__pyx_v_info->obj != NULL) {
27347     __Pyx_GOTREF(__pyx_v_info->obj);
27348     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
27349   }
27350   goto __pyx_L2;
27351   __pyx_L0:;
27352   if (__pyx_v_info->obj == Py_None) {
27353     __Pyx_GOTREF(__pyx_v_info->obj);
27354     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
27355   }
27356   __pyx_L2:;
27357   __Pyx_RefNannyFinishContext();
27358   return __pyx_r;
27359 }
27360 
27361 /* "View.MemoryView":211
27362  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
27363  *
27364  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
27365  *         if self.callback_free_data != NULL:
27366  *             self.callback_free_data(self.data)
27367  */
27368 
27369 /* Python wrapper */
27370 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)27371 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
27372   __Pyx_RefNannyDeclarations
27373   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
27374   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
27375 
27376   /* function exit code */
27377   __Pyx_RefNannyFinishContext();
27378 }
27379 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)27380 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
27381   __Pyx_RefNannyDeclarations
27382   int __pyx_t_1;
27383   __Pyx_RefNannySetupContext("__dealloc__", 0);
27384 
27385   /* "View.MemoryView":212
27386  *
27387  *     def __dealloc__(array self):
27388  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
27389  *             self.callback_free_data(self.data)
27390  *         elif self.free_data:
27391  */
27392   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
27393   if (__pyx_t_1) {
27394 
27395     /* "View.MemoryView":213
27396  *     def __dealloc__(array self):
27397  *         if self.callback_free_data != NULL:
27398  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
27399  *         elif self.free_data:
27400  *             if self.dtype_is_object:
27401  */
27402     __pyx_v_self->callback_free_data(__pyx_v_self->data);
27403 
27404     /* "View.MemoryView":212
27405  *
27406  *     def __dealloc__(array self):
27407  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
27408  *             self.callback_free_data(self.data)
27409  *         elif self.free_data:
27410  */
27411     goto __pyx_L3;
27412   }
27413 
27414   /* "View.MemoryView":214
27415  *         if self.callback_free_data != NULL:
27416  *             self.callback_free_data(self.data)
27417  *         elif self.free_data:             # <<<<<<<<<<<<<<
27418  *             if self.dtype_is_object:
27419  *                 refcount_objects_in_slice(self.data, self._shape,
27420  */
27421   __pyx_t_1 = (__pyx_v_self->free_data != 0);
27422   if (__pyx_t_1) {
27423 
27424     /* "View.MemoryView":215
27425  *             self.callback_free_data(self.data)
27426  *         elif self.free_data:
27427  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
27428  *                 refcount_objects_in_slice(self.data, self._shape,
27429  *                                           self._strides, self.ndim, False)
27430  */
27431     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
27432     if (__pyx_t_1) {
27433 
27434       /* "View.MemoryView":216
27435  *         elif self.free_data:
27436  *             if self.dtype_is_object:
27437  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
27438  *                                           self._strides, self.ndim, False)
27439  *             free(self.data)
27440  */
27441       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
27442 
27443       /* "View.MemoryView":215
27444  *             self.callback_free_data(self.data)
27445  *         elif self.free_data:
27446  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
27447  *                 refcount_objects_in_slice(self.data, self._shape,
27448  *                                           self._strides, self.ndim, False)
27449  */
27450     }
27451 
27452     /* "View.MemoryView":218
27453  *                 refcount_objects_in_slice(self.data, self._shape,
27454  *                                           self._strides, self.ndim, False)
27455  *             free(self.data)             # <<<<<<<<<<<<<<
27456  *         PyObject_Free(self._shape)
27457  *
27458  */
27459     free(__pyx_v_self->data);
27460 
27461     /* "View.MemoryView":214
27462  *         if self.callback_free_data != NULL:
27463  *             self.callback_free_data(self.data)
27464  *         elif self.free_data:             # <<<<<<<<<<<<<<
27465  *             if self.dtype_is_object:
27466  *                 refcount_objects_in_slice(self.data, self._shape,
27467  */
27468   }
27469   __pyx_L3:;
27470 
27471   /* "View.MemoryView":219
27472  *                                           self._strides, self.ndim, False)
27473  *             free(self.data)
27474  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
27475  *
27476  *     @property
27477  */
27478   PyObject_Free(__pyx_v_self->_shape);
27479 
27480   /* "View.MemoryView":211
27481  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
27482  *
27483  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
27484  *         if self.callback_free_data != NULL:
27485  *             self.callback_free_data(self.data)
27486  */
27487 
27488   /* function exit code */
27489   __Pyx_RefNannyFinishContext();
27490 }
27491 
27492 /* "View.MemoryView":222
27493  *
27494  *     @property
27495  *     def memview(self):             # <<<<<<<<<<<<<<
27496  *         return self.get_memview()
27497  *
27498  */
27499 
27500 /* Python wrapper */
27501 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject * __pyx_v_self)27502 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
27503   PyObject *__pyx_r = 0;
27504   __Pyx_RefNannyDeclarations
27505   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
27506   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
27507 
27508   /* function exit code */
27509   __Pyx_RefNannyFinishContext();
27510   return __pyx_r;
27511 }
27512 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)27513 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
27514   PyObject *__pyx_r = NULL;
27515   __Pyx_RefNannyDeclarations
27516   PyObject *__pyx_t_1 = NULL;
27517   __Pyx_RefNannySetupContext("__get__", 0);
27518 
27519   /* "View.MemoryView":223
27520  *     @property
27521  *     def memview(self):
27522  *         return self.get_memview()             # <<<<<<<<<<<<<<
27523  *
27524  *     @cname('get_memview')
27525  */
27526   __Pyx_XDECREF(__pyx_r);
27527   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
27528   __Pyx_GOTREF(__pyx_t_1);
27529   __pyx_r = __pyx_t_1;
27530   __pyx_t_1 = 0;
27531   goto __pyx_L0;
27532 
27533   /* "View.MemoryView":222
27534  *
27535  *     @property
27536  *     def memview(self):             # <<<<<<<<<<<<<<
27537  *         return self.get_memview()
27538  *
27539  */
27540 
27541   /* function exit code */
27542   __pyx_L1_error:;
27543   __Pyx_XDECREF(__pyx_t_1);
27544   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27545   __pyx_r = NULL;
27546   __pyx_L0:;
27547   __Pyx_XGIVEREF(__pyx_r);
27548   __Pyx_RefNannyFinishContext();
27549   return __pyx_r;
27550 }
27551 
27552 /* "View.MemoryView":226
27553  *
27554  *     @cname('get_memview')
27555  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
27556  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
27557  *         return  memoryview(self, flags, self.dtype_is_object)
27558  */
27559 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)27560 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
27561   int __pyx_v_flags;
27562   PyObject *__pyx_r = NULL;
27563   __Pyx_RefNannyDeclarations
27564   PyObject *__pyx_t_1 = NULL;
27565   PyObject *__pyx_t_2 = NULL;
27566   PyObject *__pyx_t_3 = NULL;
27567   __Pyx_RefNannySetupContext("get_memview", 0);
27568 
27569   /* "View.MemoryView":227
27570  *     @cname('get_memview')
27571  *     cdef get_memview(self):
27572  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
27573  *         return  memoryview(self, flags, self.dtype_is_object)
27574  *
27575  */
27576   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
27577 
27578   /* "View.MemoryView":228
27579  *     cdef get_memview(self):
27580  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
27581  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
27582  *
27583  *     def __len__(self):
27584  */
27585   __Pyx_XDECREF(__pyx_r);
27586   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
27587   __Pyx_GOTREF(__pyx_t_1);
27588   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
27589   __Pyx_GOTREF(__pyx_t_2);
27590   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
27591   __Pyx_GOTREF(__pyx_t_3);
27592   __Pyx_INCREF(((PyObject *)__pyx_v_self));
27593   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
27594   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
27595   __Pyx_GIVEREF(__pyx_t_1);
27596   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
27597   __Pyx_GIVEREF(__pyx_t_2);
27598   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
27599   __pyx_t_1 = 0;
27600   __pyx_t_2 = 0;
27601   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
27602   __Pyx_GOTREF(__pyx_t_2);
27603   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27604   __pyx_r = __pyx_t_2;
27605   __pyx_t_2 = 0;
27606   goto __pyx_L0;
27607 
27608   /* "View.MemoryView":226
27609  *
27610  *     @cname('get_memview')
27611  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
27612  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
27613  *         return  memoryview(self, flags, self.dtype_is_object)
27614  */
27615 
27616   /* function exit code */
27617   __pyx_L1_error:;
27618   __Pyx_XDECREF(__pyx_t_1);
27619   __Pyx_XDECREF(__pyx_t_2);
27620   __Pyx_XDECREF(__pyx_t_3);
27621   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
27622   __pyx_r = 0;
27623   __pyx_L0:;
27624   __Pyx_XGIVEREF(__pyx_r);
27625   __Pyx_RefNannyFinishContext();
27626   return __pyx_r;
27627 }
27628 
27629 /* "View.MemoryView":230
27630  *         return  memoryview(self, flags, self.dtype_is_object)
27631  *
27632  *     def __len__(self):             # <<<<<<<<<<<<<<
27633  *         return self._shape[0]
27634  *
27635  */
27636 
27637 /* Python wrapper */
27638 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)27639 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
27640   Py_ssize_t __pyx_r;
27641   __Pyx_RefNannyDeclarations
27642   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
27643   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
27644 
27645   /* function exit code */
27646   __Pyx_RefNannyFinishContext();
27647   return __pyx_r;
27648 }
27649 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)27650 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
27651   Py_ssize_t __pyx_r;
27652   __Pyx_RefNannyDeclarations
27653   __Pyx_RefNannySetupContext("__len__", 0);
27654 
27655   /* "View.MemoryView":231
27656  *
27657  *     def __len__(self):
27658  *         return self._shape[0]             # <<<<<<<<<<<<<<
27659  *
27660  *     def __getattr__(self, attr):
27661  */
27662   __pyx_r = (__pyx_v_self->_shape[0]);
27663   goto __pyx_L0;
27664 
27665   /* "View.MemoryView":230
27666  *         return  memoryview(self, flags, self.dtype_is_object)
27667  *
27668  *     def __len__(self):             # <<<<<<<<<<<<<<
27669  *         return self._shape[0]
27670  *
27671  */
27672 
27673   /* function exit code */
27674   __pyx_L0:;
27675   __Pyx_RefNannyFinishContext();
27676   return __pyx_r;
27677 }
27678 
27679 /* "View.MemoryView":233
27680  *         return self._shape[0]
27681  *
27682  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
27683  *         return getattr(self.memview, attr)
27684  *
27685  */
27686 
27687 /* Python wrapper */
27688 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
__pyx_array___getattr__(PyObject * __pyx_v_self,PyObject * __pyx_v_attr)27689 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
27690   PyObject *__pyx_r = 0;
27691   __Pyx_RefNannyDeclarations
27692   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
27693   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
27694 
27695   /* function exit code */
27696   __Pyx_RefNannyFinishContext();
27697   return __pyx_r;
27698 }
27699 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)27700 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
27701   PyObject *__pyx_r = NULL;
27702   __Pyx_RefNannyDeclarations
27703   PyObject *__pyx_t_1 = NULL;
27704   PyObject *__pyx_t_2 = NULL;
27705   __Pyx_RefNannySetupContext("__getattr__", 0);
27706 
27707   /* "View.MemoryView":234
27708  *
27709  *     def __getattr__(self, attr):
27710  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
27711  *
27712  *     def __getitem__(self, item):
27713  */
27714   __Pyx_XDECREF(__pyx_r);
27715   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
27716   __Pyx_GOTREF(__pyx_t_1);
27717   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
27718   __Pyx_GOTREF(__pyx_t_2);
27719   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27720   __pyx_r = __pyx_t_2;
27721   __pyx_t_2 = 0;
27722   goto __pyx_L0;
27723 
27724   /* "View.MemoryView":233
27725  *         return self._shape[0]
27726  *
27727  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
27728  *         return getattr(self.memview, attr)
27729  *
27730  */
27731 
27732   /* function exit code */
27733   __pyx_L1_error:;
27734   __Pyx_XDECREF(__pyx_t_1);
27735   __Pyx_XDECREF(__pyx_t_2);
27736   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27737   __pyx_r = NULL;
27738   __pyx_L0:;
27739   __Pyx_XGIVEREF(__pyx_r);
27740   __Pyx_RefNannyFinishContext();
27741   return __pyx_r;
27742 }
27743 
27744 /* "View.MemoryView":236
27745  *         return getattr(self.memview, attr)
27746  *
27747  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
27748  *         return self.memview[item]
27749  *
27750  */
27751 
27752 /* Python wrapper */
27753 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_array___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)27754 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
27755   PyObject *__pyx_r = 0;
27756   __Pyx_RefNannyDeclarations
27757   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
27758   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
27759 
27760   /* function exit code */
27761   __Pyx_RefNannyFinishContext();
27762   return __pyx_r;
27763 }
27764 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)27765 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
27766   PyObject *__pyx_r = NULL;
27767   __Pyx_RefNannyDeclarations
27768   PyObject *__pyx_t_1 = NULL;
27769   PyObject *__pyx_t_2 = NULL;
27770   __Pyx_RefNannySetupContext("__getitem__", 0);
27771 
27772   /* "View.MemoryView":237
27773  *
27774  *     def __getitem__(self, item):
27775  *         return self.memview[item]             # <<<<<<<<<<<<<<
27776  *
27777  *     def __setitem__(self, item, value):
27778  */
27779   __Pyx_XDECREF(__pyx_r);
27780   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
27781   __Pyx_GOTREF(__pyx_t_1);
27782   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
27783   __Pyx_GOTREF(__pyx_t_2);
27784   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27785   __pyx_r = __pyx_t_2;
27786   __pyx_t_2 = 0;
27787   goto __pyx_L0;
27788 
27789   /* "View.MemoryView":236
27790  *         return getattr(self.memview, attr)
27791  *
27792  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
27793  *         return self.memview[item]
27794  *
27795  */
27796 
27797   /* function exit code */
27798   __pyx_L1_error:;
27799   __Pyx_XDECREF(__pyx_t_1);
27800   __Pyx_XDECREF(__pyx_t_2);
27801   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27802   __pyx_r = NULL;
27803   __pyx_L0:;
27804   __Pyx_XGIVEREF(__pyx_r);
27805   __Pyx_RefNannyFinishContext();
27806   return __pyx_r;
27807 }
27808 
27809 /* "View.MemoryView":239
27810  *         return self.memview[item]
27811  *
27812  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
27813  *         self.memview[item] = value
27814  *
27815  */
27816 
27817 /* Python wrapper */
27818 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
__pyx_array___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)27819 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
27820   int __pyx_r;
27821   __Pyx_RefNannyDeclarations
27822   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
27823   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
27824 
27825   /* function exit code */
27826   __Pyx_RefNannyFinishContext();
27827   return __pyx_r;
27828 }
27829 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item,PyObject * __pyx_v_value)27830 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
27831   int __pyx_r;
27832   __Pyx_RefNannyDeclarations
27833   PyObject *__pyx_t_1 = NULL;
27834   __Pyx_RefNannySetupContext("__setitem__", 0);
27835 
27836   /* "View.MemoryView":240
27837  *
27838  *     def __setitem__(self, item, value):
27839  *         self.memview[item] = value             # <<<<<<<<<<<<<<
27840  *
27841  *
27842  */
27843   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
27844   __Pyx_GOTREF(__pyx_t_1);
27845   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
27846   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27847 
27848   /* "View.MemoryView":239
27849  *         return self.memview[item]
27850  *
27851  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
27852  *         self.memview[item] = value
27853  *
27854  */
27855 
27856   /* function exit code */
27857   __pyx_r = 0;
27858   goto __pyx_L0;
27859   __pyx_L1_error:;
27860   __Pyx_XDECREF(__pyx_t_1);
27861   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27862   __pyx_r = -1;
27863   __pyx_L0:;
27864   __Pyx_RefNannyFinishContext();
27865   return __pyx_r;
27866 }
27867 
27868 /* "(tree fragment)":1
27869  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
27870  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27871  * def __setstate_cython__(self, __pyx_state):
27872  */
27873 
27874 /* Python wrapper */
27875 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_array_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)27876 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
27877   PyObject *__pyx_r = 0;
27878   __Pyx_RefNannyDeclarations
27879   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
27880   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
27881 
27882   /* function exit code */
27883   __Pyx_RefNannyFinishContext();
27884   return __pyx_r;
27885 }
27886 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)27887 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
27888   PyObject *__pyx_r = NULL;
27889   __Pyx_RefNannyDeclarations
27890   PyObject *__pyx_t_1 = NULL;
27891   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
27892 
27893   /* "(tree fragment)":2
27894  * def __reduce_cython__(self):
27895  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27896  * def __setstate_cython__(self, __pyx_state):
27897  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27898  */
27899   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
27900   __Pyx_GOTREF(__pyx_t_1);
27901   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27902   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27903   __PYX_ERR(1, 2, __pyx_L1_error)
27904 
27905   /* "(tree fragment)":1
27906  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
27907  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27908  * def __setstate_cython__(self, __pyx_state):
27909  */
27910 
27911   /* function exit code */
27912   __pyx_L1_error:;
27913   __Pyx_XDECREF(__pyx_t_1);
27914   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27915   __pyx_r = NULL;
27916   __Pyx_XGIVEREF(__pyx_r);
27917   __Pyx_RefNannyFinishContext();
27918   return __pyx_r;
27919 }
27920 
27921 /* "(tree fragment)":3
27922  * def __reduce_cython__(self):
27923  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27924  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
27925  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27926  */
27927 
27928 /* Python wrapper */
27929 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_array_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)27930 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
27931   PyObject *__pyx_r = 0;
27932   __Pyx_RefNannyDeclarations
27933   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
27934   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
27935 
27936   /* function exit code */
27937   __Pyx_RefNannyFinishContext();
27938   return __pyx_r;
27939 }
27940 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)27941 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
27942   PyObject *__pyx_r = NULL;
27943   __Pyx_RefNannyDeclarations
27944   PyObject *__pyx_t_1 = NULL;
27945   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
27946 
27947   /* "(tree fragment)":4
27948  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27949  * def __setstate_cython__(self, __pyx_state):
27950  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
27951  */
27952   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
27953   __Pyx_GOTREF(__pyx_t_1);
27954   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27955   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27956   __PYX_ERR(1, 4, __pyx_L1_error)
27957 
27958   /* "(tree fragment)":3
27959  * def __reduce_cython__(self):
27960  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27961  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
27962  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
27963  */
27964 
27965   /* function exit code */
27966   __pyx_L1_error:;
27967   __Pyx_XDECREF(__pyx_t_1);
27968   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27969   __pyx_r = NULL;
27970   __Pyx_XGIVEREF(__pyx_r);
27971   __Pyx_RefNannyFinishContext();
27972   return __pyx_r;
27973 }
27974 
27975 /* "View.MemoryView":244
27976  *
27977  * @cname("__pyx_array_new")
27978  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
27979  *                           char *mode, char *buf):
27980  *     cdef array result
27981  */
27982 
__pyx_array_new(PyObject * __pyx_v_shape,Py_ssize_t __pyx_v_itemsize,char * __pyx_v_format,char * __pyx_v_mode,char * __pyx_v_buf)27983 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
27984   struct __pyx_array_obj *__pyx_v_result = 0;
27985   struct __pyx_array_obj *__pyx_r = NULL;
27986   __Pyx_RefNannyDeclarations
27987   int __pyx_t_1;
27988   PyObject *__pyx_t_2 = NULL;
27989   PyObject *__pyx_t_3 = NULL;
27990   PyObject *__pyx_t_4 = NULL;
27991   PyObject *__pyx_t_5 = NULL;
27992   __Pyx_RefNannySetupContext("array_cwrapper", 0);
27993 
27994   /* "View.MemoryView":248
27995  *     cdef array result
27996  *
27997  *     if buf == NULL:             # <<<<<<<<<<<<<<
27998  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
27999  *     else:
28000  */
28001   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
28002   if (__pyx_t_1) {
28003 
28004     /* "View.MemoryView":249
28005  *
28006  *     if buf == NULL:
28007  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
28008  *     else:
28009  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
28010  */
28011     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
28012     __Pyx_GOTREF(__pyx_t_2);
28013     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
28014     __Pyx_GOTREF(__pyx_t_3);
28015     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
28016     __Pyx_GOTREF(__pyx_t_4);
28017     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
28018     __Pyx_GOTREF(__pyx_t_5);
28019     __Pyx_INCREF(__pyx_v_shape);
28020     __Pyx_GIVEREF(__pyx_v_shape);
28021     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
28022     __Pyx_GIVEREF(__pyx_t_2);
28023     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
28024     __Pyx_GIVEREF(__pyx_t_3);
28025     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
28026     __Pyx_GIVEREF(__pyx_t_4);
28027     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
28028     __pyx_t_2 = 0;
28029     __pyx_t_3 = 0;
28030     __pyx_t_4 = 0;
28031     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
28032     __Pyx_GOTREF(__pyx_t_4);
28033     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28034     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
28035     __pyx_t_4 = 0;
28036 
28037     /* "View.MemoryView":248
28038  *     cdef array result
28039  *
28040  *     if buf == NULL:             # <<<<<<<<<<<<<<
28041  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
28042  *     else:
28043  */
28044     goto __pyx_L3;
28045   }
28046 
28047   /* "View.MemoryView":251
28048  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
28049  *     else:
28050  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
28051  *                        allocate_buffer=False)
28052  *         result.data = buf
28053  */
28054   /*else*/ {
28055     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
28056     __Pyx_GOTREF(__pyx_t_4);
28057     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
28058     __Pyx_GOTREF(__pyx_t_5);
28059     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
28060     __Pyx_GOTREF(__pyx_t_3);
28061     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
28062     __Pyx_GOTREF(__pyx_t_2);
28063     __Pyx_INCREF(__pyx_v_shape);
28064     __Pyx_GIVEREF(__pyx_v_shape);
28065     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
28066     __Pyx_GIVEREF(__pyx_t_4);
28067     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
28068     __Pyx_GIVEREF(__pyx_t_5);
28069     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
28070     __Pyx_GIVEREF(__pyx_t_3);
28071     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
28072     __pyx_t_4 = 0;
28073     __pyx_t_5 = 0;
28074     __pyx_t_3 = 0;
28075 
28076     /* "View.MemoryView":252
28077  *     else:
28078  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
28079  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
28080  *         result.data = buf
28081  *
28082  */
28083     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
28084     __Pyx_GOTREF(__pyx_t_3);
28085     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
28086 
28087     /* "View.MemoryView":251
28088  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
28089  *     else:
28090  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
28091  *                        allocate_buffer=False)
28092  *         result.data = buf
28093  */
28094     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
28095     __Pyx_GOTREF(__pyx_t_5);
28096     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28097     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28098     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
28099     __pyx_t_5 = 0;
28100 
28101     /* "View.MemoryView":253
28102  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
28103  *                        allocate_buffer=False)
28104  *         result.data = buf             # <<<<<<<<<<<<<<
28105  *
28106  *     return result
28107  */
28108     __pyx_v_result->data = __pyx_v_buf;
28109   }
28110   __pyx_L3:;
28111 
28112   /* "View.MemoryView":255
28113  *         result.data = buf
28114  *
28115  *     return result             # <<<<<<<<<<<<<<
28116  *
28117  *
28118  */
28119   __Pyx_XDECREF(((PyObject *)__pyx_r));
28120   __Pyx_INCREF(((PyObject *)__pyx_v_result));
28121   __pyx_r = __pyx_v_result;
28122   goto __pyx_L0;
28123 
28124   /* "View.MemoryView":244
28125  *
28126  * @cname("__pyx_array_new")
28127  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
28128  *                           char *mode, char *buf):
28129  *     cdef array result
28130  */
28131 
28132   /* function exit code */
28133   __pyx_L1_error:;
28134   __Pyx_XDECREF(__pyx_t_2);
28135   __Pyx_XDECREF(__pyx_t_3);
28136   __Pyx_XDECREF(__pyx_t_4);
28137   __Pyx_XDECREF(__pyx_t_5);
28138   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
28139   __pyx_r = 0;
28140   __pyx_L0:;
28141   __Pyx_XDECREF((PyObject *)__pyx_v_result);
28142   __Pyx_XGIVEREF((PyObject *)__pyx_r);
28143   __Pyx_RefNannyFinishContext();
28144   return __pyx_r;
28145 }
28146 
28147 /* "View.MemoryView":281
28148  * cdef class Enum(object):
28149  *     cdef object name
28150  *     def __init__(self, name):             # <<<<<<<<<<<<<<
28151  *         self.name = name
28152  *     def __repr__(self):
28153  */
28154 
28155 /* Python wrapper */
28156 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_MemviewEnum___init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)28157 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28158   PyObject *__pyx_v_name = 0;
28159   int __pyx_r;
28160   __Pyx_RefNannyDeclarations
28161   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
28162   {
28163     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
28164     PyObject* values[1] = {0};
28165     if (unlikely(__pyx_kwds)) {
28166       Py_ssize_t kw_args;
28167       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28168       switch (pos_args) {
28169         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28170         CYTHON_FALLTHROUGH;
28171         case  0: break;
28172         default: goto __pyx_L5_argtuple_error;
28173       }
28174       kw_args = PyDict_Size(__pyx_kwds);
28175       switch (pos_args) {
28176         case  0:
28177         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
28178         else goto __pyx_L5_argtuple_error;
28179       }
28180       if (unlikely(kw_args > 0)) {
28181         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
28182       }
28183     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
28184       goto __pyx_L5_argtuple_error;
28185     } else {
28186       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28187     }
28188     __pyx_v_name = values[0];
28189   }
28190   goto __pyx_L4_argument_unpacking_done;
28191   __pyx_L5_argtuple_error:;
28192   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
28193   __pyx_L3_error:;
28194   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28195   __Pyx_RefNannyFinishContext();
28196   return -1;
28197   __pyx_L4_argument_unpacking_done:;
28198   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
28199 
28200   /* function exit code */
28201   __Pyx_RefNannyFinishContext();
28202   return __pyx_r;
28203 }
28204 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)28205 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
28206   int __pyx_r;
28207   __Pyx_RefNannyDeclarations
28208   __Pyx_RefNannySetupContext("__init__", 0);
28209 
28210   /* "View.MemoryView":282
28211  *     cdef object name
28212  *     def __init__(self, name):
28213  *         self.name = name             # <<<<<<<<<<<<<<
28214  *     def __repr__(self):
28215  *         return self.name
28216  */
28217   __Pyx_INCREF(__pyx_v_name);
28218   __Pyx_GIVEREF(__pyx_v_name);
28219   __Pyx_GOTREF(__pyx_v_self->name);
28220   __Pyx_DECREF(__pyx_v_self->name);
28221   __pyx_v_self->name = __pyx_v_name;
28222 
28223   /* "View.MemoryView":281
28224  * cdef class Enum(object):
28225  *     cdef object name
28226  *     def __init__(self, name):             # <<<<<<<<<<<<<<
28227  *         self.name = name
28228  *     def __repr__(self):
28229  */
28230 
28231   /* function exit code */
28232   __pyx_r = 0;
28233   __Pyx_RefNannyFinishContext();
28234   return __pyx_r;
28235 }
28236 
28237 /* "View.MemoryView":283
28238  *     def __init__(self, name):
28239  *         self.name = name
28240  *     def __repr__(self):             # <<<<<<<<<<<<<<
28241  *         return self.name
28242  *
28243  */
28244 
28245 /* Python wrapper */
28246 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)28247 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
28248   PyObject *__pyx_r = 0;
28249   __Pyx_RefNannyDeclarations
28250   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
28251   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
28252 
28253   /* function exit code */
28254   __Pyx_RefNannyFinishContext();
28255   return __pyx_r;
28256 }
28257 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)28258 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
28259   PyObject *__pyx_r = NULL;
28260   __Pyx_RefNannyDeclarations
28261   __Pyx_RefNannySetupContext("__repr__", 0);
28262 
28263   /* "View.MemoryView":284
28264  *         self.name = name
28265  *     def __repr__(self):
28266  *         return self.name             # <<<<<<<<<<<<<<
28267  *
28268  * cdef generic = Enum("<strided and direct or indirect>")
28269  */
28270   __Pyx_XDECREF(__pyx_r);
28271   __Pyx_INCREF(__pyx_v_self->name);
28272   __pyx_r = __pyx_v_self->name;
28273   goto __pyx_L0;
28274 
28275   /* "View.MemoryView":283
28276  *     def __init__(self, name):
28277  *         self.name = name
28278  *     def __repr__(self):             # <<<<<<<<<<<<<<
28279  *         return self.name
28280  *
28281  */
28282 
28283   /* function exit code */
28284   __pyx_L0:;
28285   __Pyx_XGIVEREF(__pyx_r);
28286   __Pyx_RefNannyFinishContext();
28287   return __pyx_r;
28288 }
28289 
28290 /* "(tree fragment)":1
28291  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
28292  *     cdef tuple state
28293  *     cdef object _dict
28294  */
28295 
28296 /* Python wrapper */
28297 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)28298 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
28299   PyObject *__pyx_r = 0;
28300   __Pyx_RefNannyDeclarations
28301   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
28302   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
28303 
28304   /* function exit code */
28305   __Pyx_RefNannyFinishContext();
28306   return __pyx_r;
28307 }
28308 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)28309 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
28310   PyObject *__pyx_v_state = 0;
28311   PyObject *__pyx_v__dict = 0;
28312   int __pyx_v_use_setstate;
28313   PyObject *__pyx_r = NULL;
28314   __Pyx_RefNannyDeclarations
28315   PyObject *__pyx_t_1 = NULL;
28316   int __pyx_t_2;
28317   int __pyx_t_3;
28318   PyObject *__pyx_t_4 = NULL;
28319   PyObject *__pyx_t_5 = NULL;
28320   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
28321 
28322   /* "(tree fragment)":5
28323  *     cdef object _dict
28324  *     cdef bint use_setstate
28325  *     state = (self.name,)             # <<<<<<<<<<<<<<
28326  *     _dict = getattr(self, '__dict__', None)
28327  *     if _dict is not None:
28328  */
28329   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
28330   __Pyx_GOTREF(__pyx_t_1);
28331   __Pyx_INCREF(__pyx_v_self->name);
28332   __Pyx_GIVEREF(__pyx_v_self->name);
28333   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
28334   __pyx_v_state = ((PyObject*)__pyx_t_1);
28335   __pyx_t_1 = 0;
28336 
28337   /* "(tree fragment)":6
28338  *     cdef bint use_setstate
28339  *     state = (self.name,)
28340  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
28341  *     if _dict is not None:
28342  *         state += (_dict,)
28343  */
28344   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
28345   __Pyx_GOTREF(__pyx_t_1);
28346   __pyx_v__dict = __pyx_t_1;
28347   __pyx_t_1 = 0;
28348 
28349   /* "(tree fragment)":7
28350  *     state = (self.name,)
28351  *     _dict = getattr(self, '__dict__', None)
28352  *     if _dict is not None:             # <<<<<<<<<<<<<<
28353  *         state += (_dict,)
28354  *         use_setstate = True
28355  */
28356   __pyx_t_2 = (__pyx_v__dict != Py_None);
28357   __pyx_t_3 = (__pyx_t_2 != 0);
28358   if (__pyx_t_3) {
28359 
28360     /* "(tree fragment)":8
28361  *     _dict = getattr(self, '__dict__', None)
28362  *     if _dict is not None:
28363  *         state += (_dict,)             # <<<<<<<<<<<<<<
28364  *         use_setstate = True
28365  *     else:
28366  */
28367     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
28368     __Pyx_GOTREF(__pyx_t_1);
28369     __Pyx_INCREF(__pyx_v__dict);
28370     __Pyx_GIVEREF(__pyx_v__dict);
28371     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
28372     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
28373     __Pyx_GOTREF(__pyx_t_4);
28374     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28375     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
28376     __pyx_t_4 = 0;
28377 
28378     /* "(tree fragment)":9
28379  *     if _dict is not None:
28380  *         state += (_dict,)
28381  *         use_setstate = True             # <<<<<<<<<<<<<<
28382  *     else:
28383  *         use_setstate = self.name is not None
28384  */
28385     __pyx_v_use_setstate = 1;
28386 
28387     /* "(tree fragment)":7
28388  *     state = (self.name,)
28389  *     _dict = getattr(self, '__dict__', None)
28390  *     if _dict is not None:             # <<<<<<<<<<<<<<
28391  *         state += (_dict,)
28392  *         use_setstate = True
28393  */
28394     goto __pyx_L3;
28395   }
28396 
28397   /* "(tree fragment)":11
28398  *         use_setstate = True
28399  *     else:
28400  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
28401  *     if use_setstate:
28402  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
28403  */
28404   /*else*/ {
28405     __pyx_t_3 = (__pyx_v_self->name != Py_None);
28406     __pyx_v_use_setstate = __pyx_t_3;
28407   }
28408   __pyx_L3:;
28409 
28410   /* "(tree fragment)":12
28411  *     else:
28412  *         use_setstate = self.name is not None
28413  *     if use_setstate:             # <<<<<<<<<<<<<<
28414  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
28415  *     else:
28416  */
28417   __pyx_t_3 = (__pyx_v_use_setstate != 0);
28418   if (__pyx_t_3) {
28419 
28420     /* "(tree fragment)":13
28421  *         use_setstate = self.name is not None
28422  *     if use_setstate:
28423  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
28424  *     else:
28425  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
28426  */
28427     __Pyx_XDECREF(__pyx_r);
28428     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
28429     __Pyx_GOTREF(__pyx_t_4);
28430     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
28431     __Pyx_GOTREF(__pyx_t_1);
28432     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28433     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28434     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28435     __Pyx_INCREF(__pyx_int_184977713);
28436     __Pyx_GIVEREF(__pyx_int_184977713);
28437     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
28438     __Pyx_INCREF(Py_None);
28439     __Pyx_GIVEREF(Py_None);
28440     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
28441     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
28442     __Pyx_GOTREF(__pyx_t_5);
28443     __Pyx_GIVEREF(__pyx_t_4);
28444     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
28445     __Pyx_GIVEREF(__pyx_t_1);
28446     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
28447     __Pyx_INCREF(__pyx_v_state);
28448     __Pyx_GIVEREF(__pyx_v_state);
28449     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
28450     __pyx_t_4 = 0;
28451     __pyx_t_1 = 0;
28452     __pyx_r = __pyx_t_5;
28453     __pyx_t_5 = 0;
28454     goto __pyx_L0;
28455 
28456     /* "(tree fragment)":12
28457  *     else:
28458  *         use_setstate = self.name is not None
28459  *     if use_setstate:             # <<<<<<<<<<<<<<
28460  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
28461  *     else:
28462  */
28463   }
28464 
28465   /* "(tree fragment)":15
28466  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
28467  *     else:
28468  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
28469  * def __setstate_cython__(self, __pyx_state):
28470  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
28471  */
28472   /*else*/ {
28473     __Pyx_XDECREF(__pyx_r);
28474     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
28475     __Pyx_GOTREF(__pyx_t_5);
28476     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
28477     __Pyx_GOTREF(__pyx_t_1);
28478     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28479     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28480     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
28481     __Pyx_INCREF(__pyx_int_184977713);
28482     __Pyx_GIVEREF(__pyx_int_184977713);
28483     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
28484     __Pyx_INCREF(__pyx_v_state);
28485     __Pyx_GIVEREF(__pyx_v_state);
28486     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
28487     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
28488     __Pyx_GOTREF(__pyx_t_4);
28489     __Pyx_GIVEREF(__pyx_t_5);
28490     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
28491     __Pyx_GIVEREF(__pyx_t_1);
28492     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
28493     __pyx_t_5 = 0;
28494     __pyx_t_1 = 0;
28495     __pyx_r = __pyx_t_4;
28496     __pyx_t_4 = 0;
28497     goto __pyx_L0;
28498   }
28499 
28500   /* "(tree fragment)":1
28501  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
28502  *     cdef tuple state
28503  *     cdef object _dict
28504  */
28505 
28506   /* function exit code */
28507   __pyx_L1_error:;
28508   __Pyx_XDECREF(__pyx_t_1);
28509   __Pyx_XDECREF(__pyx_t_4);
28510   __Pyx_XDECREF(__pyx_t_5);
28511   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28512   __pyx_r = NULL;
28513   __pyx_L0:;
28514   __Pyx_XDECREF(__pyx_v_state);
28515   __Pyx_XDECREF(__pyx_v__dict);
28516   __Pyx_XGIVEREF(__pyx_r);
28517   __Pyx_RefNannyFinishContext();
28518   return __pyx_r;
28519 }
28520 
28521 /* "(tree fragment)":16
28522  *     else:
28523  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
28524  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
28525  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
28526  */
28527 
28528 /* Python wrapper */
28529 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)28530 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
28531   PyObject *__pyx_r = 0;
28532   __Pyx_RefNannyDeclarations
28533   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
28534   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
28535 
28536   /* function exit code */
28537   __Pyx_RefNannyFinishContext();
28538   return __pyx_r;
28539 }
28540 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)28541 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
28542   PyObject *__pyx_r = NULL;
28543   __Pyx_RefNannyDeclarations
28544   PyObject *__pyx_t_1 = NULL;
28545   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
28546 
28547   /* "(tree fragment)":17
28548  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
28549  * def __setstate_cython__(self, __pyx_state):
28550  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
28551  */
28552   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
28553   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
28554   __Pyx_GOTREF(__pyx_t_1);
28555   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28556 
28557   /* "(tree fragment)":16
28558  *     else:
28559  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
28560  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
28561  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
28562  */
28563 
28564   /* function exit code */
28565   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28566   goto __pyx_L0;
28567   __pyx_L1_error:;
28568   __Pyx_XDECREF(__pyx_t_1);
28569   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28570   __pyx_r = NULL;
28571   __pyx_L0:;
28572   __Pyx_XGIVEREF(__pyx_r);
28573   __Pyx_RefNannyFinishContext();
28574   return __pyx_r;
28575 }
28576 
28577 /* "View.MemoryView":298
28578  *
28579  * @cname('__pyx_align_pointer')
28580  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
28581  *     "Align pointer memory on a given boundary"
28582  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
28583  */
28584 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)28585 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
28586   Py_intptr_t __pyx_v_aligned_p;
28587   size_t __pyx_v_offset;
28588   void *__pyx_r;
28589   int __pyx_t_1;
28590 
28591   /* "View.MemoryView":300
28592  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
28593  *     "Align pointer memory on a given boundary"
28594  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
28595  *     cdef size_t offset
28596  *
28597  */
28598   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
28599 
28600   /* "View.MemoryView":304
28601  *
28602  *     with cython.cdivision(True):
28603  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
28604  *
28605  *     if offset > 0:
28606  */
28607   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
28608 
28609   /* "View.MemoryView":306
28610  *         offset = aligned_p % alignment
28611  *
28612  *     if offset > 0:             # <<<<<<<<<<<<<<
28613  *         aligned_p += alignment - offset
28614  *
28615  */
28616   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
28617   if (__pyx_t_1) {
28618 
28619     /* "View.MemoryView":307
28620  *
28621  *     if offset > 0:
28622  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
28623  *
28624  *     return <void *> aligned_p
28625  */
28626     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
28627 
28628     /* "View.MemoryView":306
28629  *         offset = aligned_p % alignment
28630  *
28631  *     if offset > 0:             # <<<<<<<<<<<<<<
28632  *         aligned_p += alignment - offset
28633  *
28634  */
28635   }
28636 
28637   /* "View.MemoryView":309
28638  *         aligned_p += alignment - offset
28639  *
28640  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
28641  *
28642  *
28643  */
28644   __pyx_r = ((void *)__pyx_v_aligned_p);
28645   goto __pyx_L0;
28646 
28647   /* "View.MemoryView":298
28648  *
28649  * @cname('__pyx_align_pointer')
28650  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
28651  *     "Align pointer memory on a given boundary"
28652  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
28653  */
28654 
28655   /* function exit code */
28656   __pyx_L0:;
28657   return __pyx_r;
28658 }
28659 
28660 /* "View.MemoryView":345
28661  *     cdef __Pyx_TypeInfo *typeinfo
28662  *
28663  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
28664  *         self.obj = obj
28665  *         self.flags = flags
28666  */
28667 
28668 /* Python wrapper */
28669 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_memoryview___cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)28670 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28671   PyObject *__pyx_v_obj = 0;
28672   int __pyx_v_flags;
28673   int __pyx_v_dtype_is_object;
28674   int __pyx_r;
28675   __Pyx_RefNannyDeclarations
28676   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
28677   {
28678     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
28679     PyObject* values[3] = {0,0,0};
28680     if (unlikely(__pyx_kwds)) {
28681       Py_ssize_t kw_args;
28682       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28683       switch (pos_args) {
28684         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28685         CYTHON_FALLTHROUGH;
28686         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28687         CYTHON_FALLTHROUGH;
28688         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28689         CYTHON_FALLTHROUGH;
28690         case  0: break;
28691         default: goto __pyx_L5_argtuple_error;
28692       }
28693       kw_args = PyDict_Size(__pyx_kwds);
28694       switch (pos_args) {
28695         case  0:
28696         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
28697         else goto __pyx_L5_argtuple_error;
28698         CYTHON_FALLTHROUGH;
28699         case  1:
28700         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
28701         else {
28702           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
28703         }
28704         CYTHON_FALLTHROUGH;
28705         case  2:
28706         if (kw_args > 0) {
28707           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
28708           if (value) { values[2] = value; kw_args--; }
28709         }
28710       }
28711       if (unlikely(kw_args > 0)) {
28712         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
28713       }
28714     } else {
28715       switch (PyTuple_GET_SIZE(__pyx_args)) {
28716         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28717         CYTHON_FALLTHROUGH;
28718         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28719         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28720         break;
28721         default: goto __pyx_L5_argtuple_error;
28722       }
28723     }
28724     __pyx_v_obj = values[0];
28725     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
28726     if (values[2]) {
28727       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
28728     } else {
28729       __pyx_v_dtype_is_object = ((int)0);
28730     }
28731   }
28732   goto __pyx_L4_argument_unpacking_done;
28733   __pyx_L5_argtuple_error:;
28734   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
28735   __pyx_L3_error:;
28736   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28737   __Pyx_RefNannyFinishContext();
28738   return -1;
28739   __pyx_L4_argument_unpacking_done:;
28740   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
28741 
28742   /* function exit code */
28743   __Pyx_RefNannyFinishContext();
28744   return __pyx_r;
28745 }
28746 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj,int __pyx_v_flags,int __pyx_v_dtype_is_object)28747 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
28748   int __pyx_r;
28749   __Pyx_RefNannyDeclarations
28750   int __pyx_t_1;
28751   int __pyx_t_2;
28752   int __pyx_t_3;
28753   int __pyx_t_4;
28754   __Pyx_RefNannySetupContext("__cinit__", 0);
28755 
28756   /* "View.MemoryView":346
28757  *
28758  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
28759  *         self.obj = obj             # <<<<<<<<<<<<<<
28760  *         self.flags = flags
28761  *         if type(self) is memoryview or obj is not None:
28762  */
28763   __Pyx_INCREF(__pyx_v_obj);
28764   __Pyx_GIVEREF(__pyx_v_obj);
28765   __Pyx_GOTREF(__pyx_v_self->obj);
28766   __Pyx_DECREF(__pyx_v_self->obj);
28767   __pyx_v_self->obj = __pyx_v_obj;
28768 
28769   /* "View.MemoryView":347
28770  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
28771  *         self.obj = obj
28772  *         self.flags = flags             # <<<<<<<<<<<<<<
28773  *         if type(self) is memoryview or obj is not None:
28774  *             __Pyx_GetBuffer(obj, &self.view, flags)
28775  */
28776   __pyx_v_self->flags = __pyx_v_flags;
28777 
28778   /* "View.MemoryView":348
28779  *         self.obj = obj
28780  *         self.flags = flags
28781  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
28782  *             __Pyx_GetBuffer(obj, &self.view, flags)
28783  *             if <PyObject *> self.view.obj == NULL:
28784  */
28785   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
28786   __pyx_t_3 = (__pyx_t_2 != 0);
28787   if (!__pyx_t_3) {
28788   } else {
28789     __pyx_t_1 = __pyx_t_3;
28790     goto __pyx_L4_bool_binop_done;
28791   }
28792   __pyx_t_3 = (__pyx_v_obj != Py_None);
28793   __pyx_t_2 = (__pyx_t_3 != 0);
28794   __pyx_t_1 = __pyx_t_2;
28795   __pyx_L4_bool_binop_done:;
28796   if (__pyx_t_1) {
28797 
28798     /* "View.MemoryView":349
28799  *         self.flags = flags
28800  *         if type(self) is memoryview or obj is not None:
28801  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
28802  *             if <PyObject *> self.view.obj == NULL:
28803  *                 (<__pyx_buffer *> &self.view).obj = Py_None
28804  */
28805     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
28806 
28807     /* "View.MemoryView":350
28808  *         if type(self) is memoryview or obj is not None:
28809  *             __Pyx_GetBuffer(obj, &self.view, flags)
28810  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
28811  *                 (<__pyx_buffer *> &self.view).obj = Py_None
28812  *                 Py_INCREF(Py_None)
28813  */
28814     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
28815     if (__pyx_t_1) {
28816 
28817       /* "View.MemoryView":351
28818  *             __Pyx_GetBuffer(obj, &self.view, flags)
28819  *             if <PyObject *> self.view.obj == NULL:
28820  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
28821  *                 Py_INCREF(Py_None)
28822  *
28823  */
28824       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
28825 
28826       /* "View.MemoryView":352
28827  *             if <PyObject *> self.view.obj == NULL:
28828  *                 (<__pyx_buffer *> &self.view).obj = Py_None
28829  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
28830  *
28831  *         global __pyx_memoryview_thread_locks_used
28832  */
28833       Py_INCREF(Py_None);
28834 
28835       /* "View.MemoryView":350
28836  *         if type(self) is memoryview or obj is not None:
28837  *             __Pyx_GetBuffer(obj, &self.view, flags)
28838  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
28839  *                 (<__pyx_buffer *> &self.view).obj = Py_None
28840  *                 Py_INCREF(Py_None)
28841  */
28842     }
28843 
28844     /* "View.MemoryView":348
28845  *         self.obj = obj
28846  *         self.flags = flags
28847  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
28848  *             __Pyx_GetBuffer(obj, &self.view, flags)
28849  *             if <PyObject *> self.view.obj == NULL:
28850  */
28851   }
28852 
28853   /* "View.MemoryView":355
28854  *
28855  *         global __pyx_memoryview_thread_locks_used
28856  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
28857  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
28858  *             __pyx_memoryview_thread_locks_used += 1
28859  */
28860   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
28861   if (__pyx_t_1) {
28862 
28863     /* "View.MemoryView":356
28864  *         global __pyx_memoryview_thread_locks_used
28865  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
28866  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
28867  *             __pyx_memoryview_thread_locks_used += 1
28868  *         if self.lock is NULL:
28869  */
28870     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
28871 
28872     /* "View.MemoryView":357
28873  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
28874  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
28875  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
28876  *         if self.lock is NULL:
28877  *             self.lock = PyThread_allocate_lock()
28878  */
28879     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
28880 
28881     /* "View.MemoryView":355
28882  *
28883  *         global __pyx_memoryview_thread_locks_used
28884  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
28885  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
28886  *             __pyx_memoryview_thread_locks_used += 1
28887  */
28888   }
28889 
28890   /* "View.MemoryView":358
28891  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
28892  *             __pyx_memoryview_thread_locks_used += 1
28893  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
28894  *             self.lock = PyThread_allocate_lock()
28895  *             if self.lock is NULL:
28896  */
28897   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
28898   if (__pyx_t_1) {
28899 
28900     /* "View.MemoryView":359
28901  *             __pyx_memoryview_thread_locks_used += 1
28902  *         if self.lock is NULL:
28903  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
28904  *             if self.lock is NULL:
28905  *                 raise MemoryError
28906  */
28907     __pyx_v_self->lock = PyThread_allocate_lock();
28908 
28909     /* "View.MemoryView":360
28910  *         if self.lock is NULL:
28911  *             self.lock = PyThread_allocate_lock()
28912  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
28913  *                 raise MemoryError
28914  *
28915  */
28916     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
28917     if (unlikely(__pyx_t_1)) {
28918 
28919       /* "View.MemoryView":361
28920  *             self.lock = PyThread_allocate_lock()
28921  *             if self.lock is NULL:
28922  *                 raise MemoryError             # <<<<<<<<<<<<<<
28923  *
28924  *         if flags & PyBUF_FORMAT:
28925  */
28926       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
28927 
28928       /* "View.MemoryView":360
28929  *         if self.lock is NULL:
28930  *             self.lock = PyThread_allocate_lock()
28931  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
28932  *                 raise MemoryError
28933  *
28934  */
28935     }
28936 
28937     /* "View.MemoryView":358
28938  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
28939  *             __pyx_memoryview_thread_locks_used += 1
28940  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
28941  *             self.lock = PyThread_allocate_lock()
28942  *             if self.lock is NULL:
28943  */
28944   }
28945 
28946   /* "View.MemoryView":363
28947  *                 raise MemoryError
28948  *
28949  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
28950  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
28951  *         else:
28952  */
28953   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
28954   if (__pyx_t_1) {
28955 
28956     /* "View.MemoryView":364
28957  *
28958  *         if flags & PyBUF_FORMAT:
28959  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
28960  *         else:
28961  *             self.dtype_is_object = dtype_is_object
28962  */
28963     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
28964     if (__pyx_t_2) {
28965     } else {
28966       __pyx_t_1 = __pyx_t_2;
28967       goto __pyx_L11_bool_binop_done;
28968     }
28969     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
28970     __pyx_t_1 = __pyx_t_2;
28971     __pyx_L11_bool_binop_done:;
28972     __pyx_v_self->dtype_is_object = __pyx_t_1;
28973 
28974     /* "View.MemoryView":363
28975  *                 raise MemoryError
28976  *
28977  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
28978  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
28979  *         else:
28980  */
28981     goto __pyx_L10;
28982   }
28983 
28984   /* "View.MemoryView":366
28985  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
28986  *         else:
28987  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
28988  *
28989  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
28990  */
28991   /*else*/ {
28992     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
28993   }
28994   __pyx_L10:;
28995 
28996   /* "View.MemoryView":368
28997  *             self.dtype_is_object = dtype_is_object
28998  *
28999  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
29000  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
29001  *         self.typeinfo = NULL
29002  */
29003   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
29004 
29005   /* "View.MemoryView":370
29006  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
29007  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
29008  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
29009  *
29010  *     def __dealloc__(memoryview self):
29011  */
29012   __pyx_v_self->typeinfo = NULL;
29013 
29014   /* "View.MemoryView":345
29015  *     cdef __Pyx_TypeInfo *typeinfo
29016  *
29017  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
29018  *         self.obj = obj
29019  *         self.flags = flags
29020  */
29021 
29022   /* function exit code */
29023   __pyx_r = 0;
29024   goto __pyx_L0;
29025   __pyx_L1_error:;
29026   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29027   __pyx_r = -1;
29028   __pyx_L0:;
29029   __Pyx_RefNannyFinishContext();
29030   return __pyx_r;
29031 }
29032 
29033 /* "View.MemoryView":372
29034  *         self.typeinfo = NULL
29035  *
29036  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
29037  *         if self.obj is not None:
29038  *             __Pyx_ReleaseBuffer(&self.view)
29039  */
29040 
29041 /* Python wrapper */
29042 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)29043 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
29044   __Pyx_RefNannyDeclarations
29045   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
29046   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
29047 
29048   /* function exit code */
29049   __Pyx_RefNannyFinishContext();
29050 }
29051 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)29052 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
29053   int __pyx_v_i;
29054   __Pyx_RefNannyDeclarations
29055   int __pyx_t_1;
29056   int __pyx_t_2;
29057   int __pyx_t_3;
29058   int __pyx_t_4;
29059   int __pyx_t_5;
29060   PyThread_type_lock __pyx_t_6;
29061   PyThread_type_lock __pyx_t_7;
29062   __Pyx_RefNannySetupContext("__dealloc__", 0);
29063 
29064   /* "View.MemoryView":373
29065  *
29066  *     def __dealloc__(memoryview self):
29067  *         if self.obj is not None:             # <<<<<<<<<<<<<<
29068  *             __Pyx_ReleaseBuffer(&self.view)
29069  *
29070  */
29071   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
29072   __pyx_t_2 = (__pyx_t_1 != 0);
29073   if (__pyx_t_2) {
29074 
29075     /* "View.MemoryView":374
29076  *     def __dealloc__(memoryview self):
29077  *         if self.obj is not None:
29078  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
29079  *
29080  *         cdef int i
29081  */
29082     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
29083 
29084     /* "View.MemoryView":373
29085  *
29086  *     def __dealloc__(memoryview self):
29087  *         if self.obj is not None:             # <<<<<<<<<<<<<<
29088  *             __Pyx_ReleaseBuffer(&self.view)
29089  *
29090  */
29091   }
29092 
29093   /* "View.MemoryView":378
29094  *         cdef int i
29095  *         global __pyx_memoryview_thread_locks_used
29096  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
29097  *             for i in range(__pyx_memoryview_thread_locks_used):
29098  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29099  */
29100   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
29101   if (__pyx_t_2) {
29102 
29103     /* "View.MemoryView":379
29104  *         global __pyx_memoryview_thread_locks_used
29105  *         if self.lock != NULL:
29106  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
29107  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29108  *                     __pyx_memoryview_thread_locks_used -= 1
29109  */
29110     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
29111     __pyx_t_4 = __pyx_t_3;
29112     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
29113       __pyx_v_i = __pyx_t_5;
29114 
29115       /* "View.MemoryView":380
29116  *         if self.lock != NULL:
29117  *             for i in range(__pyx_memoryview_thread_locks_used):
29118  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
29119  *                     __pyx_memoryview_thread_locks_used -= 1
29120  *                     if i != __pyx_memoryview_thread_locks_used:
29121  */
29122       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
29123       if (__pyx_t_2) {
29124 
29125         /* "View.MemoryView":381
29126  *             for i in range(__pyx_memoryview_thread_locks_used):
29127  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29128  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
29129  *                     if i != __pyx_memoryview_thread_locks_used:
29130  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
29131  */
29132         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
29133 
29134         /* "View.MemoryView":382
29135  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29136  *                     __pyx_memoryview_thread_locks_used -= 1
29137  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
29138  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
29139  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
29140  */
29141         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
29142         if (__pyx_t_2) {
29143 
29144           /* "View.MemoryView":384
29145  *                     if i != __pyx_memoryview_thread_locks_used:
29146  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
29147  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
29148  *                     break
29149  *             else:
29150  */
29151           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
29152           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
29153 
29154           /* "View.MemoryView":383
29155  *                     __pyx_memoryview_thread_locks_used -= 1
29156  *                     if i != __pyx_memoryview_thread_locks_used:
29157  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
29158  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
29159  *                     break
29160  */
29161           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
29162           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
29163 
29164           /* "View.MemoryView":382
29165  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29166  *                     __pyx_memoryview_thread_locks_used -= 1
29167  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
29168  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
29169  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
29170  */
29171         }
29172 
29173         /* "View.MemoryView":385
29174  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
29175  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
29176  *                     break             # <<<<<<<<<<<<<<
29177  *             else:
29178  *                 PyThread_free_lock(self.lock)
29179  */
29180         goto __pyx_L6_break;
29181 
29182         /* "View.MemoryView":380
29183  *         if self.lock != NULL:
29184  *             for i in range(__pyx_memoryview_thread_locks_used):
29185  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
29186  *                     __pyx_memoryview_thread_locks_used -= 1
29187  *                     if i != __pyx_memoryview_thread_locks_used:
29188  */
29189       }
29190     }
29191     /*else*/ {
29192 
29193       /* "View.MemoryView":387
29194  *                     break
29195  *             else:
29196  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
29197  *
29198  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
29199  */
29200       PyThread_free_lock(__pyx_v_self->lock);
29201     }
29202     __pyx_L6_break:;
29203 
29204     /* "View.MemoryView":378
29205  *         cdef int i
29206  *         global __pyx_memoryview_thread_locks_used
29207  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
29208  *             for i in range(__pyx_memoryview_thread_locks_used):
29209  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
29210  */
29211   }
29212 
29213   /* "View.MemoryView":372
29214  *         self.typeinfo = NULL
29215  *
29216  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
29217  *         if self.obj is not None:
29218  *             __Pyx_ReleaseBuffer(&self.view)
29219  */
29220 
29221   /* function exit code */
29222   __Pyx_RefNannyFinishContext();
29223 }
29224 
29225 /* "View.MemoryView":389
29226  *                 PyThread_free_lock(self.lock)
29227  *
29228  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
29229  *         cdef Py_ssize_t dim
29230  *         cdef char *itemp = <char *> self.view.buf
29231  */
29232 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)29233 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
29234   Py_ssize_t __pyx_v_dim;
29235   char *__pyx_v_itemp;
29236   PyObject *__pyx_v_idx = NULL;
29237   char *__pyx_r;
29238   __Pyx_RefNannyDeclarations
29239   Py_ssize_t __pyx_t_1;
29240   PyObject *__pyx_t_2 = NULL;
29241   Py_ssize_t __pyx_t_3;
29242   PyObject *(*__pyx_t_4)(PyObject *);
29243   PyObject *__pyx_t_5 = NULL;
29244   Py_ssize_t __pyx_t_6;
29245   char *__pyx_t_7;
29246   __Pyx_RefNannySetupContext("get_item_pointer", 0);
29247 
29248   /* "View.MemoryView":391
29249  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
29250  *         cdef Py_ssize_t dim
29251  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
29252  *
29253  *         for dim, idx in enumerate(index):
29254  */
29255   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
29256 
29257   /* "View.MemoryView":393
29258  *         cdef char *itemp = <char *> self.view.buf
29259  *
29260  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
29261  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
29262  *
29263  */
29264   __pyx_t_1 = 0;
29265   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
29266     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
29267     __pyx_t_4 = NULL;
29268   } else {
29269     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
29270     __Pyx_GOTREF(__pyx_t_2);
29271     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
29272   }
29273   for (;;) {
29274     if (likely(!__pyx_t_4)) {
29275       if (likely(PyList_CheckExact(__pyx_t_2))) {
29276         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
29277         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29278         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
29279         #else
29280         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
29281         __Pyx_GOTREF(__pyx_t_5);
29282         #endif
29283       } else {
29284         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
29285         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29286         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
29287         #else
29288         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
29289         __Pyx_GOTREF(__pyx_t_5);
29290         #endif
29291       }
29292     } else {
29293       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
29294       if (unlikely(!__pyx_t_5)) {
29295         PyObject* exc_type = PyErr_Occurred();
29296         if (exc_type) {
29297           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
29298           else __PYX_ERR(1, 393, __pyx_L1_error)
29299         }
29300         break;
29301       }
29302       __Pyx_GOTREF(__pyx_t_5);
29303     }
29304     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
29305     __pyx_t_5 = 0;
29306     __pyx_v_dim = __pyx_t_1;
29307     __pyx_t_1 = (__pyx_t_1 + 1);
29308 
29309     /* "View.MemoryView":394
29310  *
29311  *         for dim, idx in enumerate(index):
29312  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
29313  *
29314  *         return itemp
29315  */
29316     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
29317     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 394, __pyx_L1_error)
29318     __pyx_v_itemp = __pyx_t_7;
29319 
29320     /* "View.MemoryView":393
29321  *         cdef char *itemp = <char *> self.view.buf
29322  *
29323  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
29324  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
29325  *
29326  */
29327   }
29328   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29329 
29330   /* "View.MemoryView":396
29331  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
29332  *
29333  *         return itemp             # <<<<<<<<<<<<<<
29334  *
29335  *
29336  */
29337   __pyx_r = __pyx_v_itemp;
29338   goto __pyx_L0;
29339 
29340   /* "View.MemoryView":389
29341  *                 PyThread_free_lock(self.lock)
29342  *
29343  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
29344  *         cdef Py_ssize_t dim
29345  *         cdef char *itemp = <char *> self.view.buf
29346  */
29347 
29348   /* function exit code */
29349   __pyx_L1_error:;
29350   __Pyx_XDECREF(__pyx_t_2);
29351   __Pyx_XDECREF(__pyx_t_5);
29352   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
29353   __pyx_r = NULL;
29354   __pyx_L0:;
29355   __Pyx_XDECREF(__pyx_v_idx);
29356   __Pyx_RefNannyFinishContext();
29357   return __pyx_r;
29358 }
29359 
29360 /* "View.MemoryView":399
29361  *
29362  *
29363  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
29364  *         if index is Ellipsis:
29365  *             return self
29366  */
29367 
29368 /* Python wrapper */
29369 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
__pyx_memoryview___getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index)29370 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
29371   PyObject *__pyx_r = 0;
29372   __Pyx_RefNannyDeclarations
29373   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
29374   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
29375 
29376   /* function exit code */
29377   __Pyx_RefNannyFinishContext();
29378   return __pyx_r;
29379 }
29380 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)29381 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
29382   PyObject *__pyx_v_have_slices = NULL;
29383   PyObject *__pyx_v_indices = NULL;
29384   char *__pyx_v_itemp;
29385   PyObject *__pyx_r = NULL;
29386   __Pyx_RefNannyDeclarations
29387   int __pyx_t_1;
29388   int __pyx_t_2;
29389   PyObject *__pyx_t_3 = NULL;
29390   PyObject *__pyx_t_4 = NULL;
29391   PyObject *__pyx_t_5 = NULL;
29392   char *__pyx_t_6;
29393   __Pyx_RefNannySetupContext("__getitem__", 0);
29394 
29395   /* "View.MemoryView":400
29396  *
29397  *     def __getitem__(memoryview self, object index):
29398  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
29399  *             return self
29400  *
29401  */
29402   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
29403   __pyx_t_2 = (__pyx_t_1 != 0);
29404   if (__pyx_t_2) {
29405 
29406     /* "View.MemoryView":401
29407  *     def __getitem__(memoryview self, object index):
29408  *         if index is Ellipsis:
29409  *             return self             # <<<<<<<<<<<<<<
29410  *
29411  *         have_slices, indices = _unellipsify(index, self.view.ndim)
29412  */
29413     __Pyx_XDECREF(__pyx_r);
29414     __Pyx_INCREF(((PyObject *)__pyx_v_self));
29415     __pyx_r = ((PyObject *)__pyx_v_self);
29416     goto __pyx_L0;
29417 
29418     /* "View.MemoryView":400
29419  *
29420  *     def __getitem__(memoryview self, object index):
29421  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
29422  *             return self
29423  *
29424  */
29425   }
29426 
29427   /* "View.MemoryView":403
29428  *             return self
29429  *
29430  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
29431  *
29432  *         cdef char *itemp
29433  */
29434   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
29435   __Pyx_GOTREF(__pyx_t_3);
29436   if (likely(__pyx_t_3 != Py_None)) {
29437     PyObject* sequence = __pyx_t_3;
29438     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29439     if (unlikely(size != 2)) {
29440       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
29441       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29442       __PYX_ERR(1, 403, __pyx_L1_error)
29443     }
29444     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29445     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
29446     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
29447     __Pyx_INCREF(__pyx_t_4);
29448     __Pyx_INCREF(__pyx_t_5);
29449     #else
29450     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
29451     __Pyx_GOTREF(__pyx_t_4);
29452     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
29453     __Pyx_GOTREF(__pyx_t_5);
29454     #endif
29455     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29456   } else {
29457     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
29458   }
29459   __pyx_v_have_slices = __pyx_t_4;
29460   __pyx_t_4 = 0;
29461   __pyx_v_indices = __pyx_t_5;
29462   __pyx_t_5 = 0;
29463 
29464   /* "View.MemoryView":406
29465  *
29466  *         cdef char *itemp
29467  *         if have_slices:             # <<<<<<<<<<<<<<
29468  *             return memview_slice(self, indices)
29469  *         else:
29470  */
29471   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
29472   if (__pyx_t_2) {
29473 
29474     /* "View.MemoryView":407
29475  *         cdef char *itemp
29476  *         if have_slices:
29477  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
29478  *         else:
29479  *             itemp = self.get_item_pointer(indices)
29480  */
29481     __Pyx_XDECREF(__pyx_r);
29482     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
29483     __Pyx_GOTREF(__pyx_t_3);
29484     __pyx_r = __pyx_t_3;
29485     __pyx_t_3 = 0;
29486     goto __pyx_L0;
29487 
29488     /* "View.MemoryView":406
29489  *
29490  *         cdef char *itemp
29491  *         if have_slices:             # <<<<<<<<<<<<<<
29492  *             return memview_slice(self, indices)
29493  *         else:
29494  */
29495   }
29496 
29497   /* "View.MemoryView":409
29498  *             return memview_slice(self, indices)
29499  *         else:
29500  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
29501  *             return self.convert_item_to_object(itemp)
29502  *
29503  */
29504   /*else*/ {
29505     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 409, __pyx_L1_error)
29506     __pyx_v_itemp = __pyx_t_6;
29507 
29508     /* "View.MemoryView":410
29509  *         else:
29510  *             itemp = self.get_item_pointer(indices)
29511  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
29512  *
29513  *     def __setitem__(memoryview self, object index, object value):
29514  */
29515     __Pyx_XDECREF(__pyx_r);
29516     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error)
29517     __Pyx_GOTREF(__pyx_t_3);
29518     __pyx_r = __pyx_t_3;
29519     __pyx_t_3 = 0;
29520     goto __pyx_L0;
29521   }
29522 
29523   /* "View.MemoryView":399
29524  *
29525  *
29526  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
29527  *         if index is Ellipsis:
29528  *             return self
29529  */
29530 
29531   /* function exit code */
29532   __pyx_L1_error:;
29533   __Pyx_XDECREF(__pyx_t_3);
29534   __Pyx_XDECREF(__pyx_t_4);
29535   __Pyx_XDECREF(__pyx_t_5);
29536   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29537   __pyx_r = NULL;
29538   __pyx_L0:;
29539   __Pyx_XDECREF(__pyx_v_have_slices);
29540   __Pyx_XDECREF(__pyx_v_indices);
29541   __Pyx_XGIVEREF(__pyx_r);
29542   __Pyx_RefNannyFinishContext();
29543   return __pyx_r;
29544 }
29545 
29546 /* "View.MemoryView":412
29547  *             return self.convert_item_to_object(itemp)
29548  *
29549  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
29550  *         if self.view.readonly:
29551  *             raise TypeError("Cannot assign to read-only memoryview")
29552  */
29553 
29554 /* Python wrapper */
29555 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
__pyx_memoryview___setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)29556 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
29557   int __pyx_r;
29558   __Pyx_RefNannyDeclarations
29559   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
29560   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
29561 
29562   /* function exit code */
29563   __Pyx_RefNannyFinishContext();
29564   return __pyx_r;
29565 }
29566 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)29567 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
29568   PyObject *__pyx_v_have_slices = NULL;
29569   PyObject *__pyx_v_obj = NULL;
29570   int __pyx_r;
29571   __Pyx_RefNannyDeclarations
29572   int __pyx_t_1;
29573   PyObject *__pyx_t_2 = NULL;
29574   PyObject *__pyx_t_3 = NULL;
29575   PyObject *__pyx_t_4 = NULL;
29576   __Pyx_RefNannySetupContext("__setitem__", 0);
29577   __Pyx_INCREF(__pyx_v_index);
29578 
29579   /* "View.MemoryView":413
29580  *
29581  *     def __setitem__(memoryview self, object index, object value):
29582  *         if self.view.readonly:             # <<<<<<<<<<<<<<
29583  *             raise TypeError("Cannot assign to read-only memoryview")
29584  *
29585  */
29586   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
29587   if (unlikely(__pyx_t_1)) {
29588 
29589     /* "View.MemoryView":414
29590  *     def __setitem__(memoryview self, object index, object value):
29591  *         if self.view.readonly:
29592  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
29593  *
29594  *         have_slices, index = _unellipsify(index, self.view.ndim)
29595  */
29596     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
29597     __Pyx_GOTREF(__pyx_t_2);
29598     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
29599     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29600     __PYX_ERR(1, 414, __pyx_L1_error)
29601 
29602     /* "View.MemoryView":413
29603  *
29604  *     def __setitem__(memoryview self, object index, object value):
29605  *         if self.view.readonly:             # <<<<<<<<<<<<<<
29606  *             raise TypeError("Cannot assign to read-only memoryview")
29607  *
29608  */
29609   }
29610 
29611   /* "View.MemoryView":416
29612  *             raise TypeError("Cannot assign to read-only memoryview")
29613  *
29614  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
29615  *
29616  *         if have_slices:
29617  */
29618   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
29619   __Pyx_GOTREF(__pyx_t_2);
29620   if (likely(__pyx_t_2 != Py_None)) {
29621     PyObject* sequence = __pyx_t_2;
29622     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29623     if (unlikely(size != 2)) {
29624       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
29625       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29626       __PYX_ERR(1, 416, __pyx_L1_error)
29627     }
29628     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29629     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
29630     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
29631     __Pyx_INCREF(__pyx_t_3);
29632     __Pyx_INCREF(__pyx_t_4);
29633     #else
29634     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
29635     __Pyx_GOTREF(__pyx_t_3);
29636     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
29637     __Pyx_GOTREF(__pyx_t_4);
29638     #endif
29639     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29640   } else {
29641     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
29642   }
29643   __pyx_v_have_slices = __pyx_t_3;
29644   __pyx_t_3 = 0;
29645   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
29646   __pyx_t_4 = 0;
29647 
29648   /* "View.MemoryView":418
29649  *         have_slices, index = _unellipsify(index, self.view.ndim)
29650  *
29651  *         if have_slices:             # <<<<<<<<<<<<<<
29652  *             obj = self.is_slice(value)
29653  *             if obj:
29654  */
29655   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
29656   if (__pyx_t_1) {
29657 
29658     /* "View.MemoryView":419
29659  *
29660  *         if have_slices:
29661  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
29662  *             if obj:
29663  *                 self.setitem_slice_assignment(self[index], obj)
29664  */
29665     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 419, __pyx_L1_error)
29666     __Pyx_GOTREF(__pyx_t_2);
29667     __pyx_v_obj = __pyx_t_2;
29668     __pyx_t_2 = 0;
29669 
29670     /* "View.MemoryView":420
29671  *         if have_slices:
29672  *             obj = self.is_slice(value)
29673  *             if obj:             # <<<<<<<<<<<<<<
29674  *                 self.setitem_slice_assignment(self[index], obj)
29675  *             else:
29676  */
29677     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
29678     if (__pyx_t_1) {
29679 
29680       /* "View.MemoryView":421
29681  *             obj = self.is_slice(value)
29682  *             if obj:
29683  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
29684  *             else:
29685  *                 self.setitem_slice_assign_scalar(self[index], value)
29686  */
29687       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
29688       __Pyx_GOTREF(__pyx_t_2);
29689       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error)
29690       __Pyx_GOTREF(__pyx_t_4);
29691       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29692       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29693 
29694       /* "View.MemoryView":420
29695  *         if have_slices:
29696  *             obj = self.is_slice(value)
29697  *             if obj:             # <<<<<<<<<<<<<<
29698  *                 self.setitem_slice_assignment(self[index], obj)
29699  *             else:
29700  */
29701       goto __pyx_L5;
29702     }
29703 
29704     /* "View.MemoryView":423
29705  *                 self.setitem_slice_assignment(self[index], obj)
29706  *             else:
29707  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
29708  *         else:
29709  *             self.setitem_indexed(index, value)
29710  */
29711     /*else*/ {
29712       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
29713       __Pyx_GOTREF(__pyx_t_4);
29714       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
29715       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
29716       __Pyx_GOTREF(__pyx_t_2);
29717       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29718       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29719     }
29720     __pyx_L5:;
29721 
29722     /* "View.MemoryView":418
29723  *         have_slices, index = _unellipsify(index, self.view.ndim)
29724  *
29725  *         if have_slices:             # <<<<<<<<<<<<<<
29726  *             obj = self.is_slice(value)
29727  *             if obj:
29728  */
29729     goto __pyx_L4;
29730   }
29731 
29732   /* "View.MemoryView":425
29733  *                 self.setitem_slice_assign_scalar(self[index], value)
29734  *         else:
29735  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
29736  *
29737  *     cdef is_slice(self, obj):
29738  */
29739   /*else*/ {
29740     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
29741     __Pyx_GOTREF(__pyx_t_2);
29742     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29743   }
29744   __pyx_L4:;
29745 
29746   /* "View.MemoryView":412
29747  *             return self.convert_item_to_object(itemp)
29748  *
29749  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
29750  *         if self.view.readonly:
29751  *             raise TypeError("Cannot assign to read-only memoryview")
29752  */
29753 
29754   /* function exit code */
29755   __pyx_r = 0;
29756   goto __pyx_L0;
29757   __pyx_L1_error:;
29758   __Pyx_XDECREF(__pyx_t_2);
29759   __Pyx_XDECREF(__pyx_t_3);
29760   __Pyx_XDECREF(__pyx_t_4);
29761   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29762   __pyx_r = -1;
29763   __pyx_L0:;
29764   __Pyx_XDECREF(__pyx_v_have_slices);
29765   __Pyx_XDECREF(__pyx_v_obj);
29766   __Pyx_XDECREF(__pyx_v_index);
29767   __Pyx_RefNannyFinishContext();
29768   return __pyx_r;
29769 }
29770 
29771 /* "View.MemoryView":427
29772  *             self.setitem_indexed(index, value)
29773  *
29774  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
29775  *         if not isinstance(obj, memoryview):
29776  *             try:
29777  */
29778 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)29779 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
29780   PyObject *__pyx_r = NULL;
29781   __Pyx_RefNannyDeclarations
29782   int __pyx_t_1;
29783   int __pyx_t_2;
29784   PyObject *__pyx_t_3 = NULL;
29785   PyObject *__pyx_t_4 = NULL;
29786   PyObject *__pyx_t_5 = NULL;
29787   PyObject *__pyx_t_6 = NULL;
29788   PyObject *__pyx_t_7 = NULL;
29789   PyObject *__pyx_t_8 = NULL;
29790   int __pyx_t_9;
29791   __Pyx_RefNannySetupContext("is_slice", 0);
29792   __Pyx_INCREF(__pyx_v_obj);
29793 
29794   /* "View.MemoryView":428
29795  *
29796  *     cdef is_slice(self, obj):
29797  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
29798  *             try:
29799  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29800  */
29801   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
29802   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
29803   if (__pyx_t_2) {
29804 
29805     /* "View.MemoryView":429
29806  *     cdef is_slice(self, obj):
29807  *         if not isinstance(obj, memoryview):
29808  *             try:             # <<<<<<<<<<<<<<
29809  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29810  *                                  self.dtype_is_object)
29811  */
29812     {
29813       __Pyx_PyThreadState_declare
29814       __Pyx_PyThreadState_assign
29815       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
29816       __Pyx_XGOTREF(__pyx_t_3);
29817       __Pyx_XGOTREF(__pyx_t_4);
29818       __Pyx_XGOTREF(__pyx_t_5);
29819       /*try:*/ {
29820 
29821         /* "View.MemoryView":430
29822  *         if not isinstance(obj, memoryview):
29823  *             try:
29824  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
29825  *                                  self.dtype_is_object)
29826  *             except TypeError:
29827  */
29828         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
29829         __Pyx_GOTREF(__pyx_t_6);
29830 
29831         /* "View.MemoryView":431
29832  *             try:
29833  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29834  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
29835  *             except TypeError:
29836  *                 return None
29837  */
29838         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
29839         __Pyx_GOTREF(__pyx_t_7);
29840 
29841         /* "View.MemoryView":430
29842  *         if not isinstance(obj, memoryview):
29843  *             try:
29844  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
29845  *                                  self.dtype_is_object)
29846  *             except TypeError:
29847  */
29848         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
29849         __Pyx_GOTREF(__pyx_t_8);
29850         __Pyx_INCREF(__pyx_v_obj);
29851         __Pyx_GIVEREF(__pyx_v_obj);
29852         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
29853         __Pyx_GIVEREF(__pyx_t_6);
29854         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
29855         __Pyx_GIVEREF(__pyx_t_7);
29856         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
29857         __pyx_t_6 = 0;
29858         __pyx_t_7 = 0;
29859         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
29860         __Pyx_GOTREF(__pyx_t_7);
29861         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29862         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
29863         __pyx_t_7 = 0;
29864 
29865         /* "View.MemoryView":429
29866  *     cdef is_slice(self, obj):
29867  *         if not isinstance(obj, memoryview):
29868  *             try:             # <<<<<<<<<<<<<<
29869  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29870  *                                  self.dtype_is_object)
29871  */
29872       }
29873       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29874       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29875       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29876       goto __pyx_L9_try_end;
29877       __pyx_L4_error:;
29878       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
29879       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29880       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
29881 
29882       /* "View.MemoryView":432
29883  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29884  *                                  self.dtype_is_object)
29885  *             except TypeError:             # <<<<<<<<<<<<<<
29886  *                 return None
29887  *
29888  */
29889       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
29890       if (__pyx_t_9) {
29891         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29892         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
29893         __Pyx_GOTREF(__pyx_t_7);
29894         __Pyx_GOTREF(__pyx_t_8);
29895         __Pyx_GOTREF(__pyx_t_6);
29896 
29897         /* "View.MemoryView":433
29898  *                                  self.dtype_is_object)
29899  *             except TypeError:
29900  *                 return None             # <<<<<<<<<<<<<<
29901  *
29902  *         return obj
29903  */
29904         __Pyx_XDECREF(__pyx_r);
29905         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29906         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29907         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29908         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29909         goto __pyx_L7_except_return;
29910       }
29911       goto __pyx_L6_except_error;
29912       __pyx_L6_except_error:;
29913 
29914       /* "View.MemoryView":429
29915  *     cdef is_slice(self, obj):
29916  *         if not isinstance(obj, memoryview):
29917  *             try:             # <<<<<<<<<<<<<<
29918  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29919  *                                  self.dtype_is_object)
29920  */
29921       __Pyx_XGIVEREF(__pyx_t_3);
29922       __Pyx_XGIVEREF(__pyx_t_4);
29923       __Pyx_XGIVEREF(__pyx_t_5);
29924       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
29925       goto __pyx_L1_error;
29926       __pyx_L7_except_return:;
29927       __Pyx_XGIVEREF(__pyx_t_3);
29928       __Pyx_XGIVEREF(__pyx_t_4);
29929       __Pyx_XGIVEREF(__pyx_t_5);
29930       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
29931       goto __pyx_L0;
29932       __pyx_L9_try_end:;
29933     }
29934 
29935     /* "View.MemoryView":428
29936  *
29937  *     cdef is_slice(self, obj):
29938  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
29939  *             try:
29940  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
29941  */
29942   }
29943 
29944   /* "View.MemoryView":435
29945  *                 return None
29946  *
29947  *         return obj             # <<<<<<<<<<<<<<
29948  *
29949  *     cdef setitem_slice_assignment(self, dst, src):
29950  */
29951   __Pyx_XDECREF(__pyx_r);
29952   __Pyx_INCREF(__pyx_v_obj);
29953   __pyx_r = __pyx_v_obj;
29954   goto __pyx_L0;
29955 
29956   /* "View.MemoryView":427
29957  *             self.setitem_indexed(index, value)
29958  *
29959  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
29960  *         if not isinstance(obj, memoryview):
29961  *             try:
29962  */
29963 
29964   /* function exit code */
29965   __pyx_L1_error:;
29966   __Pyx_XDECREF(__pyx_t_6);
29967   __Pyx_XDECREF(__pyx_t_7);
29968   __Pyx_XDECREF(__pyx_t_8);
29969   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
29970   __pyx_r = 0;
29971   __pyx_L0:;
29972   __Pyx_XDECREF(__pyx_v_obj);
29973   __Pyx_XGIVEREF(__pyx_r);
29974   __Pyx_RefNannyFinishContext();
29975   return __pyx_r;
29976 }
29977 
29978 /* "View.MemoryView":437
29979  *         return obj
29980  *
29981  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
29982  *         cdef __Pyx_memviewslice dst_slice
29983  *         cdef __Pyx_memviewslice src_slice
29984  */
29985 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)29986 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
29987   __Pyx_memviewslice __pyx_v_dst_slice;
29988   __Pyx_memviewslice __pyx_v_src_slice;
29989   PyObject *__pyx_r = NULL;
29990   __Pyx_RefNannyDeclarations
29991   PyObject *__pyx_t_1 = NULL;
29992   int __pyx_t_2;
29993   int __pyx_t_3;
29994   int __pyx_t_4;
29995   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
29996 
29997   /* "View.MemoryView":441
29998  *         cdef __Pyx_memviewslice src_slice
29999  *
30000  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
30001  *                                  get_slice_from_memview(dst, &dst_slice)[0],
30002  *                                  src.ndim, dst.ndim, self.dtype_is_object)
30003  */
30004   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
30005 
30006   /* "View.MemoryView":442
30007  *
30008  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
30009  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
30010  *                                  src.ndim, dst.ndim, self.dtype_is_object)
30011  *
30012  */
30013   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
30014 
30015   /* "View.MemoryView":443
30016  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
30017  *                                  get_slice_from_memview(dst, &dst_slice)[0],
30018  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
30019  *
30020  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
30021  */
30022   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
30023   __Pyx_GOTREF(__pyx_t_1);
30024   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
30025   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30026   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
30027   __Pyx_GOTREF(__pyx_t_1);
30028   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
30029   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30030 
30031   /* "View.MemoryView":441
30032  *         cdef __Pyx_memviewslice src_slice
30033  *
30034  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
30035  *                                  get_slice_from_memview(dst, &dst_slice)[0],
30036  *                                  src.ndim, dst.ndim, self.dtype_is_object)
30037  */
30038   __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
30039 
30040   /* "View.MemoryView":437
30041  *         return obj
30042  *
30043  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
30044  *         cdef __Pyx_memviewslice dst_slice
30045  *         cdef __Pyx_memviewslice src_slice
30046  */
30047 
30048   /* function exit code */
30049   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30050   goto __pyx_L0;
30051   __pyx_L1_error:;
30052   __Pyx_XDECREF(__pyx_t_1);
30053   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
30054   __pyx_r = 0;
30055   __pyx_L0:;
30056   __Pyx_XGIVEREF(__pyx_r);
30057   __Pyx_RefNannyFinishContext();
30058   return __pyx_r;
30059 }
30060 
30061 /* "View.MemoryView":445
30062  *                                  src.ndim, dst.ndim, self.dtype_is_object)
30063  *
30064  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
30065  *         cdef int array[128]
30066  *         cdef void *tmp = NULL
30067  */
30068 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)30069 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
30070   int __pyx_v_array[0x80];
30071   void *__pyx_v_tmp;
30072   void *__pyx_v_item;
30073   __Pyx_memviewslice *__pyx_v_dst_slice;
30074   __Pyx_memviewslice __pyx_v_tmp_slice;
30075   PyObject *__pyx_r = NULL;
30076   __Pyx_RefNannyDeclarations
30077   int __pyx_t_1;
30078   PyObject *__pyx_t_2 = NULL;
30079   int __pyx_t_3;
30080   int __pyx_t_4;
30081   char const *__pyx_t_5;
30082   PyObject *__pyx_t_6 = NULL;
30083   PyObject *__pyx_t_7 = NULL;
30084   PyObject *__pyx_t_8 = NULL;
30085   PyObject *__pyx_t_9 = NULL;
30086   PyObject *__pyx_t_10 = NULL;
30087   PyObject *__pyx_t_11 = NULL;
30088   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
30089 
30090   /* "View.MemoryView":447
30091  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
30092  *         cdef int array[128]
30093  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
30094  *         cdef void *item
30095  *
30096  */
30097   __pyx_v_tmp = NULL;
30098 
30099   /* "View.MemoryView":452
30100  *         cdef __Pyx_memviewslice *dst_slice
30101  *         cdef __Pyx_memviewslice tmp_slice
30102  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
30103  *
30104  *         if <size_t>self.view.itemsize > sizeof(array):
30105  */
30106   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
30107 
30108   /* "View.MemoryView":454
30109  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
30110  *
30111  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
30112  *             tmp = PyMem_Malloc(self.view.itemsize)
30113  *             if tmp == NULL:
30114  */
30115   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
30116   if (__pyx_t_1) {
30117 
30118     /* "View.MemoryView":455
30119  *
30120  *         if <size_t>self.view.itemsize > sizeof(array):
30121  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
30122  *             if tmp == NULL:
30123  *                 raise MemoryError
30124  */
30125     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
30126 
30127     /* "View.MemoryView":456
30128  *         if <size_t>self.view.itemsize > sizeof(array):
30129  *             tmp = PyMem_Malloc(self.view.itemsize)
30130  *             if tmp == NULL:             # <<<<<<<<<<<<<<
30131  *                 raise MemoryError
30132  *             item = tmp
30133  */
30134     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
30135     if (unlikely(__pyx_t_1)) {
30136 
30137       /* "View.MemoryView":457
30138  *             tmp = PyMem_Malloc(self.view.itemsize)
30139  *             if tmp == NULL:
30140  *                 raise MemoryError             # <<<<<<<<<<<<<<
30141  *             item = tmp
30142  *         else:
30143  */
30144       PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
30145 
30146       /* "View.MemoryView":456
30147  *         if <size_t>self.view.itemsize > sizeof(array):
30148  *             tmp = PyMem_Malloc(self.view.itemsize)
30149  *             if tmp == NULL:             # <<<<<<<<<<<<<<
30150  *                 raise MemoryError
30151  *             item = tmp
30152  */
30153     }
30154 
30155     /* "View.MemoryView":458
30156  *             if tmp == NULL:
30157  *                 raise MemoryError
30158  *             item = tmp             # <<<<<<<<<<<<<<
30159  *         else:
30160  *             item = <void *> array
30161  */
30162     __pyx_v_item = __pyx_v_tmp;
30163 
30164     /* "View.MemoryView":454
30165  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
30166  *
30167  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
30168  *             tmp = PyMem_Malloc(self.view.itemsize)
30169  *             if tmp == NULL:
30170  */
30171     goto __pyx_L3;
30172   }
30173 
30174   /* "View.MemoryView":460
30175  *             item = tmp
30176  *         else:
30177  *             item = <void *> array             # <<<<<<<<<<<<<<
30178  *
30179  *         try:
30180  */
30181   /*else*/ {
30182     __pyx_v_item = ((void *)__pyx_v_array);
30183   }
30184   __pyx_L3:;
30185 
30186   /* "View.MemoryView":462
30187  *             item = <void *> array
30188  *
30189  *         try:             # <<<<<<<<<<<<<<
30190  *             if self.dtype_is_object:
30191  *                 (<PyObject **> item)[0] = <PyObject *> value
30192  */
30193   /*try:*/ {
30194 
30195     /* "View.MemoryView":463
30196  *
30197  *         try:
30198  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
30199  *                 (<PyObject **> item)[0] = <PyObject *> value
30200  *             else:
30201  */
30202     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
30203     if (__pyx_t_1) {
30204 
30205       /* "View.MemoryView":464
30206  *         try:
30207  *             if self.dtype_is_object:
30208  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
30209  *             else:
30210  *                 self.assign_item_from_object(<char *> item, value)
30211  */
30212       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
30213 
30214       /* "View.MemoryView":463
30215  *
30216  *         try:
30217  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
30218  *                 (<PyObject **> item)[0] = <PyObject *> value
30219  *             else:
30220  */
30221       goto __pyx_L8;
30222     }
30223 
30224     /* "View.MemoryView":466
30225  *                 (<PyObject **> item)[0] = <PyObject *> value
30226  *             else:
30227  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
30228  *
30229  *
30230  */
30231     /*else*/ {
30232       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L6_error)
30233       __Pyx_GOTREF(__pyx_t_2);
30234       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30235     }
30236     __pyx_L8:;
30237 
30238     /* "View.MemoryView":470
30239  *
30240  *
30241  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
30242  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
30243  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
30244  */
30245     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
30246     if (__pyx_t_1) {
30247 
30248       /* "View.MemoryView":471
30249  *
30250  *             if self.view.suboffsets != NULL:
30251  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
30252  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
30253  *                                 item, self.dtype_is_object)
30254  */
30255       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
30256       __Pyx_GOTREF(__pyx_t_2);
30257       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30258 
30259       /* "View.MemoryView":470
30260  *
30261  *
30262  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
30263  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
30264  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
30265  */
30266     }
30267 
30268     /* "View.MemoryView":472
30269  *             if self.view.suboffsets != NULL:
30270  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
30271  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
30272  *                                 item, self.dtype_is_object)
30273  *         finally:
30274  */
30275     __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
30276   }
30277 
30278   /* "View.MemoryView":475
30279  *                                 item, self.dtype_is_object)
30280  *         finally:
30281  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
30282  *
30283  *     cdef setitem_indexed(self, index, value):
30284  */
30285   /*finally:*/ {
30286     /*normal exit:*/{
30287       PyMem_Free(__pyx_v_tmp);
30288       goto __pyx_L7;
30289     }
30290     __pyx_L6_error:;
30291     /*exception exit:*/{
30292       __Pyx_PyThreadState_declare
30293       __Pyx_PyThreadState_assign
30294       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
30295       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
30296       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
30297       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
30298       __Pyx_XGOTREF(__pyx_t_6);
30299       __Pyx_XGOTREF(__pyx_t_7);
30300       __Pyx_XGOTREF(__pyx_t_8);
30301       __Pyx_XGOTREF(__pyx_t_9);
30302       __Pyx_XGOTREF(__pyx_t_10);
30303       __Pyx_XGOTREF(__pyx_t_11);
30304       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
30305       {
30306         PyMem_Free(__pyx_v_tmp);
30307       }
30308       if (PY_MAJOR_VERSION >= 3) {
30309         __Pyx_XGIVEREF(__pyx_t_9);
30310         __Pyx_XGIVEREF(__pyx_t_10);
30311         __Pyx_XGIVEREF(__pyx_t_11);
30312         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
30313       }
30314       __Pyx_XGIVEREF(__pyx_t_6);
30315       __Pyx_XGIVEREF(__pyx_t_7);
30316       __Pyx_XGIVEREF(__pyx_t_8);
30317       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
30318       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
30319       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
30320       goto __pyx_L1_error;
30321     }
30322     __pyx_L7:;
30323   }
30324 
30325   /* "View.MemoryView":445
30326  *                                  src.ndim, dst.ndim, self.dtype_is_object)
30327  *
30328  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
30329  *         cdef int array[128]
30330  *         cdef void *tmp = NULL
30331  */
30332 
30333   /* function exit code */
30334   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30335   goto __pyx_L0;
30336   __pyx_L1_error:;
30337   __Pyx_XDECREF(__pyx_t_2);
30338   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
30339   __pyx_r = 0;
30340   __pyx_L0:;
30341   __Pyx_XGIVEREF(__pyx_r);
30342   __Pyx_RefNannyFinishContext();
30343   return __pyx_r;
30344 }
30345 
30346 /* "View.MemoryView":477
30347  *             PyMem_Free(tmp)
30348  *
30349  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
30350  *         cdef char *itemp = self.get_item_pointer(index)
30351  *         self.assign_item_from_object(itemp, value)
30352  */
30353 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)30354 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
30355   char *__pyx_v_itemp;
30356   PyObject *__pyx_r = NULL;
30357   __Pyx_RefNannyDeclarations
30358   char *__pyx_t_1;
30359   PyObject *__pyx_t_2 = NULL;
30360   __Pyx_RefNannySetupContext("setitem_indexed", 0);
30361 
30362   /* "View.MemoryView":478
30363  *
30364  *     cdef setitem_indexed(self, index, value):
30365  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
30366  *         self.assign_item_from_object(itemp, value)
30367  *
30368  */
30369   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 478, __pyx_L1_error)
30370   __pyx_v_itemp = __pyx_t_1;
30371 
30372   /* "View.MemoryView":479
30373  *     cdef setitem_indexed(self, index, value):
30374  *         cdef char *itemp = self.get_item_pointer(index)
30375  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
30376  *
30377  *     cdef convert_item_to_object(self, char *itemp):
30378  */
30379   __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 479, __pyx_L1_error)
30380   __Pyx_GOTREF(__pyx_t_2);
30381   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30382 
30383   /* "View.MemoryView":477
30384  *             PyMem_Free(tmp)
30385  *
30386  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
30387  *         cdef char *itemp = self.get_item_pointer(index)
30388  *         self.assign_item_from_object(itemp, value)
30389  */
30390 
30391   /* function exit code */
30392   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30393   goto __pyx_L0;
30394   __pyx_L1_error:;
30395   __Pyx_XDECREF(__pyx_t_2);
30396   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
30397   __pyx_r = 0;
30398   __pyx_L0:;
30399   __Pyx_XGIVEREF(__pyx_r);
30400   __Pyx_RefNannyFinishContext();
30401   return __pyx_r;
30402 }
30403 
30404 /* "View.MemoryView":481
30405  *         self.assign_item_from_object(itemp, value)
30406  *
30407  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
30408  *         """Only used if instantiated manually by the user, or if Cython doesn't
30409  *         know how to convert the type"""
30410  */
30411 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)30412 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
30413   PyObject *__pyx_v_struct = NULL;
30414   PyObject *__pyx_v_bytesitem = 0;
30415   PyObject *__pyx_v_result = NULL;
30416   PyObject *__pyx_r = NULL;
30417   __Pyx_RefNannyDeclarations
30418   PyObject *__pyx_t_1 = NULL;
30419   PyObject *__pyx_t_2 = NULL;
30420   PyObject *__pyx_t_3 = NULL;
30421   PyObject *__pyx_t_4 = NULL;
30422   PyObject *__pyx_t_5 = NULL;
30423   PyObject *__pyx_t_6 = NULL;
30424   PyObject *__pyx_t_7 = NULL;
30425   int __pyx_t_8;
30426   PyObject *__pyx_t_9 = NULL;
30427   size_t __pyx_t_10;
30428   int __pyx_t_11;
30429   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
30430 
30431   /* "View.MemoryView":484
30432  *         """Only used if instantiated manually by the user, or if Cython doesn't
30433  *         know how to convert the type"""
30434  *         import struct             # <<<<<<<<<<<<<<
30435  *         cdef bytes bytesitem
30436  *
30437  */
30438   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
30439   __Pyx_GOTREF(__pyx_t_1);
30440   __pyx_v_struct = __pyx_t_1;
30441   __pyx_t_1 = 0;
30442 
30443   /* "View.MemoryView":487
30444  *         cdef bytes bytesitem
30445  *
30446  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
30447  *         try:
30448  *             result = struct.unpack(self.view.format, bytesitem)
30449  */
30450   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
30451   __Pyx_GOTREF(__pyx_t_1);
30452   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
30453   __pyx_t_1 = 0;
30454 
30455   /* "View.MemoryView":488
30456  *
30457  *         bytesitem = itemp[:self.view.itemsize]
30458  *         try:             # <<<<<<<<<<<<<<
30459  *             result = struct.unpack(self.view.format, bytesitem)
30460  *         except struct.error:
30461  */
30462   {
30463     __Pyx_PyThreadState_declare
30464     __Pyx_PyThreadState_assign
30465     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
30466     __Pyx_XGOTREF(__pyx_t_2);
30467     __Pyx_XGOTREF(__pyx_t_3);
30468     __Pyx_XGOTREF(__pyx_t_4);
30469     /*try:*/ {
30470 
30471       /* "View.MemoryView":489
30472  *         bytesitem = itemp[:self.view.itemsize]
30473  *         try:
30474  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
30475  *         except struct.error:
30476  *             raise ValueError("Unable to convert item to object")
30477  */
30478       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
30479       __Pyx_GOTREF(__pyx_t_5);
30480       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
30481       __Pyx_GOTREF(__pyx_t_6);
30482       __pyx_t_7 = NULL;
30483       __pyx_t_8 = 0;
30484       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
30485         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
30486         if (likely(__pyx_t_7)) {
30487           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
30488           __Pyx_INCREF(__pyx_t_7);
30489           __Pyx_INCREF(function);
30490           __Pyx_DECREF_SET(__pyx_t_5, function);
30491           __pyx_t_8 = 1;
30492         }
30493       }
30494       #if CYTHON_FAST_PYCALL
30495       if (PyFunction_Check(__pyx_t_5)) {
30496         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
30497         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
30498         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
30499         __Pyx_GOTREF(__pyx_t_1);
30500         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30501       } else
30502       #endif
30503       #if CYTHON_FAST_PYCCALL
30504       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
30505         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
30506         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
30507         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
30508         __Pyx_GOTREF(__pyx_t_1);
30509         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30510       } else
30511       #endif
30512       {
30513         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
30514         __Pyx_GOTREF(__pyx_t_9);
30515         if (__pyx_t_7) {
30516           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
30517         }
30518         __Pyx_GIVEREF(__pyx_t_6);
30519         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
30520         __Pyx_INCREF(__pyx_v_bytesitem);
30521         __Pyx_GIVEREF(__pyx_v_bytesitem);
30522         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
30523         __pyx_t_6 = 0;
30524         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
30525         __Pyx_GOTREF(__pyx_t_1);
30526         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
30527       }
30528       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30529       __pyx_v_result = __pyx_t_1;
30530       __pyx_t_1 = 0;
30531 
30532       /* "View.MemoryView":488
30533  *
30534  *         bytesitem = itemp[:self.view.itemsize]
30535  *         try:             # <<<<<<<<<<<<<<
30536  *             result = struct.unpack(self.view.format, bytesitem)
30537  *         except struct.error:
30538  */
30539     }
30540 
30541     /* "View.MemoryView":493
30542  *             raise ValueError("Unable to convert item to object")
30543  *         else:
30544  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
30545  *                 return result[0]
30546  *             return result
30547  */
30548     /*else:*/ {
30549       __pyx_t_10 = strlen(__pyx_v_self->view.format);
30550       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
30551       if (__pyx_t_11) {
30552 
30553         /* "View.MemoryView":494
30554  *         else:
30555  *             if len(self.view.format) == 1:
30556  *                 return result[0]             # <<<<<<<<<<<<<<
30557  *             return result
30558  *
30559  */
30560         __Pyx_XDECREF(__pyx_r);
30561         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L5_except_error)
30562         __Pyx_GOTREF(__pyx_t_1);
30563         __pyx_r = __pyx_t_1;
30564         __pyx_t_1 = 0;
30565         goto __pyx_L6_except_return;
30566 
30567         /* "View.MemoryView":493
30568  *             raise ValueError("Unable to convert item to object")
30569  *         else:
30570  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
30571  *                 return result[0]
30572  *             return result
30573  */
30574       }
30575 
30576       /* "View.MemoryView":495
30577  *             if len(self.view.format) == 1:
30578  *                 return result[0]
30579  *             return result             # <<<<<<<<<<<<<<
30580  *
30581  *     cdef assign_item_from_object(self, char *itemp, object value):
30582  */
30583       __Pyx_XDECREF(__pyx_r);
30584       __Pyx_INCREF(__pyx_v_result);
30585       __pyx_r = __pyx_v_result;
30586       goto __pyx_L6_except_return;
30587     }
30588     __pyx_L3_error:;
30589     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
30590     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30591     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
30592     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
30593     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
30594 
30595     /* "View.MemoryView":490
30596  *         try:
30597  *             result = struct.unpack(self.view.format, bytesitem)
30598  *         except struct.error:             # <<<<<<<<<<<<<<
30599  *             raise ValueError("Unable to convert item to object")
30600  *         else:
30601  */
30602     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
30603     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
30604     __Pyx_GOTREF(__pyx_t_6);
30605     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
30606     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30607     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
30608     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
30609     if (__pyx_t_8) {
30610       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
30611       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
30612       __Pyx_GOTREF(__pyx_t_9);
30613       __Pyx_GOTREF(__pyx_t_5);
30614       __Pyx_GOTREF(__pyx_t_1);
30615 
30616       /* "View.MemoryView":491
30617  *             result = struct.unpack(self.view.format, bytesitem)
30618  *         except struct.error:
30619  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
30620  *         else:
30621  *             if len(self.view.format) == 1:
30622  */
30623       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
30624       __Pyx_GOTREF(__pyx_t_6);
30625       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
30626       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30627       __PYX_ERR(1, 491, __pyx_L5_except_error)
30628     }
30629     goto __pyx_L5_except_error;
30630     __pyx_L5_except_error:;
30631 
30632     /* "View.MemoryView":488
30633  *
30634  *         bytesitem = itemp[:self.view.itemsize]
30635  *         try:             # <<<<<<<<<<<<<<
30636  *             result = struct.unpack(self.view.format, bytesitem)
30637  *         except struct.error:
30638  */
30639     __Pyx_XGIVEREF(__pyx_t_2);
30640     __Pyx_XGIVEREF(__pyx_t_3);
30641     __Pyx_XGIVEREF(__pyx_t_4);
30642     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
30643     goto __pyx_L1_error;
30644     __pyx_L6_except_return:;
30645     __Pyx_XGIVEREF(__pyx_t_2);
30646     __Pyx_XGIVEREF(__pyx_t_3);
30647     __Pyx_XGIVEREF(__pyx_t_4);
30648     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
30649     goto __pyx_L0;
30650   }
30651 
30652   /* "View.MemoryView":481
30653  *         self.assign_item_from_object(itemp, value)
30654  *
30655  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
30656  *         """Only used if instantiated manually by the user, or if Cython doesn't
30657  *         know how to convert the type"""
30658  */
30659 
30660   /* function exit code */
30661   __pyx_L1_error:;
30662   __Pyx_XDECREF(__pyx_t_1);
30663   __Pyx_XDECREF(__pyx_t_5);
30664   __Pyx_XDECREF(__pyx_t_6);
30665   __Pyx_XDECREF(__pyx_t_7);
30666   __Pyx_XDECREF(__pyx_t_9);
30667   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
30668   __pyx_r = 0;
30669   __pyx_L0:;
30670   __Pyx_XDECREF(__pyx_v_struct);
30671   __Pyx_XDECREF(__pyx_v_bytesitem);
30672   __Pyx_XDECREF(__pyx_v_result);
30673   __Pyx_XGIVEREF(__pyx_r);
30674   __Pyx_RefNannyFinishContext();
30675   return __pyx_r;
30676 }
30677 
30678 /* "View.MemoryView":497
30679  *             return result
30680  *
30681  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
30682  *         """Only used if instantiated manually by the user, or if Cython doesn't
30683  *         know how to convert the type"""
30684  */
30685 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)30686 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
30687   PyObject *__pyx_v_struct = NULL;
30688   char __pyx_v_c;
30689   PyObject *__pyx_v_bytesvalue = 0;
30690   Py_ssize_t __pyx_v_i;
30691   PyObject *__pyx_r = NULL;
30692   __Pyx_RefNannyDeclarations
30693   PyObject *__pyx_t_1 = NULL;
30694   int __pyx_t_2;
30695   int __pyx_t_3;
30696   PyObject *__pyx_t_4 = NULL;
30697   PyObject *__pyx_t_5 = NULL;
30698   PyObject *__pyx_t_6 = NULL;
30699   int __pyx_t_7;
30700   PyObject *__pyx_t_8 = NULL;
30701   Py_ssize_t __pyx_t_9;
30702   PyObject *__pyx_t_10 = NULL;
30703   char *__pyx_t_11;
30704   char *__pyx_t_12;
30705   char *__pyx_t_13;
30706   char *__pyx_t_14;
30707   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
30708 
30709   /* "View.MemoryView":500
30710  *         """Only used if instantiated manually by the user, or if Cython doesn't
30711  *         know how to convert the type"""
30712  *         import struct             # <<<<<<<<<<<<<<
30713  *         cdef char c
30714  *         cdef bytes bytesvalue
30715  */
30716   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
30717   __Pyx_GOTREF(__pyx_t_1);
30718   __pyx_v_struct = __pyx_t_1;
30719   __pyx_t_1 = 0;
30720 
30721   /* "View.MemoryView":505
30722  *         cdef Py_ssize_t i
30723  *
30724  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
30725  *             bytesvalue = struct.pack(self.view.format, *value)
30726  *         else:
30727  */
30728   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
30729   __pyx_t_3 = (__pyx_t_2 != 0);
30730   if (__pyx_t_3) {
30731 
30732     /* "View.MemoryView":506
30733  *
30734  *         if isinstance(value, tuple):
30735  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
30736  *         else:
30737  *             bytesvalue = struct.pack(self.view.format, value)
30738  */
30739     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
30740     __Pyx_GOTREF(__pyx_t_1);
30741     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
30742     __Pyx_GOTREF(__pyx_t_4);
30743     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
30744     __Pyx_GOTREF(__pyx_t_5);
30745     __Pyx_GIVEREF(__pyx_t_4);
30746     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
30747     __pyx_t_4 = 0;
30748     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
30749     __Pyx_GOTREF(__pyx_t_4);
30750     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
30751     __Pyx_GOTREF(__pyx_t_6);
30752     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30753     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30754     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
30755     __Pyx_GOTREF(__pyx_t_4);
30756     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30757     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30758     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 506, __pyx_L1_error)
30759     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
30760     __pyx_t_4 = 0;
30761 
30762     /* "View.MemoryView":505
30763  *         cdef Py_ssize_t i
30764  *
30765  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
30766  *             bytesvalue = struct.pack(self.view.format, *value)
30767  *         else:
30768  */
30769     goto __pyx_L3;
30770   }
30771 
30772   /* "View.MemoryView":508
30773  *             bytesvalue = struct.pack(self.view.format, *value)
30774  *         else:
30775  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
30776  *
30777  *         for i, c in enumerate(bytesvalue):
30778  */
30779   /*else*/ {
30780     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
30781     __Pyx_GOTREF(__pyx_t_6);
30782     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
30783     __Pyx_GOTREF(__pyx_t_1);
30784     __pyx_t_5 = NULL;
30785     __pyx_t_7 = 0;
30786     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
30787       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
30788       if (likely(__pyx_t_5)) {
30789         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
30790         __Pyx_INCREF(__pyx_t_5);
30791         __Pyx_INCREF(function);
30792         __Pyx_DECREF_SET(__pyx_t_6, function);
30793         __pyx_t_7 = 1;
30794       }
30795     }
30796     #if CYTHON_FAST_PYCALL
30797     if (PyFunction_Check(__pyx_t_6)) {
30798       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
30799       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
30800       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30801       __Pyx_GOTREF(__pyx_t_4);
30802       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30803     } else
30804     #endif
30805     #if CYTHON_FAST_PYCCALL
30806     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
30807       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
30808       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
30809       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30810       __Pyx_GOTREF(__pyx_t_4);
30811       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30812     } else
30813     #endif
30814     {
30815       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
30816       __Pyx_GOTREF(__pyx_t_8);
30817       if (__pyx_t_5) {
30818         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
30819       }
30820       __Pyx_GIVEREF(__pyx_t_1);
30821       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
30822       __Pyx_INCREF(__pyx_v_value);
30823       __Pyx_GIVEREF(__pyx_v_value);
30824       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
30825       __pyx_t_1 = 0;
30826       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
30827       __Pyx_GOTREF(__pyx_t_4);
30828       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30829     }
30830     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30831     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 508, __pyx_L1_error)
30832     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
30833     __pyx_t_4 = 0;
30834   }
30835   __pyx_L3:;
30836 
30837   /* "View.MemoryView":510
30838  *             bytesvalue = struct.pack(self.view.format, value)
30839  *
30840  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
30841  *             itemp[i] = c
30842  *
30843  */
30844   __pyx_t_9 = 0;
30845   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
30846     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
30847     __PYX_ERR(1, 510, __pyx_L1_error)
30848   }
30849   __Pyx_INCREF(__pyx_v_bytesvalue);
30850   __pyx_t_10 = __pyx_v_bytesvalue;
30851   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
30852   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
30853   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
30854     __pyx_t_11 = __pyx_t_14;
30855     __pyx_v_c = (__pyx_t_11[0]);
30856 
30857     /* "View.MemoryView":511
30858  *
30859  *         for i, c in enumerate(bytesvalue):
30860  *             itemp[i] = c             # <<<<<<<<<<<<<<
30861  *
30862  *     @cname('getbuffer')
30863  */
30864     __pyx_v_i = __pyx_t_9;
30865 
30866     /* "View.MemoryView":510
30867  *             bytesvalue = struct.pack(self.view.format, value)
30868  *
30869  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
30870  *             itemp[i] = c
30871  *
30872  */
30873     __pyx_t_9 = (__pyx_t_9 + 1);
30874 
30875     /* "View.MemoryView":511
30876  *
30877  *         for i, c in enumerate(bytesvalue):
30878  *             itemp[i] = c             # <<<<<<<<<<<<<<
30879  *
30880  *     @cname('getbuffer')
30881  */
30882     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
30883   }
30884   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
30885 
30886   /* "View.MemoryView":497
30887  *             return result
30888  *
30889  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
30890  *         """Only used if instantiated manually by the user, or if Cython doesn't
30891  *         know how to convert the type"""
30892  */
30893 
30894   /* function exit code */
30895   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30896   goto __pyx_L0;
30897   __pyx_L1_error:;
30898   __Pyx_XDECREF(__pyx_t_1);
30899   __Pyx_XDECREF(__pyx_t_4);
30900   __Pyx_XDECREF(__pyx_t_5);
30901   __Pyx_XDECREF(__pyx_t_6);
30902   __Pyx_XDECREF(__pyx_t_8);
30903   __Pyx_XDECREF(__pyx_t_10);
30904   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
30905   __pyx_r = 0;
30906   __pyx_L0:;
30907   __Pyx_XDECREF(__pyx_v_struct);
30908   __Pyx_XDECREF(__pyx_v_bytesvalue);
30909   __Pyx_XGIVEREF(__pyx_r);
30910   __Pyx_RefNannyFinishContext();
30911   return __pyx_r;
30912 }
30913 
30914 /* "View.MemoryView":514
30915  *
30916  *     @cname('getbuffer')
30917  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
30918  *         if flags & PyBUF_WRITABLE and self.view.readonly:
30919  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
30920  */
30921 
30922 /* Python wrapper */
30923 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
__pyx_memoryview_getbuffer(PyObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)30924 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
30925   int __pyx_r;
30926   __Pyx_RefNannyDeclarations
30927   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
30928   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
30929 
30930   /* function exit code */
30931   __Pyx_RefNannyFinishContext();
30932   return __pyx_r;
30933 }
30934 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)30935 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
30936   int __pyx_r;
30937   __Pyx_RefNannyDeclarations
30938   int __pyx_t_1;
30939   int __pyx_t_2;
30940   PyObject *__pyx_t_3 = NULL;
30941   Py_ssize_t *__pyx_t_4;
30942   char *__pyx_t_5;
30943   void *__pyx_t_6;
30944   int __pyx_t_7;
30945   Py_ssize_t __pyx_t_8;
30946   if (__pyx_v_info == NULL) {
30947     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
30948     return -1;
30949   }
30950   __Pyx_RefNannySetupContext("__getbuffer__", 0);
30951   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
30952   __Pyx_GIVEREF(__pyx_v_info->obj);
30953 
30954   /* "View.MemoryView":515
30955  *     @cname('getbuffer')
30956  *     def __getbuffer__(self, Py_buffer *info, int flags):
30957  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
30958  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
30959  *
30960  */
30961   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
30962   if (__pyx_t_2) {
30963   } else {
30964     __pyx_t_1 = __pyx_t_2;
30965     goto __pyx_L4_bool_binop_done;
30966   }
30967   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
30968   __pyx_t_1 = __pyx_t_2;
30969   __pyx_L4_bool_binop_done:;
30970   if (unlikely(__pyx_t_1)) {
30971 
30972     /* "View.MemoryView":516
30973  *     def __getbuffer__(self, Py_buffer *info, int flags):
30974  *         if flags & PyBUF_WRITABLE and self.view.readonly:
30975  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
30976  *
30977  *         if flags & PyBUF_ND:
30978  */
30979     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
30980     __Pyx_GOTREF(__pyx_t_3);
30981     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
30982     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30983     __PYX_ERR(1, 516, __pyx_L1_error)
30984 
30985     /* "View.MemoryView":515
30986  *     @cname('getbuffer')
30987  *     def __getbuffer__(self, Py_buffer *info, int flags):
30988  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
30989  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
30990  *
30991  */
30992   }
30993 
30994   /* "View.MemoryView":518
30995  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
30996  *
30997  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
30998  *             info.shape = self.view.shape
30999  *         else:
31000  */
31001   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
31002   if (__pyx_t_1) {
31003 
31004     /* "View.MemoryView":519
31005  *
31006  *         if flags & PyBUF_ND:
31007  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
31008  *         else:
31009  *             info.shape = NULL
31010  */
31011     __pyx_t_4 = __pyx_v_self->view.shape;
31012     __pyx_v_info->shape = __pyx_t_4;
31013 
31014     /* "View.MemoryView":518
31015  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
31016  *
31017  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
31018  *             info.shape = self.view.shape
31019  *         else:
31020  */
31021     goto __pyx_L6;
31022   }
31023 
31024   /* "View.MemoryView":521
31025  *             info.shape = self.view.shape
31026  *         else:
31027  *             info.shape = NULL             # <<<<<<<<<<<<<<
31028  *
31029  *         if flags & PyBUF_STRIDES:
31030  */
31031   /*else*/ {
31032     __pyx_v_info->shape = NULL;
31033   }
31034   __pyx_L6:;
31035 
31036   /* "View.MemoryView":523
31037  *             info.shape = NULL
31038  *
31039  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
31040  *             info.strides = self.view.strides
31041  *         else:
31042  */
31043   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
31044   if (__pyx_t_1) {
31045 
31046     /* "View.MemoryView":524
31047  *
31048  *         if flags & PyBUF_STRIDES:
31049  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
31050  *         else:
31051  *             info.strides = NULL
31052  */
31053     __pyx_t_4 = __pyx_v_self->view.strides;
31054     __pyx_v_info->strides = __pyx_t_4;
31055 
31056     /* "View.MemoryView":523
31057  *             info.shape = NULL
31058  *
31059  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
31060  *             info.strides = self.view.strides
31061  *         else:
31062  */
31063     goto __pyx_L7;
31064   }
31065 
31066   /* "View.MemoryView":526
31067  *             info.strides = self.view.strides
31068  *         else:
31069  *             info.strides = NULL             # <<<<<<<<<<<<<<
31070  *
31071  *         if flags & PyBUF_INDIRECT:
31072  */
31073   /*else*/ {
31074     __pyx_v_info->strides = NULL;
31075   }
31076   __pyx_L7:;
31077 
31078   /* "View.MemoryView":528
31079  *             info.strides = NULL
31080  *
31081  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
31082  *             info.suboffsets = self.view.suboffsets
31083  *         else:
31084  */
31085   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
31086   if (__pyx_t_1) {
31087 
31088     /* "View.MemoryView":529
31089  *
31090  *         if flags & PyBUF_INDIRECT:
31091  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
31092  *         else:
31093  *             info.suboffsets = NULL
31094  */
31095     __pyx_t_4 = __pyx_v_self->view.suboffsets;
31096     __pyx_v_info->suboffsets = __pyx_t_4;
31097 
31098     /* "View.MemoryView":528
31099  *             info.strides = NULL
31100  *
31101  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
31102  *             info.suboffsets = self.view.suboffsets
31103  *         else:
31104  */
31105     goto __pyx_L8;
31106   }
31107 
31108   /* "View.MemoryView":531
31109  *             info.suboffsets = self.view.suboffsets
31110  *         else:
31111  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
31112  *
31113  *         if flags & PyBUF_FORMAT:
31114  */
31115   /*else*/ {
31116     __pyx_v_info->suboffsets = NULL;
31117   }
31118   __pyx_L8:;
31119 
31120   /* "View.MemoryView":533
31121  *             info.suboffsets = NULL
31122  *
31123  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
31124  *             info.format = self.view.format
31125  *         else:
31126  */
31127   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
31128   if (__pyx_t_1) {
31129 
31130     /* "View.MemoryView":534
31131  *
31132  *         if flags & PyBUF_FORMAT:
31133  *             info.format = self.view.format             # <<<<<<<<<<<<<<
31134  *         else:
31135  *             info.format = NULL
31136  */
31137     __pyx_t_5 = __pyx_v_self->view.format;
31138     __pyx_v_info->format = __pyx_t_5;
31139 
31140     /* "View.MemoryView":533
31141  *             info.suboffsets = NULL
31142  *
31143  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
31144  *             info.format = self.view.format
31145  *         else:
31146  */
31147     goto __pyx_L9;
31148   }
31149 
31150   /* "View.MemoryView":536
31151  *             info.format = self.view.format
31152  *         else:
31153  *             info.format = NULL             # <<<<<<<<<<<<<<
31154  *
31155  *         info.buf = self.view.buf
31156  */
31157   /*else*/ {
31158     __pyx_v_info->format = NULL;
31159   }
31160   __pyx_L9:;
31161 
31162   /* "View.MemoryView":538
31163  *             info.format = NULL
31164  *
31165  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
31166  *         info.ndim = self.view.ndim
31167  *         info.itemsize = self.view.itemsize
31168  */
31169   __pyx_t_6 = __pyx_v_self->view.buf;
31170   __pyx_v_info->buf = __pyx_t_6;
31171 
31172   /* "View.MemoryView":539
31173  *
31174  *         info.buf = self.view.buf
31175  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
31176  *         info.itemsize = self.view.itemsize
31177  *         info.len = self.view.len
31178  */
31179   __pyx_t_7 = __pyx_v_self->view.ndim;
31180   __pyx_v_info->ndim = __pyx_t_7;
31181 
31182   /* "View.MemoryView":540
31183  *         info.buf = self.view.buf
31184  *         info.ndim = self.view.ndim
31185  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
31186  *         info.len = self.view.len
31187  *         info.readonly = self.view.readonly
31188  */
31189   __pyx_t_8 = __pyx_v_self->view.itemsize;
31190   __pyx_v_info->itemsize = __pyx_t_8;
31191 
31192   /* "View.MemoryView":541
31193  *         info.ndim = self.view.ndim
31194  *         info.itemsize = self.view.itemsize
31195  *         info.len = self.view.len             # <<<<<<<<<<<<<<
31196  *         info.readonly = self.view.readonly
31197  *         info.obj = self
31198  */
31199   __pyx_t_8 = __pyx_v_self->view.len;
31200   __pyx_v_info->len = __pyx_t_8;
31201 
31202   /* "View.MemoryView":542
31203  *         info.itemsize = self.view.itemsize
31204  *         info.len = self.view.len
31205  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
31206  *         info.obj = self
31207  *
31208  */
31209   __pyx_t_1 = __pyx_v_self->view.readonly;
31210   __pyx_v_info->readonly = __pyx_t_1;
31211 
31212   /* "View.MemoryView":543
31213  *         info.len = self.view.len
31214  *         info.readonly = self.view.readonly
31215  *         info.obj = self             # <<<<<<<<<<<<<<
31216  *
31217  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
31218  */
31219   __Pyx_INCREF(((PyObject *)__pyx_v_self));
31220   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
31221   __Pyx_GOTREF(__pyx_v_info->obj);
31222   __Pyx_DECREF(__pyx_v_info->obj);
31223   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
31224 
31225   /* "View.MemoryView":514
31226  *
31227  *     @cname('getbuffer')
31228  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
31229  *         if flags & PyBUF_WRITABLE and self.view.readonly:
31230  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
31231  */
31232 
31233   /* function exit code */
31234   __pyx_r = 0;
31235   goto __pyx_L0;
31236   __pyx_L1_error:;
31237   __Pyx_XDECREF(__pyx_t_3);
31238   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31239   __pyx_r = -1;
31240   if (__pyx_v_info->obj != NULL) {
31241     __Pyx_GOTREF(__pyx_v_info->obj);
31242     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
31243   }
31244   goto __pyx_L2;
31245   __pyx_L0:;
31246   if (__pyx_v_info->obj == Py_None) {
31247     __Pyx_GOTREF(__pyx_v_info->obj);
31248     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
31249   }
31250   __pyx_L2:;
31251   __Pyx_RefNannyFinishContext();
31252   return __pyx_r;
31253 }
31254 
31255 /* "View.MemoryView":549
31256  *
31257  *     @property
31258  *     def T(self):             # <<<<<<<<<<<<<<
31259  *         cdef _memoryviewslice result = memoryview_copy(self)
31260  *         transpose_memslice(&result.from_slice)
31261  */
31262 
31263 /* Python wrapper */
31264 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject * __pyx_v_self)31265 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
31266   PyObject *__pyx_r = 0;
31267   __Pyx_RefNannyDeclarations
31268   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31269   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31270 
31271   /* function exit code */
31272   __Pyx_RefNannyFinishContext();
31273   return __pyx_r;
31274 }
31275 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)31276 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31277   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
31278   PyObject *__pyx_r = NULL;
31279   __Pyx_RefNannyDeclarations
31280   PyObject *__pyx_t_1 = NULL;
31281   int __pyx_t_2;
31282   __Pyx_RefNannySetupContext("__get__", 0);
31283 
31284   /* "View.MemoryView":550
31285  *     @property
31286  *     def T(self):
31287  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
31288  *         transpose_memslice(&result.from_slice)
31289  *         return result
31290  */
31291   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
31292   __Pyx_GOTREF(__pyx_t_1);
31293   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
31294   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
31295   __pyx_t_1 = 0;
31296 
31297   /* "View.MemoryView":551
31298  *     def T(self):
31299  *         cdef _memoryviewslice result = memoryview_copy(self)
31300  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
31301  *         return result
31302  *
31303  */
31304   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
31305 
31306   /* "View.MemoryView":552
31307  *         cdef _memoryviewslice result = memoryview_copy(self)
31308  *         transpose_memslice(&result.from_slice)
31309  *         return result             # <<<<<<<<<<<<<<
31310  *
31311  *     @property
31312  */
31313   __Pyx_XDECREF(__pyx_r);
31314   __Pyx_INCREF(((PyObject *)__pyx_v_result));
31315   __pyx_r = ((PyObject *)__pyx_v_result);
31316   goto __pyx_L0;
31317 
31318   /* "View.MemoryView":549
31319  *
31320  *     @property
31321  *     def T(self):             # <<<<<<<<<<<<<<
31322  *         cdef _memoryviewslice result = memoryview_copy(self)
31323  *         transpose_memslice(&result.from_slice)
31324  */
31325 
31326   /* function exit code */
31327   __pyx_L1_error:;
31328   __Pyx_XDECREF(__pyx_t_1);
31329   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31330   __pyx_r = NULL;
31331   __pyx_L0:;
31332   __Pyx_XDECREF((PyObject *)__pyx_v_result);
31333   __Pyx_XGIVEREF(__pyx_r);
31334   __Pyx_RefNannyFinishContext();
31335   return __pyx_r;
31336 }
31337 
31338 /* "View.MemoryView":555
31339  *
31340  *     @property
31341  *     def base(self):             # <<<<<<<<<<<<<<
31342  *         return self.obj
31343  *
31344  */
31345 
31346 /* Python wrapper */
31347 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject * __pyx_v_self)31348 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
31349   PyObject *__pyx_r = 0;
31350   __Pyx_RefNannyDeclarations
31351   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31352   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31353 
31354   /* function exit code */
31355   __Pyx_RefNannyFinishContext();
31356   return __pyx_r;
31357 }
31358 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)31359 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31360   PyObject *__pyx_r = NULL;
31361   __Pyx_RefNannyDeclarations
31362   __Pyx_RefNannySetupContext("__get__", 0);
31363 
31364   /* "View.MemoryView":556
31365  *     @property
31366  *     def base(self):
31367  *         return self.obj             # <<<<<<<<<<<<<<
31368  *
31369  *     @property
31370  */
31371   __Pyx_XDECREF(__pyx_r);
31372   __Pyx_INCREF(__pyx_v_self->obj);
31373   __pyx_r = __pyx_v_self->obj;
31374   goto __pyx_L0;
31375 
31376   /* "View.MemoryView":555
31377  *
31378  *     @property
31379  *     def base(self):             # <<<<<<<<<<<<<<
31380  *         return self.obj
31381  *
31382  */
31383 
31384   /* function exit code */
31385   __pyx_L0:;
31386   __Pyx_XGIVEREF(__pyx_r);
31387   __Pyx_RefNannyFinishContext();
31388   return __pyx_r;
31389 }
31390 
31391 /* "View.MemoryView":559
31392  *
31393  *     @property
31394  *     def shape(self):             # <<<<<<<<<<<<<<
31395  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
31396  *
31397  */
31398 
31399 /* Python wrapper */
31400 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject * __pyx_v_self)31401 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
31402   PyObject *__pyx_r = 0;
31403   __Pyx_RefNannyDeclarations
31404   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31405   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31406 
31407   /* function exit code */
31408   __Pyx_RefNannyFinishContext();
31409   return __pyx_r;
31410 }
31411 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)31412 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31413   Py_ssize_t __pyx_v_length;
31414   PyObject *__pyx_r = NULL;
31415   __Pyx_RefNannyDeclarations
31416   PyObject *__pyx_t_1 = NULL;
31417   Py_ssize_t *__pyx_t_2;
31418   Py_ssize_t *__pyx_t_3;
31419   Py_ssize_t *__pyx_t_4;
31420   PyObject *__pyx_t_5 = NULL;
31421   __Pyx_RefNannySetupContext("__get__", 0);
31422 
31423   /* "View.MemoryView":560
31424  *     @property
31425  *     def shape(self):
31426  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
31427  *
31428  *     @property
31429  */
31430   __Pyx_XDECREF(__pyx_r);
31431   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
31432   __Pyx_GOTREF(__pyx_t_1);
31433   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
31434   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
31435     __pyx_t_2 = __pyx_t_4;
31436     __pyx_v_length = (__pyx_t_2[0]);
31437     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
31438     __Pyx_GOTREF(__pyx_t_5);
31439     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
31440     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31441   }
31442   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
31443   __Pyx_GOTREF(__pyx_t_5);
31444   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31445   __pyx_r = __pyx_t_5;
31446   __pyx_t_5 = 0;
31447   goto __pyx_L0;
31448 
31449   /* "View.MemoryView":559
31450  *
31451  *     @property
31452  *     def shape(self):             # <<<<<<<<<<<<<<
31453  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
31454  *
31455  */
31456 
31457   /* function exit code */
31458   __pyx_L1_error:;
31459   __Pyx_XDECREF(__pyx_t_1);
31460   __Pyx_XDECREF(__pyx_t_5);
31461   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31462   __pyx_r = NULL;
31463   __pyx_L0:;
31464   __Pyx_XGIVEREF(__pyx_r);
31465   __Pyx_RefNannyFinishContext();
31466   return __pyx_r;
31467 }
31468 
31469 /* "View.MemoryView":563
31470  *
31471  *     @property
31472  *     def strides(self):             # <<<<<<<<<<<<<<
31473  *         if self.view.strides == NULL:
31474  *
31475  */
31476 
31477 /* Python wrapper */
31478 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject * __pyx_v_self)31479 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
31480   PyObject *__pyx_r = 0;
31481   __Pyx_RefNannyDeclarations
31482   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31483   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31484 
31485   /* function exit code */
31486   __Pyx_RefNannyFinishContext();
31487   return __pyx_r;
31488 }
31489 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)31490 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31491   Py_ssize_t __pyx_v_stride;
31492   PyObject *__pyx_r = NULL;
31493   __Pyx_RefNannyDeclarations
31494   int __pyx_t_1;
31495   PyObject *__pyx_t_2 = NULL;
31496   Py_ssize_t *__pyx_t_3;
31497   Py_ssize_t *__pyx_t_4;
31498   Py_ssize_t *__pyx_t_5;
31499   PyObject *__pyx_t_6 = NULL;
31500   __Pyx_RefNannySetupContext("__get__", 0);
31501 
31502   /* "View.MemoryView":564
31503  *     @property
31504  *     def strides(self):
31505  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
31506  *
31507  *             raise ValueError("Buffer view does not expose strides")
31508  */
31509   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
31510   if (unlikely(__pyx_t_1)) {
31511 
31512     /* "View.MemoryView":566
31513  *         if self.view.strides == NULL:
31514  *
31515  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
31516  *
31517  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
31518  */
31519     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
31520     __Pyx_GOTREF(__pyx_t_2);
31521     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
31522     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31523     __PYX_ERR(1, 566, __pyx_L1_error)
31524 
31525     /* "View.MemoryView":564
31526  *     @property
31527  *     def strides(self):
31528  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
31529  *
31530  *             raise ValueError("Buffer view does not expose strides")
31531  */
31532   }
31533 
31534   /* "View.MemoryView":568
31535  *             raise ValueError("Buffer view does not expose strides")
31536  *
31537  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
31538  *
31539  *     @property
31540  */
31541   __Pyx_XDECREF(__pyx_r);
31542   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
31543   __Pyx_GOTREF(__pyx_t_2);
31544   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
31545   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
31546     __pyx_t_3 = __pyx_t_5;
31547     __pyx_v_stride = (__pyx_t_3[0]);
31548     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
31549     __Pyx_GOTREF(__pyx_t_6);
31550     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
31551     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31552   }
31553   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
31554   __Pyx_GOTREF(__pyx_t_6);
31555   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31556   __pyx_r = __pyx_t_6;
31557   __pyx_t_6 = 0;
31558   goto __pyx_L0;
31559 
31560   /* "View.MemoryView":563
31561  *
31562  *     @property
31563  *     def strides(self):             # <<<<<<<<<<<<<<
31564  *         if self.view.strides == NULL:
31565  *
31566  */
31567 
31568   /* function exit code */
31569   __pyx_L1_error:;
31570   __Pyx_XDECREF(__pyx_t_2);
31571   __Pyx_XDECREF(__pyx_t_6);
31572   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31573   __pyx_r = NULL;
31574   __pyx_L0:;
31575   __Pyx_XGIVEREF(__pyx_r);
31576   __Pyx_RefNannyFinishContext();
31577   return __pyx_r;
31578 }
31579 
31580 /* "View.MemoryView":571
31581  *
31582  *     @property
31583  *     def suboffsets(self):             # <<<<<<<<<<<<<<
31584  *         if self.view.suboffsets == NULL:
31585  *             return (-1,) * self.view.ndim
31586  */
31587 
31588 /* Python wrapper */
31589 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject * __pyx_v_self)31590 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
31591   PyObject *__pyx_r = 0;
31592   __Pyx_RefNannyDeclarations
31593   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31594   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31595 
31596   /* function exit code */
31597   __Pyx_RefNannyFinishContext();
31598   return __pyx_r;
31599 }
31600 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)31601 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31602   Py_ssize_t __pyx_v_suboffset;
31603   PyObject *__pyx_r = NULL;
31604   __Pyx_RefNannyDeclarations
31605   int __pyx_t_1;
31606   PyObject *__pyx_t_2 = NULL;
31607   PyObject *__pyx_t_3 = NULL;
31608   Py_ssize_t *__pyx_t_4;
31609   Py_ssize_t *__pyx_t_5;
31610   Py_ssize_t *__pyx_t_6;
31611   __Pyx_RefNannySetupContext("__get__", 0);
31612 
31613   /* "View.MemoryView":572
31614  *     @property
31615  *     def suboffsets(self):
31616  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
31617  *             return (-1,) * self.view.ndim
31618  *
31619  */
31620   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
31621   if (__pyx_t_1) {
31622 
31623     /* "View.MemoryView":573
31624  *     def suboffsets(self):
31625  *         if self.view.suboffsets == NULL:
31626  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
31627  *
31628  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
31629  */
31630     __Pyx_XDECREF(__pyx_r);
31631     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
31632     __Pyx_GOTREF(__pyx_t_2);
31633     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__36, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
31634     __Pyx_GOTREF(__pyx_t_3);
31635     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31636     __pyx_r = __pyx_t_3;
31637     __pyx_t_3 = 0;
31638     goto __pyx_L0;
31639 
31640     /* "View.MemoryView":572
31641  *     @property
31642  *     def suboffsets(self):
31643  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
31644  *             return (-1,) * self.view.ndim
31645  *
31646  */
31647   }
31648 
31649   /* "View.MemoryView":575
31650  *             return (-1,) * self.view.ndim
31651  *
31652  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
31653  *
31654  *     @property
31655  */
31656   __Pyx_XDECREF(__pyx_r);
31657   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
31658   __Pyx_GOTREF(__pyx_t_3);
31659   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
31660   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
31661     __pyx_t_4 = __pyx_t_6;
31662     __pyx_v_suboffset = (__pyx_t_4[0]);
31663     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
31664     __Pyx_GOTREF(__pyx_t_2);
31665     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
31666     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31667   }
31668   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
31669   __Pyx_GOTREF(__pyx_t_2);
31670   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31671   __pyx_r = __pyx_t_2;
31672   __pyx_t_2 = 0;
31673   goto __pyx_L0;
31674 
31675   /* "View.MemoryView":571
31676  *
31677  *     @property
31678  *     def suboffsets(self):             # <<<<<<<<<<<<<<
31679  *         if self.view.suboffsets == NULL:
31680  *             return (-1,) * self.view.ndim
31681  */
31682 
31683   /* function exit code */
31684   __pyx_L1_error:;
31685   __Pyx_XDECREF(__pyx_t_2);
31686   __Pyx_XDECREF(__pyx_t_3);
31687   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31688   __pyx_r = NULL;
31689   __pyx_L0:;
31690   __Pyx_XGIVEREF(__pyx_r);
31691   __Pyx_RefNannyFinishContext();
31692   return __pyx_r;
31693 }
31694 
31695 /* "View.MemoryView":578
31696  *
31697  *     @property
31698  *     def ndim(self):             # <<<<<<<<<<<<<<
31699  *         return self.view.ndim
31700  *
31701  */
31702 
31703 /* Python wrapper */
31704 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject * __pyx_v_self)31705 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
31706   PyObject *__pyx_r = 0;
31707   __Pyx_RefNannyDeclarations
31708   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31709   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31710 
31711   /* function exit code */
31712   __Pyx_RefNannyFinishContext();
31713   return __pyx_r;
31714 }
31715 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)31716 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31717   PyObject *__pyx_r = NULL;
31718   __Pyx_RefNannyDeclarations
31719   PyObject *__pyx_t_1 = NULL;
31720   __Pyx_RefNannySetupContext("__get__", 0);
31721 
31722   /* "View.MemoryView":579
31723  *     @property
31724  *     def ndim(self):
31725  *         return self.view.ndim             # <<<<<<<<<<<<<<
31726  *
31727  *     @property
31728  */
31729   __Pyx_XDECREF(__pyx_r);
31730   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
31731   __Pyx_GOTREF(__pyx_t_1);
31732   __pyx_r = __pyx_t_1;
31733   __pyx_t_1 = 0;
31734   goto __pyx_L0;
31735 
31736   /* "View.MemoryView":578
31737  *
31738  *     @property
31739  *     def ndim(self):             # <<<<<<<<<<<<<<
31740  *         return self.view.ndim
31741  *
31742  */
31743 
31744   /* function exit code */
31745   __pyx_L1_error:;
31746   __Pyx_XDECREF(__pyx_t_1);
31747   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31748   __pyx_r = NULL;
31749   __pyx_L0:;
31750   __Pyx_XGIVEREF(__pyx_r);
31751   __Pyx_RefNannyFinishContext();
31752   return __pyx_r;
31753 }
31754 
31755 /* "View.MemoryView":582
31756  *
31757  *     @property
31758  *     def itemsize(self):             # <<<<<<<<<<<<<<
31759  *         return self.view.itemsize
31760  *
31761  */
31762 
31763 /* Python wrapper */
31764 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject * __pyx_v_self)31765 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
31766   PyObject *__pyx_r = 0;
31767   __Pyx_RefNannyDeclarations
31768   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31769   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31770 
31771   /* function exit code */
31772   __Pyx_RefNannyFinishContext();
31773   return __pyx_r;
31774 }
31775 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)31776 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31777   PyObject *__pyx_r = NULL;
31778   __Pyx_RefNannyDeclarations
31779   PyObject *__pyx_t_1 = NULL;
31780   __Pyx_RefNannySetupContext("__get__", 0);
31781 
31782   /* "View.MemoryView":583
31783  *     @property
31784  *     def itemsize(self):
31785  *         return self.view.itemsize             # <<<<<<<<<<<<<<
31786  *
31787  *     @property
31788  */
31789   __Pyx_XDECREF(__pyx_r);
31790   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
31791   __Pyx_GOTREF(__pyx_t_1);
31792   __pyx_r = __pyx_t_1;
31793   __pyx_t_1 = 0;
31794   goto __pyx_L0;
31795 
31796   /* "View.MemoryView":582
31797  *
31798  *     @property
31799  *     def itemsize(self):             # <<<<<<<<<<<<<<
31800  *         return self.view.itemsize
31801  *
31802  */
31803 
31804   /* function exit code */
31805   __pyx_L1_error:;
31806   __Pyx_XDECREF(__pyx_t_1);
31807   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31808   __pyx_r = NULL;
31809   __pyx_L0:;
31810   __Pyx_XGIVEREF(__pyx_r);
31811   __Pyx_RefNannyFinishContext();
31812   return __pyx_r;
31813 }
31814 
31815 /* "View.MemoryView":586
31816  *
31817  *     @property
31818  *     def nbytes(self):             # <<<<<<<<<<<<<<
31819  *         return self.size * self.view.itemsize
31820  *
31821  */
31822 
31823 /* Python wrapper */
31824 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject * __pyx_v_self)31825 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
31826   PyObject *__pyx_r = 0;
31827   __Pyx_RefNannyDeclarations
31828   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31829   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31830 
31831   /* function exit code */
31832   __Pyx_RefNannyFinishContext();
31833   return __pyx_r;
31834 }
31835 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)31836 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31837   PyObject *__pyx_r = NULL;
31838   __Pyx_RefNannyDeclarations
31839   PyObject *__pyx_t_1 = NULL;
31840   PyObject *__pyx_t_2 = NULL;
31841   PyObject *__pyx_t_3 = NULL;
31842   __Pyx_RefNannySetupContext("__get__", 0);
31843 
31844   /* "View.MemoryView":587
31845  *     @property
31846  *     def nbytes(self):
31847  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
31848  *
31849  *     @property
31850  */
31851   __Pyx_XDECREF(__pyx_r);
31852   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
31853   __Pyx_GOTREF(__pyx_t_1);
31854   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
31855   __Pyx_GOTREF(__pyx_t_2);
31856   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
31857   __Pyx_GOTREF(__pyx_t_3);
31858   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31859   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31860   __pyx_r = __pyx_t_3;
31861   __pyx_t_3 = 0;
31862   goto __pyx_L0;
31863 
31864   /* "View.MemoryView":586
31865  *
31866  *     @property
31867  *     def nbytes(self):             # <<<<<<<<<<<<<<
31868  *         return self.size * self.view.itemsize
31869  *
31870  */
31871 
31872   /* function exit code */
31873   __pyx_L1_error:;
31874   __Pyx_XDECREF(__pyx_t_1);
31875   __Pyx_XDECREF(__pyx_t_2);
31876   __Pyx_XDECREF(__pyx_t_3);
31877   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31878   __pyx_r = NULL;
31879   __pyx_L0:;
31880   __Pyx_XGIVEREF(__pyx_r);
31881   __Pyx_RefNannyFinishContext();
31882   return __pyx_r;
31883 }
31884 
31885 /* "View.MemoryView":590
31886  *
31887  *     @property
31888  *     def size(self):             # <<<<<<<<<<<<<<
31889  *         if self._size is None:
31890  *             result = 1
31891  */
31892 
31893 /* Python wrapper */
31894 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject * __pyx_v_self)31895 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
31896   PyObject *__pyx_r = 0;
31897   __Pyx_RefNannyDeclarations
31898   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31899   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
31900 
31901   /* function exit code */
31902   __Pyx_RefNannyFinishContext();
31903   return __pyx_r;
31904 }
31905 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)31906 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
31907   PyObject *__pyx_v_result = NULL;
31908   PyObject *__pyx_v_length = NULL;
31909   PyObject *__pyx_r = NULL;
31910   __Pyx_RefNannyDeclarations
31911   int __pyx_t_1;
31912   int __pyx_t_2;
31913   Py_ssize_t *__pyx_t_3;
31914   Py_ssize_t *__pyx_t_4;
31915   Py_ssize_t *__pyx_t_5;
31916   PyObject *__pyx_t_6 = NULL;
31917   __Pyx_RefNannySetupContext("__get__", 0);
31918 
31919   /* "View.MemoryView":591
31920  *     @property
31921  *     def size(self):
31922  *         if self._size is None:             # <<<<<<<<<<<<<<
31923  *             result = 1
31924  *
31925  */
31926   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
31927   __pyx_t_2 = (__pyx_t_1 != 0);
31928   if (__pyx_t_2) {
31929 
31930     /* "View.MemoryView":592
31931  *     def size(self):
31932  *         if self._size is None:
31933  *             result = 1             # <<<<<<<<<<<<<<
31934  *
31935  *             for length in self.view.shape[:self.view.ndim]:
31936  */
31937     __Pyx_INCREF(__pyx_int_1);
31938     __pyx_v_result = __pyx_int_1;
31939 
31940     /* "View.MemoryView":594
31941  *             result = 1
31942  *
31943  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
31944  *                 result *= length
31945  *
31946  */
31947     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
31948     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
31949       __pyx_t_3 = __pyx_t_5;
31950       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
31951       __Pyx_GOTREF(__pyx_t_6);
31952       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
31953       __pyx_t_6 = 0;
31954 
31955       /* "View.MemoryView":595
31956  *
31957  *             for length in self.view.shape[:self.view.ndim]:
31958  *                 result *= length             # <<<<<<<<<<<<<<
31959  *
31960  *             self._size = result
31961  */
31962       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
31963       __Pyx_GOTREF(__pyx_t_6);
31964       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
31965       __pyx_t_6 = 0;
31966     }
31967 
31968     /* "View.MemoryView":597
31969  *                 result *= length
31970  *
31971  *             self._size = result             # <<<<<<<<<<<<<<
31972  *
31973  *         return self._size
31974  */
31975     __Pyx_INCREF(__pyx_v_result);
31976     __Pyx_GIVEREF(__pyx_v_result);
31977     __Pyx_GOTREF(__pyx_v_self->_size);
31978     __Pyx_DECREF(__pyx_v_self->_size);
31979     __pyx_v_self->_size = __pyx_v_result;
31980 
31981     /* "View.MemoryView":591
31982  *     @property
31983  *     def size(self):
31984  *         if self._size is None:             # <<<<<<<<<<<<<<
31985  *             result = 1
31986  *
31987  */
31988   }
31989 
31990   /* "View.MemoryView":599
31991  *             self._size = result
31992  *
31993  *         return self._size             # <<<<<<<<<<<<<<
31994  *
31995  *     def __len__(self):
31996  */
31997   __Pyx_XDECREF(__pyx_r);
31998   __Pyx_INCREF(__pyx_v_self->_size);
31999   __pyx_r = __pyx_v_self->_size;
32000   goto __pyx_L0;
32001 
32002   /* "View.MemoryView":590
32003  *
32004  *     @property
32005  *     def size(self):             # <<<<<<<<<<<<<<
32006  *         if self._size is None:
32007  *             result = 1
32008  */
32009 
32010   /* function exit code */
32011   __pyx_L1_error:;
32012   __Pyx_XDECREF(__pyx_t_6);
32013   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32014   __pyx_r = NULL;
32015   __pyx_L0:;
32016   __Pyx_XDECREF(__pyx_v_result);
32017   __Pyx_XDECREF(__pyx_v_length);
32018   __Pyx_XGIVEREF(__pyx_r);
32019   __Pyx_RefNannyFinishContext();
32020   return __pyx_r;
32021 }
32022 
32023 /* "View.MemoryView":601
32024  *         return self._size
32025  *
32026  *     def __len__(self):             # <<<<<<<<<<<<<<
32027  *         if self.view.ndim >= 1:
32028  *             return self.view.shape[0]
32029  */
32030 
32031 /* Python wrapper */
32032 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)32033 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
32034   Py_ssize_t __pyx_r;
32035   __Pyx_RefNannyDeclarations
32036   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
32037   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
32038 
32039   /* function exit code */
32040   __Pyx_RefNannyFinishContext();
32041   return __pyx_r;
32042 }
32043 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)32044 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
32045   Py_ssize_t __pyx_r;
32046   __Pyx_RefNannyDeclarations
32047   int __pyx_t_1;
32048   __Pyx_RefNannySetupContext("__len__", 0);
32049 
32050   /* "View.MemoryView":602
32051  *
32052  *     def __len__(self):
32053  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
32054  *             return self.view.shape[0]
32055  *
32056  */
32057   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
32058   if (__pyx_t_1) {
32059 
32060     /* "View.MemoryView":603
32061  *     def __len__(self):
32062  *         if self.view.ndim >= 1:
32063  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
32064  *
32065  *         return 0
32066  */
32067     __pyx_r = (__pyx_v_self->view.shape[0]);
32068     goto __pyx_L0;
32069 
32070     /* "View.MemoryView":602
32071  *
32072  *     def __len__(self):
32073  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
32074  *             return self.view.shape[0]
32075  *
32076  */
32077   }
32078 
32079   /* "View.MemoryView":605
32080  *             return self.view.shape[0]
32081  *
32082  *         return 0             # <<<<<<<<<<<<<<
32083  *
32084  *     def __repr__(self):
32085  */
32086   __pyx_r = 0;
32087   goto __pyx_L0;
32088 
32089   /* "View.MemoryView":601
32090  *         return self._size
32091  *
32092  *     def __len__(self):             # <<<<<<<<<<<<<<
32093  *         if self.view.ndim >= 1:
32094  *             return self.view.shape[0]
32095  */
32096 
32097   /* function exit code */
32098   __pyx_L0:;
32099   __Pyx_RefNannyFinishContext();
32100   return __pyx_r;
32101 }
32102 
32103 /* "View.MemoryView":607
32104  *         return 0
32105  *
32106  *     def __repr__(self):             # <<<<<<<<<<<<<<
32107  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
32108  *                                                id(self))
32109  */
32110 
32111 /* Python wrapper */
32112 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)32113 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
32114   PyObject *__pyx_r = 0;
32115   __Pyx_RefNannyDeclarations
32116   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
32117   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
32118 
32119   /* function exit code */
32120   __Pyx_RefNannyFinishContext();
32121   return __pyx_r;
32122 }
32123 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)32124 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
32125   PyObject *__pyx_r = NULL;
32126   __Pyx_RefNannyDeclarations
32127   PyObject *__pyx_t_1 = NULL;
32128   PyObject *__pyx_t_2 = NULL;
32129   PyObject *__pyx_t_3 = NULL;
32130   __Pyx_RefNannySetupContext("__repr__", 0);
32131 
32132   /* "View.MemoryView":608
32133  *
32134  *     def __repr__(self):
32135  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
32136  *                                                id(self))
32137  *
32138  */
32139   __Pyx_XDECREF(__pyx_r);
32140   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
32141   __Pyx_GOTREF(__pyx_t_1);
32142   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
32143   __Pyx_GOTREF(__pyx_t_2);
32144   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32145   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
32146   __Pyx_GOTREF(__pyx_t_1);
32147   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32148 
32149   /* "View.MemoryView":609
32150  *     def __repr__(self):
32151  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
32152  *                                                id(self))             # <<<<<<<<<<<<<<
32153  *
32154  *     def __str__(self):
32155  */
32156   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
32157   __Pyx_GOTREF(__pyx_t_2);
32158 
32159   /* "View.MemoryView":608
32160  *
32161  *     def __repr__(self):
32162  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
32163  *                                                id(self))
32164  *
32165  */
32166   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
32167   __Pyx_GOTREF(__pyx_t_3);
32168   __Pyx_GIVEREF(__pyx_t_1);
32169   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
32170   __Pyx_GIVEREF(__pyx_t_2);
32171   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
32172   __pyx_t_1 = 0;
32173   __pyx_t_2 = 0;
32174   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
32175   __Pyx_GOTREF(__pyx_t_2);
32176   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32177   __pyx_r = __pyx_t_2;
32178   __pyx_t_2 = 0;
32179   goto __pyx_L0;
32180 
32181   /* "View.MemoryView":607
32182  *         return 0
32183  *
32184  *     def __repr__(self):             # <<<<<<<<<<<<<<
32185  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
32186  *                                                id(self))
32187  */
32188 
32189   /* function exit code */
32190   __pyx_L1_error:;
32191   __Pyx_XDECREF(__pyx_t_1);
32192   __Pyx_XDECREF(__pyx_t_2);
32193   __Pyx_XDECREF(__pyx_t_3);
32194   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32195   __pyx_r = NULL;
32196   __pyx_L0:;
32197   __Pyx_XGIVEREF(__pyx_r);
32198   __Pyx_RefNannyFinishContext();
32199   return __pyx_r;
32200 }
32201 
32202 /* "View.MemoryView":611
32203  *                                                id(self))
32204  *
32205  *     def __str__(self):             # <<<<<<<<<<<<<<
32206  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
32207  *
32208  */
32209 
32210 /* Python wrapper */
32211 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)32212 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
32213   PyObject *__pyx_r = 0;
32214   __Pyx_RefNannyDeclarations
32215   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
32216   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
32217 
32218   /* function exit code */
32219   __Pyx_RefNannyFinishContext();
32220   return __pyx_r;
32221 }
32222 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)32223 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
32224   PyObject *__pyx_r = NULL;
32225   __Pyx_RefNannyDeclarations
32226   PyObject *__pyx_t_1 = NULL;
32227   PyObject *__pyx_t_2 = NULL;
32228   __Pyx_RefNannySetupContext("__str__", 0);
32229 
32230   /* "View.MemoryView":612
32231  *
32232  *     def __str__(self):
32233  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
32234  *
32235  *
32236  */
32237   __Pyx_XDECREF(__pyx_r);
32238   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
32239   __Pyx_GOTREF(__pyx_t_1);
32240   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
32241   __Pyx_GOTREF(__pyx_t_2);
32242   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32243   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
32244   __Pyx_GOTREF(__pyx_t_1);
32245   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32246   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
32247   __Pyx_GOTREF(__pyx_t_2);
32248   __Pyx_GIVEREF(__pyx_t_1);
32249   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
32250   __pyx_t_1 = 0;
32251   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
32252   __Pyx_GOTREF(__pyx_t_1);
32253   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32254   __pyx_r = __pyx_t_1;
32255   __pyx_t_1 = 0;
32256   goto __pyx_L0;
32257 
32258   /* "View.MemoryView":611
32259  *                                                id(self))
32260  *
32261  *     def __str__(self):             # <<<<<<<<<<<<<<
32262  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
32263  *
32264  */
32265 
32266   /* function exit code */
32267   __pyx_L1_error:;
32268   __Pyx_XDECREF(__pyx_t_1);
32269   __Pyx_XDECREF(__pyx_t_2);
32270   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32271   __pyx_r = NULL;
32272   __pyx_L0:;
32273   __Pyx_XGIVEREF(__pyx_r);
32274   __Pyx_RefNannyFinishContext();
32275   return __pyx_r;
32276 }
32277 
32278 /* "View.MemoryView":615
32279  *
32280  *
32281  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
32282  *         cdef __Pyx_memviewslice *mslice
32283  *         cdef __Pyx_memviewslice tmp
32284  */
32285 
32286 /* Python wrapper */
32287 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_c_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)32288 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
32289   PyObject *__pyx_r = 0;
32290   __Pyx_RefNannyDeclarations
32291   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
32292   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
32293 
32294   /* function exit code */
32295   __Pyx_RefNannyFinishContext();
32296   return __pyx_r;
32297 }
32298 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)32299 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
32300   __Pyx_memviewslice *__pyx_v_mslice;
32301   __Pyx_memviewslice __pyx_v_tmp;
32302   PyObject *__pyx_r = NULL;
32303   __Pyx_RefNannyDeclarations
32304   PyObject *__pyx_t_1 = NULL;
32305   __Pyx_RefNannySetupContext("is_c_contig", 0);
32306 
32307   /* "View.MemoryView":618
32308  *         cdef __Pyx_memviewslice *mslice
32309  *         cdef __Pyx_memviewslice tmp
32310  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
32311  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
32312  *
32313  */
32314   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
32315 
32316   /* "View.MemoryView":619
32317  *         cdef __Pyx_memviewslice tmp
32318  *         mslice = get_slice_from_memview(self, &tmp)
32319  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
32320  *
32321  *     def is_f_contig(self):
32322  */
32323   __Pyx_XDECREF(__pyx_r);
32324   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
32325   __Pyx_GOTREF(__pyx_t_1);
32326   __pyx_r = __pyx_t_1;
32327   __pyx_t_1 = 0;
32328   goto __pyx_L0;
32329 
32330   /* "View.MemoryView":615
32331  *
32332  *
32333  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
32334  *         cdef __Pyx_memviewslice *mslice
32335  *         cdef __Pyx_memviewslice tmp
32336  */
32337 
32338   /* function exit code */
32339   __pyx_L1_error:;
32340   __Pyx_XDECREF(__pyx_t_1);
32341   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
32342   __pyx_r = NULL;
32343   __pyx_L0:;
32344   __Pyx_XGIVEREF(__pyx_r);
32345   __Pyx_RefNannyFinishContext();
32346   return __pyx_r;
32347 }
32348 
32349 /* "View.MemoryView":621
32350  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
32351  *
32352  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
32353  *         cdef __Pyx_memviewslice *mslice
32354  *         cdef __Pyx_memviewslice tmp
32355  */
32356 
32357 /* Python wrapper */
32358 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_is_f_contig(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)32359 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
32360   PyObject *__pyx_r = 0;
32361   __Pyx_RefNannyDeclarations
32362   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
32363   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
32364 
32365   /* function exit code */
32366   __Pyx_RefNannyFinishContext();
32367   return __pyx_r;
32368 }
32369 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)32370 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
32371   __Pyx_memviewslice *__pyx_v_mslice;
32372   __Pyx_memviewslice __pyx_v_tmp;
32373   PyObject *__pyx_r = NULL;
32374   __Pyx_RefNannyDeclarations
32375   PyObject *__pyx_t_1 = NULL;
32376   __Pyx_RefNannySetupContext("is_f_contig", 0);
32377 
32378   /* "View.MemoryView":624
32379  *         cdef __Pyx_memviewslice *mslice
32380  *         cdef __Pyx_memviewslice tmp
32381  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
32382  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
32383  *
32384  */
32385   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
32386 
32387   /* "View.MemoryView":625
32388  *         cdef __Pyx_memviewslice tmp
32389  *         mslice = get_slice_from_memview(self, &tmp)
32390  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
32391  *
32392  *     def copy(self):
32393  */
32394   __Pyx_XDECREF(__pyx_r);
32395   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
32396   __Pyx_GOTREF(__pyx_t_1);
32397   __pyx_r = __pyx_t_1;
32398   __pyx_t_1 = 0;
32399   goto __pyx_L0;
32400 
32401   /* "View.MemoryView":621
32402  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
32403  *
32404  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
32405  *         cdef __Pyx_memviewslice *mslice
32406  *         cdef __Pyx_memviewslice tmp
32407  */
32408 
32409   /* function exit code */
32410   __pyx_L1_error:;
32411   __Pyx_XDECREF(__pyx_t_1);
32412   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
32413   __pyx_r = NULL;
32414   __pyx_L0:;
32415   __Pyx_XGIVEREF(__pyx_r);
32416   __Pyx_RefNannyFinishContext();
32417   return __pyx_r;
32418 }
32419 
32420 /* "View.MemoryView":627
32421  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
32422  *
32423  *     def copy(self):             # <<<<<<<<<<<<<<
32424  *         cdef __Pyx_memviewslice mslice
32425  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
32426  */
32427 
32428 /* Python wrapper */
32429 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)32430 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
32431   PyObject *__pyx_r = 0;
32432   __Pyx_RefNannyDeclarations
32433   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
32434   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
32435 
32436   /* function exit code */
32437   __Pyx_RefNannyFinishContext();
32438   return __pyx_r;
32439 }
32440 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)32441 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
32442   __Pyx_memviewslice __pyx_v_mslice;
32443   int __pyx_v_flags;
32444   PyObject *__pyx_r = NULL;
32445   __Pyx_RefNannyDeclarations
32446   __Pyx_memviewslice __pyx_t_1;
32447   PyObject *__pyx_t_2 = NULL;
32448   __Pyx_RefNannySetupContext("copy", 0);
32449 
32450   /* "View.MemoryView":629
32451  *     def copy(self):
32452  *         cdef __Pyx_memviewslice mslice
32453  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
32454  *
32455  *         slice_copy(self, &mslice)
32456  */
32457   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
32458 
32459   /* "View.MemoryView":631
32460  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
32461  *
32462  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
32463  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
32464  *                                    self.view.itemsize,
32465  */
32466   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
32467 
32468   /* "View.MemoryView":632
32469  *
32470  *         slice_copy(self, &mslice)
32471  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
32472  *                                    self.view.itemsize,
32473  *                                    flags|PyBUF_C_CONTIGUOUS,
32474  */
32475   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 632, __pyx_L1_error)
32476   __pyx_v_mslice = __pyx_t_1;
32477 
32478   /* "View.MemoryView":637
32479  *                                    self.dtype_is_object)
32480  *
32481  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
32482  *
32483  *     def copy_fortran(self):
32484  */
32485   __Pyx_XDECREF(__pyx_r);
32486   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
32487   __Pyx_GOTREF(__pyx_t_2);
32488   __pyx_r = __pyx_t_2;
32489   __pyx_t_2 = 0;
32490   goto __pyx_L0;
32491 
32492   /* "View.MemoryView":627
32493  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
32494  *
32495  *     def copy(self):             # <<<<<<<<<<<<<<
32496  *         cdef __Pyx_memviewslice mslice
32497  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
32498  */
32499 
32500   /* function exit code */
32501   __pyx_L1_error:;
32502   __Pyx_XDECREF(__pyx_t_2);
32503   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
32504   __pyx_r = NULL;
32505   __pyx_L0:;
32506   __Pyx_XGIVEREF(__pyx_r);
32507   __Pyx_RefNannyFinishContext();
32508   return __pyx_r;
32509 }
32510 
32511 /* "View.MemoryView":639
32512  *         return memoryview_copy_from_slice(self, &mslice)
32513  *
32514  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
32515  *         cdef __Pyx_memviewslice src, dst
32516  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
32517  */
32518 
32519 /* Python wrapper */
32520 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_memoryview_copy_fortran(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)32521 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
32522   PyObject *__pyx_r = 0;
32523   __Pyx_RefNannyDeclarations
32524   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
32525   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
32526 
32527   /* function exit code */
32528   __Pyx_RefNannyFinishContext();
32529   return __pyx_r;
32530 }
32531 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)32532 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
32533   __Pyx_memviewslice __pyx_v_src;
32534   __Pyx_memviewslice __pyx_v_dst;
32535   int __pyx_v_flags;
32536   PyObject *__pyx_r = NULL;
32537   __Pyx_RefNannyDeclarations
32538   __Pyx_memviewslice __pyx_t_1;
32539   PyObject *__pyx_t_2 = NULL;
32540   __Pyx_RefNannySetupContext("copy_fortran", 0);
32541 
32542   /* "View.MemoryView":641
32543  *     def copy_fortran(self):
32544  *         cdef __Pyx_memviewslice src, dst
32545  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
32546  *
32547  *         slice_copy(self, &src)
32548  */
32549   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
32550 
32551   /* "View.MemoryView":643
32552  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
32553  *
32554  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
32555  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
32556  *                                 self.view.itemsize,
32557  */
32558   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
32559 
32560   /* "View.MemoryView":644
32561  *
32562  *         slice_copy(self, &src)
32563  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
32564  *                                 self.view.itemsize,
32565  *                                 flags|PyBUF_F_CONTIGUOUS,
32566  */
32567   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 644, __pyx_L1_error)
32568   __pyx_v_dst = __pyx_t_1;
32569 
32570   /* "View.MemoryView":649
32571  *                                 self.dtype_is_object)
32572  *
32573  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
32574  *
32575  *
32576  */
32577   __Pyx_XDECREF(__pyx_r);
32578   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
32579   __Pyx_GOTREF(__pyx_t_2);
32580   __pyx_r = __pyx_t_2;
32581   __pyx_t_2 = 0;
32582   goto __pyx_L0;
32583 
32584   /* "View.MemoryView":639
32585  *         return memoryview_copy_from_slice(self, &mslice)
32586  *
32587  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
32588  *         cdef __Pyx_memviewslice src, dst
32589  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
32590  */
32591 
32592   /* function exit code */
32593   __pyx_L1_error:;
32594   __Pyx_XDECREF(__pyx_t_2);
32595   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
32596   __pyx_r = NULL;
32597   __pyx_L0:;
32598   __Pyx_XGIVEREF(__pyx_r);
32599   __Pyx_RefNannyFinishContext();
32600   return __pyx_r;
32601 }
32602 
32603 /* "(tree fragment)":1
32604  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
32605  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32606  * def __setstate_cython__(self, __pyx_state):
32607  */
32608 
32609 /* Python wrapper */
32610 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)32611 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
32612   PyObject *__pyx_r = 0;
32613   __Pyx_RefNannyDeclarations
32614   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
32615   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
32616 
32617   /* function exit code */
32618   __Pyx_RefNannyFinishContext();
32619   return __pyx_r;
32620 }
32621 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)32622 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
32623   PyObject *__pyx_r = NULL;
32624   __Pyx_RefNannyDeclarations
32625   PyObject *__pyx_t_1 = NULL;
32626   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
32627 
32628   /* "(tree fragment)":2
32629  * def __reduce_cython__(self):
32630  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32631  * def __setstate_cython__(self, __pyx_state):
32632  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32633  */
32634   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
32635   __Pyx_GOTREF(__pyx_t_1);
32636   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
32637   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32638   __PYX_ERR(1, 2, __pyx_L1_error)
32639 
32640   /* "(tree fragment)":1
32641  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
32642  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32643  * def __setstate_cython__(self, __pyx_state):
32644  */
32645 
32646   /* function exit code */
32647   __pyx_L1_error:;
32648   __Pyx_XDECREF(__pyx_t_1);
32649   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32650   __pyx_r = NULL;
32651   __Pyx_XGIVEREF(__pyx_r);
32652   __Pyx_RefNannyFinishContext();
32653   return __pyx_r;
32654 }
32655 
32656 /* "(tree fragment)":3
32657  * def __reduce_cython__(self):
32658  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32659  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
32660  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32661  */
32662 
32663 /* Python wrapper */
32664 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)32665 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
32666   PyObject *__pyx_r = 0;
32667   __Pyx_RefNannyDeclarations
32668   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
32669   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
32670 
32671   /* function exit code */
32672   __Pyx_RefNannyFinishContext();
32673   return __pyx_r;
32674 }
32675 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)32676 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
32677   PyObject *__pyx_r = NULL;
32678   __Pyx_RefNannyDeclarations
32679   PyObject *__pyx_t_1 = NULL;
32680   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
32681 
32682   /* "(tree fragment)":4
32683  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32684  * def __setstate_cython__(self, __pyx_state):
32685  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
32686  */
32687   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
32688   __Pyx_GOTREF(__pyx_t_1);
32689   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
32690   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32691   __PYX_ERR(1, 4, __pyx_L1_error)
32692 
32693   /* "(tree fragment)":3
32694  * def __reduce_cython__(self):
32695  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32696  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
32697  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
32698  */
32699 
32700   /* function exit code */
32701   __pyx_L1_error:;
32702   __Pyx_XDECREF(__pyx_t_1);
32703   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32704   __pyx_r = NULL;
32705   __Pyx_XGIVEREF(__pyx_r);
32706   __Pyx_RefNannyFinishContext();
32707   return __pyx_r;
32708 }
32709 
32710 /* "View.MemoryView":653
32711  *
32712  * @cname('__pyx_memoryview_new')
32713  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
32714  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
32715  *     result.typeinfo = typeinfo
32716  */
32717 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)32718 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
32719   struct __pyx_memoryview_obj *__pyx_v_result = 0;
32720   PyObject *__pyx_r = NULL;
32721   __Pyx_RefNannyDeclarations
32722   PyObject *__pyx_t_1 = NULL;
32723   PyObject *__pyx_t_2 = NULL;
32724   PyObject *__pyx_t_3 = NULL;
32725   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
32726 
32727   /* "View.MemoryView":654
32728  * @cname('__pyx_memoryview_new')
32729  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
32730  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
32731  *     result.typeinfo = typeinfo
32732  *     return result
32733  */
32734   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
32735   __Pyx_GOTREF(__pyx_t_1);
32736   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
32737   __Pyx_GOTREF(__pyx_t_2);
32738   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
32739   __Pyx_GOTREF(__pyx_t_3);
32740   __Pyx_INCREF(__pyx_v_o);
32741   __Pyx_GIVEREF(__pyx_v_o);
32742   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
32743   __Pyx_GIVEREF(__pyx_t_1);
32744   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
32745   __Pyx_GIVEREF(__pyx_t_2);
32746   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
32747   __pyx_t_1 = 0;
32748   __pyx_t_2 = 0;
32749   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
32750   __Pyx_GOTREF(__pyx_t_2);
32751   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32752   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
32753   __pyx_t_2 = 0;
32754 
32755   /* "View.MemoryView":655
32756  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
32757  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
32758  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
32759  *     return result
32760  *
32761  */
32762   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
32763 
32764   /* "View.MemoryView":656
32765  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
32766  *     result.typeinfo = typeinfo
32767  *     return result             # <<<<<<<<<<<<<<
32768  *
32769  * @cname('__pyx_memoryview_check')
32770  */
32771   __Pyx_XDECREF(__pyx_r);
32772   __Pyx_INCREF(((PyObject *)__pyx_v_result));
32773   __pyx_r = ((PyObject *)__pyx_v_result);
32774   goto __pyx_L0;
32775 
32776   /* "View.MemoryView":653
32777  *
32778  * @cname('__pyx_memoryview_new')
32779  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
32780  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
32781  *     result.typeinfo = typeinfo
32782  */
32783 
32784   /* function exit code */
32785   __pyx_L1_error:;
32786   __Pyx_XDECREF(__pyx_t_1);
32787   __Pyx_XDECREF(__pyx_t_2);
32788   __Pyx_XDECREF(__pyx_t_3);
32789   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
32790   __pyx_r = 0;
32791   __pyx_L0:;
32792   __Pyx_XDECREF((PyObject *)__pyx_v_result);
32793   __Pyx_XGIVEREF(__pyx_r);
32794   __Pyx_RefNannyFinishContext();
32795   return __pyx_r;
32796 }
32797 
32798 /* "View.MemoryView":659
32799  *
32800  * @cname('__pyx_memoryview_check')
32801  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
32802  *     return isinstance(o, memoryview)
32803  *
32804  */
32805 
__pyx_memoryview_check(PyObject * __pyx_v_o)32806 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
32807   int __pyx_r;
32808   __Pyx_RefNannyDeclarations
32809   int __pyx_t_1;
32810   __Pyx_RefNannySetupContext("memoryview_check", 0);
32811 
32812   /* "View.MemoryView":660
32813  * @cname('__pyx_memoryview_check')
32814  * cdef inline bint memoryview_check(object o):
32815  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
32816  *
32817  * cdef tuple _unellipsify(object index, int ndim):
32818  */
32819   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
32820   __pyx_r = __pyx_t_1;
32821   goto __pyx_L0;
32822 
32823   /* "View.MemoryView":659
32824  *
32825  * @cname('__pyx_memoryview_check')
32826  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
32827  *     return isinstance(o, memoryview)
32828  *
32829  */
32830 
32831   /* function exit code */
32832   __pyx_L0:;
32833   __Pyx_RefNannyFinishContext();
32834   return __pyx_r;
32835 }
32836 
32837 /* "View.MemoryView":662
32838  *     return isinstance(o, memoryview)
32839  *
32840  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
32841  *     """
32842  *     Replace all ellipses with full slices and fill incomplete indices with
32843  */
32844 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)32845 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
32846   PyObject *__pyx_v_tup = NULL;
32847   PyObject *__pyx_v_result = NULL;
32848   int __pyx_v_have_slices;
32849   int __pyx_v_seen_ellipsis;
32850   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
32851   PyObject *__pyx_v_item = NULL;
32852   Py_ssize_t __pyx_v_nslices;
32853   PyObject *__pyx_r = NULL;
32854   __Pyx_RefNannyDeclarations
32855   int __pyx_t_1;
32856   int __pyx_t_2;
32857   PyObject *__pyx_t_3 = NULL;
32858   PyObject *__pyx_t_4 = NULL;
32859   Py_ssize_t __pyx_t_5;
32860   PyObject *(*__pyx_t_6)(PyObject *);
32861   PyObject *__pyx_t_7 = NULL;
32862   Py_ssize_t __pyx_t_8;
32863   int __pyx_t_9;
32864   int __pyx_t_10;
32865   PyObject *__pyx_t_11 = NULL;
32866   __Pyx_RefNannySetupContext("_unellipsify", 0);
32867 
32868   /* "View.MemoryView":667
32869  *     full slices.
32870  *     """
32871  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
32872  *         tup = (index,)
32873  *     else:
32874  */
32875   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
32876   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
32877   if (__pyx_t_2) {
32878 
32879     /* "View.MemoryView":668
32880  *     """
32881  *     if not isinstance(index, tuple):
32882  *         tup = (index,)             # <<<<<<<<<<<<<<
32883  *     else:
32884  *         tup = index
32885  */
32886     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
32887     __Pyx_GOTREF(__pyx_t_3);
32888     __Pyx_INCREF(__pyx_v_index);
32889     __Pyx_GIVEREF(__pyx_v_index);
32890     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
32891     __pyx_v_tup = __pyx_t_3;
32892     __pyx_t_3 = 0;
32893 
32894     /* "View.MemoryView":667
32895  *     full slices.
32896  *     """
32897  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
32898  *         tup = (index,)
32899  *     else:
32900  */
32901     goto __pyx_L3;
32902   }
32903 
32904   /* "View.MemoryView":670
32905  *         tup = (index,)
32906  *     else:
32907  *         tup = index             # <<<<<<<<<<<<<<
32908  *
32909  *     result = []
32910  */
32911   /*else*/ {
32912     __Pyx_INCREF(__pyx_v_index);
32913     __pyx_v_tup = __pyx_v_index;
32914   }
32915   __pyx_L3:;
32916 
32917   /* "View.MemoryView":672
32918  *         tup = index
32919  *
32920  *     result = []             # <<<<<<<<<<<<<<
32921  *     have_slices = False
32922  *     seen_ellipsis = False
32923  */
32924   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
32925   __Pyx_GOTREF(__pyx_t_3);
32926   __pyx_v_result = ((PyObject*)__pyx_t_3);
32927   __pyx_t_3 = 0;
32928 
32929   /* "View.MemoryView":673
32930  *
32931  *     result = []
32932  *     have_slices = False             # <<<<<<<<<<<<<<
32933  *     seen_ellipsis = False
32934  *     for idx, item in enumerate(tup):
32935  */
32936   __pyx_v_have_slices = 0;
32937 
32938   /* "View.MemoryView":674
32939  *     result = []
32940  *     have_slices = False
32941  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
32942  *     for idx, item in enumerate(tup):
32943  *         if item is Ellipsis:
32944  */
32945   __pyx_v_seen_ellipsis = 0;
32946 
32947   /* "View.MemoryView":675
32948  *     have_slices = False
32949  *     seen_ellipsis = False
32950  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
32951  *         if item is Ellipsis:
32952  *             if not seen_ellipsis:
32953  */
32954   __Pyx_INCREF(__pyx_int_0);
32955   __pyx_t_3 = __pyx_int_0;
32956   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
32957     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
32958     __pyx_t_6 = NULL;
32959   } else {
32960     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
32961     __Pyx_GOTREF(__pyx_t_4);
32962     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
32963   }
32964   for (;;) {
32965     if (likely(!__pyx_t_6)) {
32966       if (likely(PyList_CheckExact(__pyx_t_4))) {
32967         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
32968         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32969         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
32970         #else
32971         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
32972         __Pyx_GOTREF(__pyx_t_7);
32973         #endif
32974       } else {
32975         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
32976         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32977         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
32978         #else
32979         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
32980         __Pyx_GOTREF(__pyx_t_7);
32981         #endif
32982       }
32983     } else {
32984       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
32985       if (unlikely(!__pyx_t_7)) {
32986         PyObject* exc_type = PyErr_Occurred();
32987         if (exc_type) {
32988           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
32989           else __PYX_ERR(1, 675, __pyx_L1_error)
32990         }
32991         break;
32992       }
32993       __Pyx_GOTREF(__pyx_t_7);
32994     }
32995     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
32996     __pyx_t_7 = 0;
32997     __Pyx_INCREF(__pyx_t_3);
32998     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
32999     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
33000     __Pyx_GOTREF(__pyx_t_7);
33001     __Pyx_DECREF(__pyx_t_3);
33002     __pyx_t_3 = __pyx_t_7;
33003     __pyx_t_7 = 0;
33004 
33005     /* "View.MemoryView":676
33006  *     seen_ellipsis = False
33007  *     for idx, item in enumerate(tup):
33008  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
33009  *             if not seen_ellipsis:
33010  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
33011  */
33012     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
33013     __pyx_t_1 = (__pyx_t_2 != 0);
33014     if (__pyx_t_1) {
33015 
33016       /* "View.MemoryView":677
33017  *     for idx, item in enumerate(tup):
33018  *         if item is Ellipsis:
33019  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
33020  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
33021  *                 seen_ellipsis = True
33022  */
33023       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
33024       if (__pyx_t_1) {
33025 
33026         /* "View.MemoryView":678
33027  *         if item is Ellipsis:
33028  *             if not seen_ellipsis:
33029  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
33030  *                 seen_ellipsis = True
33031  *             else:
33032  */
33033         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
33034         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 678, __pyx_L1_error)
33035         __Pyx_GOTREF(__pyx_t_7);
33036         { Py_ssize_t __pyx_temp;
33037           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
33038             __Pyx_INCREF(__pyx_slice__2);
33039             __Pyx_GIVEREF(__pyx_slice__2);
33040             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__2);
33041           }
33042         }
33043         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
33044         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33045 
33046         /* "View.MemoryView":679
33047  *             if not seen_ellipsis:
33048  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
33049  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
33050  *             else:
33051  *                 result.append(slice(None))
33052  */
33053         __pyx_v_seen_ellipsis = 1;
33054 
33055         /* "View.MemoryView":677
33056  *     for idx, item in enumerate(tup):
33057  *         if item is Ellipsis:
33058  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
33059  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
33060  *                 seen_ellipsis = True
33061  */
33062         goto __pyx_L7;
33063       }
33064 
33065       /* "View.MemoryView":681
33066  *                 seen_ellipsis = True
33067  *             else:
33068  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
33069  *             have_slices = True
33070  *         else:
33071  */
33072       /*else*/ {
33073         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
33074       }
33075       __pyx_L7:;
33076 
33077       /* "View.MemoryView":682
33078  *             else:
33079  *                 result.append(slice(None))
33080  *             have_slices = True             # <<<<<<<<<<<<<<
33081  *         else:
33082  *             if not isinstance(item, slice) and not PyIndex_Check(item):
33083  */
33084       __pyx_v_have_slices = 1;
33085 
33086       /* "View.MemoryView":676
33087  *     seen_ellipsis = False
33088  *     for idx, item in enumerate(tup):
33089  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
33090  *             if not seen_ellipsis:
33091  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
33092  */
33093       goto __pyx_L6;
33094     }
33095 
33096     /* "View.MemoryView":684
33097  *             have_slices = True
33098  *         else:
33099  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
33100  *                 raise TypeError("Cannot index with type '%s'" % type(item))
33101  *
33102  */
33103     /*else*/ {
33104       __pyx_t_2 = PySlice_Check(__pyx_v_item);
33105       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
33106       if (__pyx_t_10) {
33107       } else {
33108         __pyx_t_1 = __pyx_t_10;
33109         goto __pyx_L9_bool_binop_done;
33110       }
33111       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
33112       __pyx_t_1 = __pyx_t_10;
33113       __pyx_L9_bool_binop_done:;
33114       if (unlikely(__pyx_t_1)) {
33115 
33116         /* "View.MemoryView":685
33117  *         else:
33118  *             if not isinstance(item, slice) and not PyIndex_Check(item):
33119  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
33120  *
33121  *             have_slices = have_slices or isinstance(item, slice)
33122  */
33123         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 685, __pyx_L1_error)
33124         __Pyx_GOTREF(__pyx_t_7);
33125         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
33126         __Pyx_GOTREF(__pyx_t_11);
33127         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33128         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
33129         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
33130         __PYX_ERR(1, 685, __pyx_L1_error)
33131 
33132         /* "View.MemoryView":684
33133  *             have_slices = True
33134  *         else:
33135  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
33136  *                 raise TypeError("Cannot index with type '%s'" % type(item))
33137  *
33138  */
33139       }
33140 
33141       /* "View.MemoryView":687
33142  *                 raise TypeError("Cannot index with type '%s'" % type(item))
33143  *
33144  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
33145  *             result.append(item)
33146  *
33147  */
33148       __pyx_t_10 = (__pyx_v_have_slices != 0);
33149       if (!__pyx_t_10) {
33150       } else {
33151         __pyx_t_1 = __pyx_t_10;
33152         goto __pyx_L11_bool_binop_done;
33153       }
33154       __pyx_t_10 = PySlice_Check(__pyx_v_item);
33155       __pyx_t_2 = (__pyx_t_10 != 0);
33156       __pyx_t_1 = __pyx_t_2;
33157       __pyx_L11_bool_binop_done:;
33158       __pyx_v_have_slices = __pyx_t_1;
33159 
33160       /* "View.MemoryView":688
33161  *
33162  *             have_slices = have_slices or isinstance(item, slice)
33163  *             result.append(item)             # <<<<<<<<<<<<<<
33164  *
33165  *     nslices = ndim - len(result)
33166  */
33167       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
33168     }
33169     __pyx_L6:;
33170 
33171     /* "View.MemoryView":675
33172  *     have_slices = False
33173  *     seen_ellipsis = False
33174  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
33175  *         if item is Ellipsis:
33176  *             if not seen_ellipsis:
33177  */
33178   }
33179   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33180   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33181 
33182   /* "View.MemoryView":690
33183  *             result.append(item)
33184  *
33185  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
33186  *     if nslices:
33187  *         result.extend([slice(None)] * nslices)
33188  */
33189   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
33190   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
33191 
33192   /* "View.MemoryView":691
33193  *
33194  *     nslices = ndim - len(result)
33195  *     if nslices:             # <<<<<<<<<<<<<<
33196  *         result.extend([slice(None)] * nslices)
33197  *
33198  */
33199   __pyx_t_1 = (__pyx_v_nslices != 0);
33200   if (__pyx_t_1) {
33201 
33202     /* "View.MemoryView":692
33203  *     nslices = ndim - len(result)
33204  *     if nslices:
33205  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
33206  *
33207  *     return have_slices or nslices, tuple(result)
33208  */
33209     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
33210     __Pyx_GOTREF(__pyx_t_3);
33211     { Py_ssize_t __pyx_temp;
33212       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
33213         __Pyx_INCREF(__pyx_slice__2);
33214         __Pyx_GIVEREF(__pyx_slice__2);
33215         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__2);
33216       }
33217     }
33218     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
33219     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33220 
33221     /* "View.MemoryView":691
33222  *
33223  *     nslices = ndim - len(result)
33224  *     if nslices:             # <<<<<<<<<<<<<<
33225  *         result.extend([slice(None)] * nslices)
33226  *
33227  */
33228   }
33229 
33230   /* "View.MemoryView":694
33231  *         result.extend([slice(None)] * nslices)
33232  *
33233  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
33234  *
33235  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
33236  */
33237   __Pyx_XDECREF(__pyx_r);
33238   if (!__pyx_v_have_slices) {
33239   } else {
33240     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
33241     __Pyx_GOTREF(__pyx_t_4);
33242     __pyx_t_3 = __pyx_t_4;
33243     __pyx_t_4 = 0;
33244     goto __pyx_L14_bool_binop_done;
33245   }
33246   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
33247   __Pyx_GOTREF(__pyx_t_4);
33248   __pyx_t_3 = __pyx_t_4;
33249   __pyx_t_4 = 0;
33250   __pyx_L14_bool_binop_done:;
33251   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
33252   __Pyx_GOTREF(__pyx_t_4);
33253   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
33254   __Pyx_GOTREF(__pyx_t_11);
33255   __Pyx_GIVEREF(__pyx_t_3);
33256   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
33257   __Pyx_GIVEREF(__pyx_t_4);
33258   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
33259   __pyx_t_3 = 0;
33260   __pyx_t_4 = 0;
33261   __pyx_r = ((PyObject*)__pyx_t_11);
33262   __pyx_t_11 = 0;
33263   goto __pyx_L0;
33264 
33265   /* "View.MemoryView":662
33266  *     return isinstance(o, memoryview)
33267  *
33268  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
33269  *     """
33270  *     Replace all ellipses with full slices and fill incomplete indices with
33271  */
33272 
33273   /* function exit code */
33274   __pyx_L1_error:;
33275   __Pyx_XDECREF(__pyx_t_3);
33276   __Pyx_XDECREF(__pyx_t_4);
33277   __Pyx_XDECREF(__pyx_t_7);
33278   __Pyx_XDECREF(__pyx_t_11);
33279   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
33280   __pyx_r = 0;
33281   __pyx_L0:;
33282   __Pyx_XDECREF(__pyx_v_tup);
33283   __Pyx_XDECREF(__pyx_v_result);
33284   __Pyx_XDECREF(__pyx_v_idx);
33285   __Pyx_XDECREF(__pyx_v_item);
33286   __Pyx_XGIVEREF(__pyx_r);
33287   __Pyx_RefNannyFinishContext();
33288   return __pyx_r;
33289 }
33290 
33291 /* "View.MemoryView":696
33292  *     return have_slices or nslices, tuple(result)
33293  *
33294  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
33295  *     for suboffset in suboffsets[:ndim]:
33296  *         if suboffset >= 0:
33297  */
33298 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)33299 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
33300   Py_ssize_t __pyx_v_suboffset;
33301   PyObject *__pyx_r = NULL;
33302   __Pyx_RefNannyDeclarations
33303   Py_ssize_t *__pyx_t_1;
33304   Py_ssize_t *__pyx_t_2;
33305   Py_ssize_t *__pyx_t_3;
33306   int __pyx_t_4;
33307   PyObject *__pyx_t_5 = NULL;
33308   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
33309 
33310   /* "View.MemoryView":697
33311  *
33312  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
33313  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
33314  *         if suboffset >= 0:
33315  *             raise ValueError("Indirect dimensions not supported")
33316  */
33317   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
33318   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
33319     __pyx_t_1 = __pyx_t_3;
33320     __pyx_v_suboffset = (__pyx_t_1[0]);
33321 
33322     /* "View.MemoryView":698
33323  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
33324  *     for suboffset in suboffsets[:ndim]:
33325  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
33326  *             raise ValueError("Indirect dimensions not supported")
33327  *
33328  */
33329     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
33330     if (unlikely(__pyx_t_4)) {
33331 
33332       /* "View.MemoryView":699
33333  *     for suboffset in suboffsets[:ndim]:
33334  *         if suboffset >= 0:
33335  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
33336  *
33337  *
33338  */
33339       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
33340       __Pyx_GOTREF(__pyx_t_5);
33341       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
33342       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33343       __PYX_ERR(1, 699, __pyx_L1_error)
33344 
33345       /* "View.MemoryView":698
33346  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
33347  *     for suboffset in suboffsets[:ndim]:
33348  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
33349  *             raise ValueError("Indirect dimensions not supported")
33350  *
33351  */
33352     }
33353   }
33354 
33355   /* "View.MemoryView":696
33356  *     return have_slices or nslices, tuple(result)
33357  *
33358  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
33359  *     for suboffset in suboffsets[:ndim]:
33360  *         if suboffset >= 0:
33361  */
33362 
33363   /* function exit code */
33364   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33365   goto __pyx_L0;
33366   __pyx_L1_error:;
33367   __Pyx_XDECREF(__pyx_t_5);
33368   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
33369   __pyx_r = 0;
33370   __pyx_L0:;
33371   __Pyx_XGIVEREF(__pyx_r);
33372   __Pyx_RefNannyFinishContext();
33373   return __pyx_r;
33374 }
33375 
33376 /* "View.MemoryView":706
33377  *
33378  * @cname('__pyx_memview_slice')
33379  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
33380  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
33381  *     cdef bint negative_step
33382  */
33383 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)33384 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
33385   int __pyx_v_new_ndim;
33386   int __pyx_v_suboffset_dim;
33387   int __pyx_v_dim;
33388   __Pyx_memviewslice __pyx_v_src;
33389   __Pyx_memviewslice __pyx_v_dst;
33390   __Pyx_memviewslice *__pyx_v_p_src;
33391   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
33392   __Pyx_memviewslice *__pyx_v_p_dst;
33393   int *__pyx_v_p_suboffset_dim;
33394   Py_ssize_t __pyx_v_start;
33395   Py_ssize_t __pyx_v_stop;
33396   Py_ssize_t __pyx_v_step;
33397   int __pyx_v_have_start;
33398   int __pyx_v_have_stop;
33399   int __pyx_v_have_step;
33400   PyObject *__pyx_v_index = NULL;
33401   struct __pyx_memoryview_obj *__pyx_r = NULL;
33402   __Pyx_RefNannyDeclarations
33403   int __pyx_t_1;
33404   int __pyx_t_2;
33405   PyObject *__pyx_t_3 = NULL;
33406   struct __pyx_memoryview_obj *__pyx_t_4;
33407   char *__pyx_t_5;
33408   int __pyx_t_6;
33409   Py_ssize_t __pyx_t_7;
33410   PyObject *(*__pyx_t_8)(PyObject *);
33411   PyObject *__pyx_t_9 = NULL;
33412   Py_ssize_t __pyx_t_10;
33413   int __pyx_t_11;
33414   Py_ssize_t __pyx_t_12;
33415   __Pyx_RefNannySetupContext("memview_slice", 0);
33416 
33417   /* "View.MemoryView":707
33418  * @cname('__pyx_memview_slice')
33419  * cdef memoryview memview_slice(memoryview memview, object indices):
33420  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
33421  *     cdef bint negative_step
33422  *     cdef __Pyx_memviewslice src, dst
33423  */
33424   __pyx_v_new_ndim = 0;
33425   __pyx_v_suboffset_dim = -1;
33426 
33427   /* "View.MemoryView":714
33428  *
33429  *
33430  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
33431  *
33432  *     cdef _memoryviewslice memviewsliceobj
33433  */
33434   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
33435 
33436   /* "View.MemoryView":718
33437  *     cdef _memoryviewslice memviewsliceobj
33438  *
33439  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
33440  *
33441  *     if isinstance(memview, _memoryviewslice):
33442  */
33443   #ifndef CYTHON_WITHOUT_ASSERTIONS
33444   if (unlikely(!Py_OptimizeFlag)) {
33445     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
33446       PyErr_SetNone(PyExc_AssertionError);
33447       __PYX_ERR(1, 718, __pyx_L1_error)
33448     }
33449   }
33450   #endif
33451 
33452   /* "View.MemoryView":720
33453  *     assert memview.view.ndim > 0
33454  *
33455  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
33456  *         memviewsliceobj = memview
33457  *         p_src = &memviewsliceobj.from_slice
33458  */
33459   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
33460   __pyx_t_2 = (__pyx_t_1 != 0);
33461   if (__pyx_t_2) {
33462 
33463     /* "View.MemoryView":721
33464  *
33465  *     if isinstance(memview, _memoryviewslice):
33466  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
33467  *         p_src = &memviewsliceobj.from_slice
33468  *     else:
33469  */
33470     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
33471     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
33472     __Pyx_INCREF(__pyx_t_3);
33473     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
33474     __pyx_t_3 = 0;
33475 
33476     /* "View.MemoryView":722
33477  *     if isinstance(memview, _memoryviewslice):
33478  *         memviewsliceobj = memview
33479  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
33480  *     else:
33481  *         slice_copy(memview, &src)
33482  */
33483     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
33484 
33485     /* "View.MemoryView":720
33486  *     assert memview.view.ndim > 0
33487  *
33488  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
33489  *         memviewsliceobj = memview
33490  *         p_src = &memviewsliceobj.from_slice
33491  */
33492     goto __pyx_L3;
33493   }
33494 
33495   /* "View.MemoryView":724
33496  *         p_src = &memviewsliceobj.from_slice
33497  *     else:
33498  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
33499  *         p_src = &src
33500  *
33501  */
33502   /*else*/ {
33503     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
33504 
33505     /* "View.MemoryView":725
33506  *     else:
33507  *         slice_copy(memview, &src)
33508  *         p_src = &src             # <<<<<<<<<<<<<<
33509  *
33510  *
33511  */
33512     __pyx_v_p_src = (&__pyx_v_src);
33513   }
33514   __pyx_L3:;
33515 
33516   /* "View.MemoryView":731
33517  *
33518  *
33519  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
33520  *     dst.data = p_src.data
33521  *
33522  */
33523   __pyx_t_4 = __pyx_v_p_src->memview;
33524   __pyx_v_dst.memview = __pyx_t_4;
33525 
33526   /* "View.MemoryView":732
33527  *
33528  *     dst.memview = p_src.memview
33529  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
33530  *
33531  *
33532  */
33533   __pyx_t_5 = __pyx_v_p_src->data;
33534   __pyx_v_dst.data = __pyx_t_5;
33535 
33536   /* "View.MemoryView":737
33537  *
33538  *
33539  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
33540  *     cdef int *p_suboffset_dim = &suboffset_dim
33541  *     cdef Py_ssize_t start, stop, step
33542  */
33543   __pyx_v_p_dst = (&__pyx_v_dst);
33544 
33545   /* "View.MemoryView":738
33546  *
33547  *     cdef __Pyx_memviewslice *p_dst = &dst
33548  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
33549  *     cdef Py_ssize_t start, stop, step
33550  *     cdef bint have_start, have_stop, have_step
33551  */
33552   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
33553 
33554   /* "View.MemoryView":742
33555  *     cdef bint have_start, have_stop, have_step
33556  *
33557  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
33558  *         if PyIndex_Check(index):
33559  *             slice_memviewslice(
33560  */
33561   __pyx_t_6 = 0;
33562   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
33563     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
33564     __pyx_t_8 = NULL;
33565   } else {
33566     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
33567     __Pyx_GOTREF(__pyx_t_3);
33568     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
33569   }
33570   for (;;) {
33571     if (likely(!__pyx_t_8)) {
33572       if (likely(PyList_CheckExact(__pyx_t_3))) {
33573         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
33574         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33575         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
33576         #else
33577         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
33578         __Pyx_GOTREF(__pyx_t_9);
33579         #endif
33580       } else {
33581         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
33582         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33583         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
33584         #else
33585         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
33586         __Pyx_GOTREF(__pyx_t_9);
33587         #endif
33588       }
33589     } else {
33590       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
33591       if (unlikely(!__pyx_t_9)) {
33592         PyObject* exc_type = PyErr_Occurred();
33593         if (exc_type) {
33594           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33595           else __PYX_ERR(1, 742, __pyx_L1_error)
33596         }
33597         break;
33598       }
33599       __Pyx_GOTREF(__pyx_t_9);
33600     }
33601     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
33602     __pyx_t_9 = 0;
33603     __pyx_v_dim = __pyx_t_6;
33604     __pyx_t_6 = (__pyx_t_6 + 1);
33605 
33606     /* "View.MemoryView":743
33607  *
33608  *     for dim, index in enumerate(indices):
33609  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
33610  *             slice_memviewslice(
33611  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
33612  */
33613     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
33614     if (__pyx_t_2) {
33615 
33616       /* "View.MemoryView":747
33617  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
33618  *                 dim, new_ndim, p_suboffset_dim,
33619  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
33620  *                 0, 0, 0, # have_{start,stop,step}
33621  *                 False)
33622  */
33623       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
33624 
33625       /* "View.MemoryView":744
33626  *     for dim, index in enumerate(indices):
33627  *         if PyIndex_Check(index):
33628  *             slice_memviewslice(             # <<<<<<<<<<<<<<
33629  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
33630  *                 dim, new_ndim, p_suboffset_dim,
33631  */
33632       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 744, __pyx_L1_error)
33633 
33634       /* "View.MemoryView":743
33635  *
33636  *     for dim, index in enumerate(indices):
33637  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
33638  *             slice_memviewslice(
33639  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
33640  */
33641       goto __pyx_L6;
33642     }
33643 
33644     /* "View.MemoryView":750
33645  *                 0, 0, 0, # have_{start,stop,step}
33646  *                 False)
33647  *         elif index is None:             # <<<<<<<<<<<<<<
33648  *             p_dst.shape[new_ndim] = 1
33649  *             p_dst.strides[new_ndim] = 0
33650  */
33651     __pyx_t_2 = (__pyx_v_index == Py_None);
33652     __pyx_t_1 = (__pyx_t_2 != 0);
33653     if (__pyx_t_1) {
33654 
33655       /* "View.MemoryView":751
33656  *                 False)
33657  *         elif index is None:
33658  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
33659  *             p_dst.strides[new_ndim] = 0
33660  *             p_dst.suboffsets[new_ndim] = -1
33661  */
33662       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
33663 
33664       /* "View.MemoryView":752
33665  *         elif index is None:
33666  *             p_dst.shape[new_ndim] = 1
33667  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
33668  *             p_dst.suboffsets[new_ndim] = -1
33669  *             new_ndim += 1
33670  */
33671       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
33672 
33673       /* "View.MemoryView":753
33674  *             p_dst.shape[new_ndim] = 1
33675  *             p_dst.strides[new_ndim] = 0
33676  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
33677  *             new_ndim += 1
33678  *         else:
33679  */
33680       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
33681 
33682       /* "View.MemoryView":754
33683  *             p_dst.strides[new_ndim] = 0
33684  *             p_dst.suboffsets[new_ndim] = -1
33685  *             new_ndim += 1             # <<<<<<<<<<<<<<
33686  *         else:
33687  *             start = index.start or 0
33688  */
33689       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
33690 
33691       /* "View.MemoryView":750
33692  *                 0, 0, 0, # have_{start,stop,step}
33693  *                 False)
33694  *         elif index is None:             # <<<<<<<<<<<<<<
33695  *             p_dst.shape[new_ndim] = 1
33696  *             p_dst.strides[new_ndim] = 0
33697  */
33698       goto __pyx_L6;
33699     }
33700 
33701     /* "View.MemoryView":756
33702  *             new_ndim += 1
33703  *         else:
33704  *             start = index.start or 0             # <<<<<<<<<<<<<<
33705  *             stop = index.stop or 0
33706  *             step = index.step or 0
33707  */
33708     /*else*/ {
33709       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
33710       __Pyx_GOTREF(__pyx_t_9);
33711       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
33712       if (!__pyx_t_1) {
33713         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33714       } else {
33715         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
33716         __pyx_t_10 = __pyx_t_12;
33717         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33718         goto __pyx_L7_bool_binop_done;
33719       }
33720       __pyx_t_10 = 0;
33721       __pyx_L7_bool_binop_done:;
33722       __pyx_v_start = __pyx_t_10;
33723 
33724       /* "View.MemoryView":757
33725  *         else:
33726  *             start = index.start or 0
33727  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
33728  *             step = index.step or 0
33729  *
33730  */
33731       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
33732       __Pyx_GOTREF(__pyx_t_9);
33733       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
33734       if (!__pyx_t_1) {
33735         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33736       } else {
33737         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
33738         __pyx_t_10 = __pyx_t_12;
33739         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33740         goto __pyx_L9_bool_binop_done;
33741       }
33742       __pyx_t_10 = 0;
33743       __pyx_L9_bool_binop_done:;
33744       __pyx_v_stop = __pyx_t_10;
33745 
33746       /* "View.MemoryView":758
33747  *             start = index.start or 0
33748  *             stop = index.stop or 0
33749  *             step = index.step or 0             # <<<<<<<<<<<<<<
33750  *
33751  *             have_start = index.start is not None
33752  */
33753       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
33754       __Pyx_GOTREF(__pyx_t_9);
33755       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
33756       if (!__pyx_t_1) {
33757         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33758       } else {
33759         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
33760         __pyx_t_10 = __pyx_t_12;
33761         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33762         goto __pyx_L11_bool_binop_done;
33763       }
33764       __pyx_t_10 = 0;
33765       __pyx_L11_bool_binop_done:;
33766       __pyx_v_step = __pyx_t_10;
33767 
33768       /* "View.MemoryView":760
33769  *             step = index.step or 0
33770  *
33771  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
33772  *             have_stop = index.stop is not None
33773  *             have_step = index.step is not None
33774  */
33775       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
33776       __Pyx_GOTREF(__pyx_t_9);
33777       __pyx_t_1 = (__pyx_t_9 != Py_None);
33778       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33779       __pyx_v_have_start = __pyx_t_1;
33780 
33781       /* "View.MemoryView":761
33782  *
33783  *             have_start = index.start is not None
33784  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
33785  *             have_step = index.step is not None
33786  *
33787  */
33788       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
33789       __Pyx_GOTREF(__pyx_t_9);
33790       __pyx_t_1 = (__pyx_t_9 != Py_None);
33791       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33792       __pyx_v_have_stop = __pyx_t_1;
33793 
33794       /* "View.MemoryView":762
33795  *             have_start = index.start is not None
33796  *             have_stop = index.stop is not None
33797  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
33798  *
33799  *             slice_memviewslice(
33800  */
33801       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
33802       __Pyx_GOTREF(__pyx_t_9);
33803       __pyx_t_1 = (__pyx_t_9 != Py_None);
33804       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
33805       __pyx_v_have_step = __pyx_t_1;
33806 
33807       /* "View.MemoryView":764
33808  *             have_step = index.step is not None
33809  *
33810  *             slice_memviewslice(             # <<<<<<<<<<<<<<
33811  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
33812  *                 dim, new_ndim, p_suboffset_dim,
33813  */
33814       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 764, __pyx_L1_error)
33815 
33816       /* "View.MemoryView":770
33817  *                 have_start, have_stop, have_step,
33818  *                 True)
33819  *             new_ndim += 1             # <<<<<<<<<<<<<<
33820  *
33821  *     if isinstance(memview, _memoryviewslice):
33822  */
33823       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
33824     }
33825     __pyx_L6:;
33826 
33827     /* "View.MemoryView":742
33828  *     cdef bint have_start, have_stop, have_step
33829  *
33830  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
33831  *         if PyIndex_Check(index):
33832  *             slice_memviewslice(
33833  */
33834   }
33835   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33836 
33837   /* "View.MemoryView":772
33838  *             new_ndim += 1
33839  *
33840  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
33841  *         return memoryview_fromslice(dst, new_ndim,
33842  *                                     memviewsliceobj.to_object_func,
33843  */
33844   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
33845   __pyx_t_2 = (__pyx_t_1 != 0);
33846   if (__pyx_t_2) {
33847 
33848     /* "View.MemoryView":773
33849  *
33850  *     if isinstance(memview, _memoryviewslice):
33851  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
33852  *                                     memviewsliceobj.to_object_func,
33853  *                                     memviewsliceobj.to_dtype_func,
33854  */
33855     __Pyx_XDECREF(((PyObject *)__pyx_r));
33856 
33857     /* "View.MemoryView":774
33858  *     if isinstance(memview, _memoryviewslice):
33859  *         return memoryview_fromslice(dst, new_ndim,
33860  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
33861  *                                     memviewsliceobj.to_dtype_func,
33862  *                                     memview.dtype_is_object)
33863  */
33864     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
33865 
33866     /* "View.MemoryView":775
33867  *         return memoryview_fromslice(dst, new_ndim,
33868  *                                     memviewsliceobj.to_object_func,
33869  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
33870  *                                     memview.dtype_is_object)
33871  *     else:
33872  */
33873     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
33874 
33875     /* "View.MemoryView":773
33876  *
33877  *     if isinstance(memview, _memoryviewslice):
33878  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
33879  *                                     memviewsliceobj.to_object_func,
33880  *                                     memviewsliceobj.to_dtype_func,
33881  */
33882     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
33883     __Pyx_GOTREF(__pyx_t_3);
33884     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
33885     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
33886     __pyx_t_3 = 0;
33887     goto __pyx_L0;
33888 
33889     /* "View.MemoryView":772
33890  *             new_ndim += 1
33891  *
33892  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
33893  *         return memoryview_fromslice(dst, new_ndim,
33894  *                                     memviewsliceobj.to_object_func,
33895  */
33896   }
33897 
33898   /* "View.MemoryView":778
33899  *                                     memview.dtype_is_object)
33900  *     else:
33901  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
33902  *                                     memview.dtype_is_object)
33903  *
33904  */
33905   /*else*/ {
33906     __Pyx_XDECREF(((PyObject *)__pyx_r));
33907 
33908     /* "View.MemoryView":779
33909  *     else:
33910  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
33911  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
33912  *
33913  *
33914  */
33915     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
33916     __Pyx_GOTREF(__pyx_t_3);
33917 
33918     /* "View.MemoryView":778
33919  *                                     memview.dtype_is_object)
33920  *     else:
33921  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
33922  *                                     memview.dtype_is_object)
33923  *
33924  */
33925     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
33926     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
33927     __pyx_t_3 = 0;
33928     goto __pyx_L0;
33929   }
33930 
33931   /* "View.MemoryView":706
33932  *
33933  * @cname('__pyx_memview_slice')
33934  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
33935  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
33936  *     cdef bint negative_step
33937  */
33938 
33939   /* function exit code */
33940   __pyx_L1_error:;
33941   __Pyx_XDECREF(__pyx_t_3);
33942   __Pyx_XDECREF(__pyx_t_9);
33943   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
33944   __pyx_r = 0;
33945   __pyx_L0:;
33946   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
33947   __Pyx_XDECREF(__pyx_v_index);
33948   __Pyx_XGIVEREF((PyObject *)__pyx_r);
33949   __Pyx_RefNannyFinishContext();
33950   return __pyx_r;
33951 }
33952 
33953 /* "View.MemoryView":803
33954  *
33955  * @cname('__pyx_memoryview_slice_memviewslice')
33956  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
33957  *         __Pyx_memviewslice *dst,
33958  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
33959  */
33960 
__pyx_memoryview_slice_memviewslice(__Pyx_memviewslice * __pyx_v_dst,Py_ssize_t __pyx_v_shape,Py_ssize_t __pyx_v_stride,Py_ssize_t __pyx_v_suboffset,int __pyx_v_dim,int __pyx_v_new_ndim,int * __pyx_v_suboffset_dim,Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop,Py_ssize_t __pyx_v_step,int __pyx_v_have_start,int __pyx_v_have_stop,int __pyx_v_have_step,int __pyx_v_is_slice)33961 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
33962   Py_ssize_t __pyx_v_new_shape;
33963   int __pyx_v_negative_step;
33964   int __pyx_r;
33965   int __pyx_t_1;
33966   int __pyx_t_2;
33967   int __pyx_t_3;
33968 
33969   /* "View.MemoryView":823
33970  *     cdef bint negative_step
33971  *
33972  *     if not is_slice:             # <<<<<<<<<<<<<<
33973  *
33974  *         if start < 0:
33975  */
33976   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
33977   if (__pyx_t_1) {
33978 
33979     /* "View.MemoryView":825
33980  *     if not is_slice:
33981  *
33982  *         if start < 0:             # <<<<<<<<<<<<<<
33983  *             start += shape
33984  *         if not 0 <= start < shape:
33985  */
33986     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
33987     if (__pyx_t_1) {
33988 
33989       /* "View.MemoryView":826
33990  *
33991  *         if start < 0:
33992  *             start += shape             # <<<<<<<<<<<<<<
33993  *         if not 0 <= start < shape:
33994  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
33995  */
33996       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
33997 
33998       /* "View.MemoryView":825
33999  *     if not is_slice:
34000  *
34001  *         if start < 0:             # <<<<<<<<<<<<<<
34002  *             start += shape
34003  *         if not 0 <= start < shape:
34004  */
34005     }
34006 
34007     /* "View.MemoryView":827
34008  *         if start < 0:
34009  *             start += shape
34010  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
34011  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
34012  *     else:
34013  */
34014     __pyx_t_1 = (0 <= __pyx_v_start);
34015     if (__pyx_t_1) {
34016       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
34017     }
34018     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
34019     if (__pyx_t_2) {
34020 
34021       /* "View.MemoryView":828
34022  *             start += shape
34023  *         if not 0 <= start < shape:
34024  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
34025  *     else:
34026  *
34027  */
34028       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 828, __pyx_L1_error)
34029 
34030       /* "View.MemoryView":827
34031  *         if start < 0:
34032  *             start += shape
34033  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
34034  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
34035  *     else:
34036  */
34037     }
34038 
34039     /* "View.MemoryView":823
34040  *     cdef bint negative_step
34041  *
34042  *     if not is_slice:             # <<<<<<<<<<<<<<
34043  *
34044  *         if start < 0:
34045  */
34046     goto __pyx_L3;
34047   }
34048 
34049   /* "View.MemoryView":831
34050  *     else:
34051  *
34052  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
34053  *
34054  *         if have_step and step == 0:
34055  */
34056   /*else*/ {
34057     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
34058     if (__pyx_t_1) {
34059     } else {
34060       __pyx_t_2 = __pyx_t_1;
34061       goto __pyx_L6_bool_binop_done;
34062     }
34063     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
34064     __pyx_t_2 = __pyx_t_1;
34065     __pyx_L6_bool_binop_done:;
34066     __pyx_v_negative_step = __pyx_t_2;
34067 
34068     /* "View.MemoryView":833
34069  *         negative_step = have_step != 0 and step < 0
34070  *
34071  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
34072  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
34073  *
34074  */
34075     __pyx_t_1 = (__pyx_v_have_step != 0);
34076     if (__pyx_t_1) {
34077     } else {
34078       __pyx_t_2 = __pyx_t_1;
34079       goto __pyx_L9_bool_binop_done;
34080     }
34081     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
34082     __pyx_t_2 = __pyx_t_1;
34083     __pyx_L9_bool_binop_done:;
34084     if (__pyx_t_2) {
34085 
34086       /* "View.MemoryView":834
34087  *
34088  *         if have_step and step == 0:
34089  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
34090  *
34091  *
34092  */
34093       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
34094 
34095       /* "View.MemoryView":833
34096  *         negative_step = have_step != 0 and step < 0
34097  *
34098  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
34099  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
34100  *
34101  */
34102     }
34103 
34104     /* "View.MemoryView":837
34105  *
34106  *
34107  *         if have_start:             # <<<<<<<<<<<<<<
34108  *             if start < 0:
34109  *                 start += shape
34110  */
34111     __pyx_t_2 = (__pyx_v_have_start != 0);
34112     if (__pyx_t_2) {
34113 
34114       /* "View.MemoryView":838
34115  *
34116  *         if have_start:
34117  *             if start < 0:             # <<<<<<<<<<<<<<
34118  *                 start += shape
34119  *                 if start < 0:
34120  */
34121       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
34122       if (__pyx_t_2) {
34123 
34124         /* "View.MemoryView":839
34125  *         if have_start:
34126  *             if start < 0:
34127  *                 start += shape             # <<<<<<<<<<<<<<
34128  *                 if start < 0:
34129  *                     start = 0
34130  */
34131         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
34132 
34133         /* "View.MemoryView":840
34134  *             if start < 0:
34135  *                 start += shape
34136  *                 if start < 0:             # <<<<<<<<<<<<<<
34137  *                     start = 0
34138  *             elif start >= shape:
34139  */
34140         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
34141         if (__pyx_t_2) {
34142 
34143           /* "View.MemoryView":841
34144  *                 start += shape
34145  *                 if start < 0:
34146  *                     start = 0             # <<<<<<<<<<<<<<
34147  *             elif start >= shape:
34148  *                 if negative_step:
34149  */
34150           __pyx_v_start = 0;
34151 
34152           /* "View.MemoryView":840
34153  *             if start < 0:
34154  *                 start += shape
34155  *                 if start < 0:             # <<<<<<<<<<<<<<
34156  *                     start = 0
34157  *             elif start >= shape:
34158  */
34159         }
34160 
34161         /* "View.MemoryView":838
34162  *
34163  *         if have_start:
34164  *             if start < 0:             # <<<<<<<<<<<<<<
34165  *                 start += shape
34166  *                 if start < 0:
34167  */
34168         goto __pyx_L12;
34169       }
34170 
34171       /* "View.MemoryView":842
34172  *                 if start < 0:
34173  *                     start = 0
34174  *             elif start >= shape:             # <<<<<<<<<<<<<<
34175  *                 if negative_step:
34176  *                     start = shape - 1
34177  */
34178       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
34179       if (__pyx_t_2) {
34180 
34181         /* "View.MemoryView":843
34182  *                     start = 0
34183  *             elif start >= shape:
34184  *                 if negative_step:             # <<<<<<<<<<<<<<
34185  *                     start = shape - 1
34186  *                 else:
34187  */
34188         __pyx_t_2 = (__pyx_v_negative_step != 0);
34189         if (__pyx_t_2) {
34190 
34191           /* "View.MemoryView":844
34192  *             elif start >= shape:
34193  *                 if negative_step:
34194  *                     start = shape - 1             # <<<<<<<<<<<<<<
34195  *                 else:
34196  *                     start = shape
34197  */
34198           __pyx_v_start = (__pyx_v_shape - 1);
34199 
34200           /* "View.MemoryView":843
34201  *                     start = 0
34202  *             elif start >= shape:
34203  *                 if negative_step:             # <<<<<<<<<<<<<<
34204  *                     start = shape - 1
34205  *                 else:
34206  */
34207           goto __pyx_L14;
34208         }
34209 
34210         /* "View.MemoryView":846
34211  *                     start = shape - 1
34212  *                 else:
34213  *                     start = shape             # <<<<<<<<<<<<<<
34214  *         else:
34215  *             if negative_step:
34216  */
34217         /*else*/ {
34218           __pyx_v_start = __pyx_v_shape;
34219         }
34220         __pyx_L14:;
34221 
34222         /* "View.MemoryView":842
34223  *                 if start < 0:
34224  *                     start = 0
34225  *             elif start >= shape:             # <<<<<<<<<<<<<<
34226  *                 if negative_step:
34227  *                     start = shape - 1
34228  */
34229       }
34230       __pyx_L12:;
34231 
34232       /* "View.MemoryView":837
34233  *
34234  *
34235  *         if have_start:             # <<<<<<<<<<<<<<
34236  *             if start < 0:
34237  *                 start += shape
34238  */
34239       goto __pyx_L11;
34240     }
34241 
34242     /* "View.MemoryView":848
34243  *                     start = shape
34244  *         else:
34245  *             if negative_step:             # <<<<<<<<<<<<<<
34246  *                 start = shape - 1
34247  *             else:
34248  */
34249     /*else*/ {
34250       __pyx_t_2 = (__pyx_v_negative_step != 0);
34251       if (__pyx_t_2) {
34252 
34253         /* "View.MemoryView":849
34254  *         else:
34255  *             if negative_step:
34256  *                 start = shape - 1             # <<<<<<<<<<<<<<
34257  *             else:
34258  *                 start = 0
34259  */
34260         __pyx_v_start = (__pyx_v_shape - 1);
34261 
34262         /* "View.MemoryView":848
34263  *                     start = shape
34264  *         else:
34265  *             if negative_step:             # <<<<<<<<<<<<<<
34266  *                 start = shape - 1
34267  *             else:
34268  */
34269         goto __pyx_L15;
34270       }
34271 
34272       /* "View.MemoryView":851
34273  *                 start = shape - 1
34274  *             else:
34275  *                 start = 0             # <<<<<<<<<<<<<<
34276  *
34277  *         if have_stop:
34278  */
34279       /*else*/ {
34280         __pyx_v_start = 0;
34281       }
34282       __pyx_L15:;
34283     }
34284     __pyx_L11:;
34285 
34286     /* "View.MemoryView":853
34287  *                 start = 0
34288  *
34289  *         if have_stop:             # <<<<<<<<<<<<<<
34290  *             if stop < 0:
34291  *                 stop += shape
34292  */
34293     __pyx_t_2 = (__pyx_v_have_stop != 0);
34294     if (__pyx_t_2) {
34295 
34296       /* "View.MemoryView":854
34297  *
34298  *         if have_stop:
34299  *             if stop < 0:             # <<<<<<<<<<<<<<
34300  *                 stop += shape
34301  *                 if stop < 0:
34302  */
34303       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
34304       if (__pyx_t_2) {
34305 
34306         /* "View.MemoryView":855
34307  *         if have_stop:
34308  *             if stop < 0:
34309  *                 stop += shape             # <<<<<<<<<<<<<<
34310  *                 if stop < 0:
34311  *                     stop = 0
34312  */
34313         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
34314 
34315         /* "View.MemoryView":856
34316  *             if stop < 0:
34317  *                 stop += shape
34318  *                 if stop < 0:             # <<<<<<<<<<<<<<
34319  *                     stop = 0
34320  *             elif stop > shape:
34321  */
34322         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
34323         if (__pyx_t_2) {
34324 
34325           /* "View.MemoryView":857
34326  *                 stop += shape
34327  *                 if stop < 0:
34328  *                     stop = 0             # <<<<<<<<<<<<<<
34329  *             elif stop > shape:
34330  *                 stop = shape
34331  */
34332           __pyx_v_stop = 0;
34333 
34334           /* "View.MemoryView":856
34335  *             if stop < 0:
34336  *                 stop += shape
34337  *                 if stop < 0:             # <<<<<<<<<<<<<<
34338  *                     stop = 0
34339  *             elif stop > shape:
34340  */
34341         }
34342 
34343         /* "View.MemoryView":854
34344  *
34345  *         if have_stop:
34346  *             if stop < 0:             # <<<<<<<<<<<<<<
34347  *                 stop += shape
34348  *                 if stop < 0:
34349  */
34350         goto __pyx_L17;
34351       }
34352 
34353       /* "View.MemoryView":858
34354  *                 if stop < 0:
34355  *                     stop = 0
34356  *             elif stop > shape:             # <<<<<<<<<<<<<<
34357  *                 stop = shape
34358  *         else:
34359  */
34360       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
34361       if (__pyx_t_2) {
34362 
34363         /* "View.MemoryView":859
34364  *                     stop = 0
34365  *             elif stop > shape:
34366  *                 stop = shape             # <<<<<<<<<<<<<<
34367  *         else:
34368  *             if negative_step:
34369  */
34370         __pyx_v_stop = __pyx_v_shape;
34371 
34372         /* "View.MemoryView":858
34373  *                 if stop < 0:
34374  *                     stop = 0
34375  *             elif stop > shape:             # <<<<<<<<<<<<<<
34376  *                 stop = shape
34377  *         else:
34378  */
34379       }
34380       __pyx_L17:;
34381 
34382       /* "View.MemoryView":853
34383  *                 start = 0
34384  *
34385  *         if have_stop:             # <<<<<<<<<<<<<<
34386  *             if stop < 0:
34387  *                 stop += shape
34388  */
34389       goto __pyx_L16;
34390     }
34391 
34392     /* "View.MemoryView":861
34393  *                 stop = shape
34394  *         else:
34395  *             if negative_step:             # <<<<<<<<<<<<<<
34396  *                 stop = -1
34397  *             else:
34398  */
34399     /*else*/ {
34400       __pyx_t_2 = (__pyx_v_negative_step != 0);
34401       if (__pyx_t_2) {
34402 
34403         /* "View.MemoryView":862
34404  *         else:
34405  *             if negative_step:
34406  *                 stop = -1             # <<<<<<<<<<<<<<
34407  *             else:
34408  *                 stop = shape
34409  */
34410         __pyx_v_stop = -1L;
34411 
34412         /* "View.MemoryView":861
34413  *                 stop = shape
34414  *         else:
34415  *             if negative_step:             # <<<<<<<<<<<<<<
34416  *                 stop = -1
34417  *             else:
34418  */
34419         goto __pyx_L19;
34420       }
34421 
34422       /* "View.MemoryView":864
34423  *                 stop = -1
34424  *             else:
34425  *                 stop = shape             # <<<<<<<<<<<<<<
34426  *
34427  *         if not have_step:
34428  */
34429       /*else*/ {
34430         __pyx_v_stop = __pyx_v_shape;
34431       }
34432       __pyx_L19:;
34433     }
34434     __pyx_L16:;
34435 
34436     /* "View.MemoryView":866
34437  *                 stop = shape
34438  *
34439  *         if not have_step:             # <<<<<<<<<<<<<<
34440  *             step = 1
34441  *
34442  */
34443     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
34444     if (__pyx_t_2) {
34445 
34446       /* "View.MemoryView":867
34447  *
34448  *         if not have_step:
34449  *             step = 1             # <<<<<<<<<<<<<<
34450  *
34451  *
34452  */
34453       __pyx_v_step = 1;
34454 
34455       /* "View.MemoryView":866
34456  *                 stop = shape
34457  *
34458  *         if not have_step:             # <<<<<<<<<<<<<<
34459  *             step = 1
34460  *
34461  */
34462     }
34463 
34464     /* "View.MemoryView":871
34465  *
34466  *         with cython.cdivision(True):
34467  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
34468  *
34469  *             if (stop - start) - step * new_shape:
34470  */
34471     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
34472 
34473     /* "View.MemoryView":873
34474  *             new_shape = (stop - start) // step
34475  *
34476  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
34477  *                 new_shape += 1
34478  *
34479  */
34480     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
34481     if (__pyx_t_2) {
34482 
34483       /* "View.MemoryView":874
34484  *
34485  *             if (stop - start) - step * new_shape:
34486  *                 new_shape += 1             # <<<<<<<<<<<<<<
34487  *
34488  *         if new_shape < 0:
34489  */
34490       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
34491 
34492       /* "View.MemoryView":873
34493  *             new_shape = (stop - start) // step
34494  *
34495  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
34496  *                 new_shape += 1
34497  *
34498  */
34499     }
34500 
34501     /* "View.MemoryView":876
34502  *                 new_shape += 1
34503  *
34504  *         if new_shape < 0:             # <<<<<<<<<<<<<<
34505  *             new_shape = 0
34506  *
34507  */
34508     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
34509     if (__pyx_t_2) {
34510 
34511       /* "View.MemoryView":877
34512  *
34513  *         if new_shape < 0:
34514  *             new_shape = 0             # <<<<<<<<<<<<<<
34515  *
34516  *
34517  */
34518       __pyx_v_new_shape = 0;
34519 
34520       /* "View.MemoryView":876
34521  *                 new_shape += 1
34522  *
34523  *         if new_shape < 0:             # <<<<<<<<<<<<<<
34524  *             new_shape = 0
34525  *
34526  */
34527     }
34528 
34529     /* "View.MemoryView":880
34530  *
34531  *
34532  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
34533  *         dst.shape[new_ndim] = new_shape
34534  *         dst.suboffsets[new_ndim] = suboffset
34535  */
34536     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
34537 
34538     /* "View.MemoryView":881
34539  *
34540  *         dst.strides[new_ndim] = stride * step
34541  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
34542  *         dst.suboffsets[new_ndim] = suboffset
34543  *
34544  */
34545     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
34546 
34547     /* "View.MemoryView":882
34548  *         dst.strides[new_ndim] = stride * step
34549  *         dst.shape[new_ndim] = new_shape
34550  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
34551  *
34552  *
34553  */
34554     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
34555   }
34556   __pyx_L3:;
34557 
34558   /* "View.MemoryView":885
34559  *
34560  *
34561  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
34562  *         dst.data += start * stride
34563  *     else:
34564  */
34565   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
34566   if (__pyx_t_2) {
34567 
34568     /* "View.MemoryView":886
34569  *
34570  *     if suboffset_dim[0] < 0:
34571  *         dst.data += start * stride             # <<<<<<<<<<<<<<
34572  *     else:
34573  *         dst.suboffsets[suboffset_dim[0]] += start * stride
34574  */
34575     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
34576 
34577     /* "View.MemoryView":885
34578  *
34579  *
34580  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
34581  *         dst.data += start * stride
34582  *     else:
34583  */
34584     goto __pyx_L23;
34585   }
34586 
34587   /* "View.MemoryView":888
34588  *         dst.data += start * stride
34589  *     else:
34590  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
34591  *
34592  *     if suboffset >= 0:
34593  */
34594   /*else*/ {
34595     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
34596     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
34597   }
34598   __pyx_L23:;
34599 
34600   /* "View.MemoryView":890
34601  *         dst.suboffsets[suboffset_dim[0]] += start * stride
34602  *
34603  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
34604  *         if not is_slice:
34605  *             if new_ndim == 0:
34606  */
34607   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
34608   if (__pyx_t_2) {
34609 
34610     /* "View.MemoryView":891
34611  *
34612  *     if suboffset >= 0:
34613  *         if not is_slice:             # <<<<<<<<<<<<<<
34614  *             if new_ndim == 0:
34615  *                 dst.data = (<char **> dst.data)[0] + suboffset
34616  */
34617     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
34618     if (__pyx_t_2) {
34619 
34620       /* "View.MemoryView":892
34621  *     if suboffset >= 0:
34622  *         if not is_slice:
34623  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
34624  *                 dst.data = (<char **> dst.data)[0] + suboffset
34625  *             else:
34626  */
34627       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
34628       if (__pyx_t_2) {
34629 
34630         /* "View.MemoryView":893
34631  *         if not is_slice:
34632  *             if new_ndim == 0:
34633  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
34634  *             else:
34635  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
34636  */
34637         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
34638 
34639         /* "View.MemoryView":892
34640  *     if suboffset >= 0:
34641  *         if not is_slice:
34642  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
34643  *                 dst.data = (<char **> dst.data)[0] + suboffset
34644  *             else:
34645  */
34646         goto __pyx_L26;
34647       }
34648 
34649       /* "View.MemoryView":895
34650  *                 dst.data = (<char **> dst.data)[0] + suboffset
34651  *             else:
34652  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
34653  *                                      "must be indexed and not sliced", dim)
34654  *         else:
34655  */
34656       /*else*/ {
34657 
34658         /* "View.MemoryView":896
34659  *             else:
34660  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
34661  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
34662  *         else:
34663  *             suboffset_dim[0] = new_ndim
34664  */
34665         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 895, __pyx_L1_error)
34666       }
34667       __pyx_L26:;
34668 
34669       /* "View.MemoryView":891
34670  *
34671  *     if suboffset >= 0:
34672  *         if not is_slice:             # <<<<<<<<<<<<<<
34673  *             if new_ndim == 0:
34674  *                 dst.data = (<char **> dst.data)[0] + suboffset
34675  */
34676       goto __pyx_L25;
34677     }
34678 
34679     /* "View.MemoryView":898
34680  *                                      "must be indexed and not sliced", dim)
34681  *         else:
34682  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
34683  *
34684  *     return 0
34685  */
34686     /*else*/ {
34687       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
34688     }
34689     __pyx_L25:;
34690 
34691     /* "View.MemoryView":890
34692  *         dst.suboffsets[suboffset_dim[0]] += start * stride
34693  *
34694  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
34695  *         if not is_slice:
34696  *             if new_ndim == 0:
34697  */
34698   }
34699 
34700   /* "View.MemoryView":900
34701  *             suboffset_dim[0] = new_ndim
34702  *
34703  *     return 0             # <<<<<<<<<<<<<<
34704  *
34705  *
34706  */
34707   __pyx_r = 0;
34708   goto __pyx_L0;
34709 
34710   /* "View.MemoryView":803
34711  *
34712  * @cname('__pyx_memoryview_slice_memviewslice')
34713  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
34714  *         __Pyx_memviewslice *dst,
34715  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
34716  */
34717 
34718   /* function exit code */
34719   __pyx_L1_error:;
34720   {
34721     #ifdef WITH_THREAD
34722     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
34723     #endif
34724     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
34725     #ifdef WITH_THREAD
34726     __Pyx_PyGILState_Release(__pyx_gilstate_save);
34727     #endif
34728   }
34729   __pyx_r = -1;
34730   __pyx_L0:;
34731   return __pyx_r;
34732 }
34733 
34734 /* "View.MemoryView":906
34735  *
34736  * @cname('__pyx_pybuffer_index')
34737  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
34738  *                           Py_ssize_t dim) except NULL:
34739  *     cdef Py_ssize_t shape, stride, suboffset = -1
34740  */
34741 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)34742 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
34743   Py_ssize_t __pyx_v_shape;
34744   Py_ssize_t __pyx_v_stride;
34745   Py_ssize_t __pyx_v_suboffset;
34746   Py_ssize_t __pyx_v_itemsize;
34747   char *__pyx_v_resultp;
34748   char *__pyx_r;
34749   __Pyx_RefNannyDeclarations
34750   Py_ssize_t __pyx_t_1;
34751   int __pyx_t_2;
34752   PyObject *__pyx_t_3 = NULL;
34753   PyObject *__pyx_t_4 = NULL;
34754   __Pyx_RefNannySetupContext("pybuffer_index", 0);
34755 
34756   /* "View.MemoryView":908
34757  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
34758  *                           Py_ssize_t dim) except NULL:
34759  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
34760  *     cdef Py_ssize_t itemsize = view.itemsize
34761  *     cdef char *resultp
34762  */
34763   __pyx_v_suboffset = -1L;
34764 
34765   /* "View.MemoryView":909
34766  *                           Py_ssize_t dim) except NULL:
34767  *     cdef Py_ssize_t shape, stride, suboffset = -1
34768  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
34769  *     cdef char *resultp
34770  *
34771  */
34772   __pyx_t_1 = __pyx_v_view->itemsize;
34773   __pyx_v_itemsize = __pyx_t_1;
34774 
34775   /* "View.MemoryView":912
34776  *     cdef char *resultp
34777  *
34778  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
34779  *         shape = view.len / itemsize
34780  *         stride = itemsize
34781  */
34782   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
34783   if (__pyx_t_2) {
34784 
34785     /* "View.MemoryView":913
34786  *
34787  *     if view.ndim == 0:
34788  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
34789  *         stride = itemsize
34790  *     else:
34791  */
34792     if (unlikely(__pyx_v_itemsize == 0)) {
34793       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
34794       __PYX_ERR(1, 913, __pyx_L1_error)
34795     }
34796     else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
34797       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
34798       __PYX_ERR(1, 913, __pyx_L1_error)
34799     }
34800     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
34801 
34802     /* "View.MemoryView":914
34803  *     if view.ndim == 0:
34804  *         shape = view.len / itemsize
34805  *         stride = itemsize             # <<<<<<<<<<<<<<
34806  *     else:
34807  *         shape = view.shape[dim]
34808  */
34809     __pyx_v_stride = __pyx_v_itemsize;
34810 
34811     /* "View.MemoryView":912
34812  *     cdef char *resultp
34813  *
34814  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
34815  *         shape = view.len / itemsize
34816  *         stride = itemsize
34817  */
34818     goto __pyx_L3;
34819   }
34820 
34821   /* "View.MemoryView":916
34822  *         stride = itemsize
34823  *     else:
34824  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
34825  *         stride = view.strides[dim]
34826  *         if view.suboffsets != NULL:
34827  */
34828   /*else*/ {
34829     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
34830 
34831     /* "View.MemoryView":917
34832  *     else:
34833  *         shape = view.shape[dim]
34834  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
34835  *         if view.suboffsets != NULL:
34836  *             suboffset = view.suboffsets[dim]
34837  */
34838     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
34839 
34840     /* "View.MemoryView":918
34841  *         shape = view.shape[dim]
34842  *         stride = view.strides[dim]
34843  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
34844  *             suboffset = view.suboffsets[dim]
34845  *
34846  */
34847     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
34848     if (__pyx_t_2) {
34849 
34850       /* "View.MemoryView":919
34851  *         stride = view.strides[dim]
34852  *         if view.suboffsets != NULL:
34853  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
34854  *
34855  *     if index < 0:
34856  */
34857       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
34858 
34859       /* "View.MemoryView":918
34860  *         shape = view.shape[dim]
34861  *         stride = view.strides[dim]
34862  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
34863  *             suboffset = view.suboffsets[dim]
34864  *
34865  */
34866     }
34867   }
34868   __pyx_L3:;
34869 
34870   /* "View.MemoryView":921
34871  *             suboffset = view.suboffsets[dim]
34872  *
34873  *     if index < 0:             # <<<<<<<<<<<<<<
34874  *         index += view.shape[dim]
34875  *         if index < 0:
34876  */
34877   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
34878   if (__pyx_t_2) {
34879 
34880     /* "View.MemoryView":922
34881  *
34882  *     if index < 0:
34883  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
34884  *         if index < 0:
34885  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34886  */
34887     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
34888 
34889     /* "View.MemoryView":923
34890  *     if index < 0:
34891  *         index += view.shape[dim]
34892  *         if index < 0:             # <<<<<<<<<<<<<<
34893  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34894  *
34895  */
34896     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
34897     if (unlikely(__pyx_t_2)) {
34898 
34899       /* "View.MemoryView":924
34900  *         index += view.shape[dim]
34901  *         if index < 0:
34902  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
34903  *
34904  *     if index >= shape:
34905  */
34906       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
34907       __Pyx_GOTREF(__pyx_t_3);
34908       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error)
34909       __Pyx_GOTREF(__pyx_t_4);
34910       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34911       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
34912       __Pyx_GOTREF(__pyx_t_3);
34913       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34914       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
34915       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34916       __PYX_ERR(1, 924, __pyx_L1_error)
34917 
34918       /* "View.MemoryView":923
34919  *     if index < 0:
34920  *         index += view.shape[dim]
34921  *         if index < 0:             # <<<<<<<<<<<<<<
34922  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34923  *
34924  */
34925     }
34926 
34927     /* "View.MemoryView":921
34928  *             suboffset = view.suboffsets[dim]
34929  *
34930  *     if index < 0:             # <<<<<<<<<<<<<<
34931  *         index += view.shape[dim]
34932  *         if index < 0:
34933  */
34934   }
34935 
34936   /* "View.MemoryView":926
34937  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34938  *
34939  *     if index >= shape:             # <<<<<<<<<<<<<<
34940  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34941  *
34942  */
34943   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
34944   if (unlikely(__pyx_t_2)) {
34945 
34946     /* "View.MemoryView":927
34947  *
34948  *     if index >= shape:
34949  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
34950  *
34951  *     resultp = bufp + index * stride
34952  */
34953     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
34954     __Pyx_GOTREF(__pyx_t_3);
34955     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 927, __pyx_L1_error)
34956     __Pyx_GOTREF(__pyx_t_4);
34957     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34958     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
34959     __Pyx_GOTREF(__pyx_t_3);
34960     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34961     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
34962     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34963     __PYX_ERR(1, 927, __pyx_L1_error)
34964 
34965     /* "View.MemoryView":926
34966  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34967  *
34968  *     if index >= shape:             # <<<<<<<<<<<<<<
34969  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34970  *
34971  */
34972   }
34973 
34974   /* "View.MemoryView":929
34975  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
34976  *
34977  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
34978  *     if suboffset >= 0:
34979  *         resultp = (<char **> resultp)[0] + suboffset
34980  */
34981   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
34982 
34983   /* "View.MemoryView":930
34984  *
34985  *     resultp = bufp + index * stride
34986  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
34987  *         resultp = (<char **> resultp)[0] + suboffset
34988  *
34989  */
34990   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
34991   if (__pyx_t_2) {
34992 
34993     /* "View.MemoryView":931
34994  *     resultp = bufp + index * stride
34995  *     if suboffset >= 0:
34996  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
34997  *
34998  *     return resultp
34999  */
35000     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
35001 
35002     /* "View.MemoryView":930
35003  *
35004  *     resultp = bufp + index * stride
35005  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
35006  *         resultp = (<char **> resultp)[0] + suboffset
35007  *
35008  */
35009   }
35010 
35011   /* "View.MemoryView":933
35012  *         resultp = (<char **> resultp)[0] + suboffset
35013  *
35014  *     return resultp             # <<<<<<<<<<<<<<
35015  *
35016  *
35017  */
35018   __pyx_r = __pyx_v_resultp;
35019   goto __pyx_L0;
35020 
35021   /* "View.MemoryView":906
35022  *
35023  * @cname('__pyx_pybuffer_index')
35024  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
35025  *                           Py_ssize_t dim) except NULL:
35026  *     cdef Py_ssize_t shape, stride, suboffset = -1
35027  */
35028 
35029   /* function exit code */
35030   __pyx_L1_error:;
35031   __Pyx_XDECREF(__pyx_t_3);
35032   __Pyx_XDECREF(__pyx_t_4);
35033   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
35034   __pyx_r = NULL;
35035   __pyx_L0:;
35036   __Pyx_RefNannyFinishContext();
35037   return __pyx_r;
35038 }
35039 
35040 /* "View.MemoryView":939
35041  *
35042  * @cname('__pyx_memslice_transpose')
35043  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
35044  *     cdef int ndim = memslice.memview.view.ndim
35045  *
35046  */
35047 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)35048 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
35049   int __pyx_v_ndim;
35050   Py_ssize_t *__pyx_v_shape;
35051   Py_ssize_t *__pyx_v_strides;
35052   int __pyx_v_i;
35053   int __pyx_v_j;
35054   int __pyx_r;
35055   int __pyx_t_1;
35056   Py_ssize_t *__pyx_t_2;
35057   long __pyx_t_3;
35058   long __pyx_t_4;
35059   Py_ssize_t __pyx_t_5;
35060   Py_ssize_t __pyx_t_6;
35061   int __pyx_t_7;
35062   int __pyx_t_8;
35063   int __pyx_t_9;
35064 
35065   /* "View.MemoryView":940
35066  * @cname('__pyx_memslice_transpose')
35067  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
35068  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
35069  *
35070  *     cdef Py_ssize_t *shape = memslice.shape
35071  */
35072   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
35073   __pyx_v_ndim = __pyx_t_1;
35074 
35075   /* "View.MemoryView":942
35076  *     cdef int ndim = memslice.memview.view.ndim
35077  *
35078  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
35079  *     cdef Py_ssize_t *strides = memslice.strides
35080  *
35081  */
35082   __pyx_t_2 = __pyx_v_memslice->shape;
35083   __pyx_v_shape = __pyx_t_2;
35084 
35085   /* "View.MemoryView":943
35086  *
35087  *     cdef Py_ssize_t *shape = memslice.shape
35088  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
35089  *
35090  *
35091  */
35092   __pyx_t_2 = __pyx_v_memslice->strides;
35093   __pyx_v_strides = __pyx_t_2;
35094 
35095   /* "View.MemoryView":947
35096  *
35097  *     cdef int i, j
35098  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
35099  *         j = ndim - 1 - i
35100  *         strides[i], strides[j] = strides[j], strides[i]
35101  */
35102   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
35103   __pyx_t_4 = __pyx_t_3;
35104   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
35105     __pyx_v_i = __pyx_t_1;
35106 
35107     /* "View.MemoryView":948
35108  *     cdef int i, j
35109  *     for i in range(ndim / 2):
35110  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
35111  *         strides[i], strides[j] = strides[j], strides[i]
35112  *         shape[i], shape[j] = shape[j], shape[i]
35113  */
35114     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
35115 
35116     /* "View.MemoryView":949
35117  *     for i in range(ndim / 2):
35118  *         j = ndim - 1 - i
35119  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
35120  *         shape[i], shape[j] = shape[j], shape[i]
35121  *
35122  */
35123     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
35124     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
35125     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
35126     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
35127 
35128     /* "View.MemoryView":950
35129  *         j = ndim - 1 - i
35130  *         strides[i], strides[j] = strides[j], strides[i]
35131  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
35132  *
35133  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
35134  */
35135     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
35136     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
35137     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
35138     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
35139 
35140     /* "View.MemoryView":952
35141  *         shape[i], shape[j] = shape[j], shape[i]
35142  *
35143  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
35144  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
35145  *
35146  */
35147     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
35148     if (!__pyx_t_8) {
35149     } else {
35150       __pyx_t_7 = __pyx_t_8;
35151       goto __pyx_L6_bool_binop_done;
35152     }
35153     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
35154     __pyx_t_7 = __pyx_t_8;
35155     __pyx_L6_bool_binop_done:;
35156     if (__pyx_t_7) {
35157 
35158       /* "View.MemoryView":953
35159  *
35160  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
35161  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
35162  *
35163  *     return 1
35164  */
35165       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
35166 
35167       /* "View.MemoryView":952
35168  *         shape[i], shape[j] = shape[j], shape[i]
35169  *
35170  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
35171  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
35172  *
35173  */
35174     }
35175   }
35176 
35177   /* "View.MemoryView":955
35178  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
35179  *
35180  *     return 1             # <<<<<<<<<<<<<<
35181  *
35182  *
35183  */
35184   __pyx_r = 1;
35185   goto __pyx_L0;
35186 
35187   /* "View.MemoryView":939
35188  *
35189  * @cname('__pyx_memslice_transpose')
35190  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
35191  *     cdef int ndim = memslice.memview.view.ndim
35192  *
35193  */
35194 
35195   /* function exit code */
35196   __pyx_L1_error:;
35197   {
35198     #ifdef WITH_THREAD
35199     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
35200     #endif
35201     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
35202     #ifdef WITH_THREAD
35203     __Pyx_PyGILState_Release(__pyx_gilstate_save);
35204     #endif
35205   }
35206   __pyx_r = 0;
35207   __pyx_L0:;
35208   return __pyx_r;
35209 }
35210 
35211 /* "View.MemoryView":972
35212  *     cdef int (*to_dtype_func)(char *, object) except 0
35213  *
35214  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
35215  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
35216  *
35217  */
35218 
35219 /* Python wrapper */
35220 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)35221 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
35222   __Pyx_RefNannyDeclarations
35223   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
35224   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
35225 
35226   /* function exit code */
35227   __Pyx_RefNannyFinishContext();
35228 }
35229 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)35230 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
35231   __Pyx_RefNannyDeclarations
35232   __Pyx_RefNannySetupContext("__dealloc__", 0);
35233 
35234   /* "View.MemoryView":973
35235  *
35236  *     def __dealloc__(self):
35237  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
35238  *
35239  *     cdef convert_item_to_object(self, char *itemp):
35240  */
35241   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
35242 
35243   /* "View.MemoryView":972
35244  *     cdef int (*to_dtype_func)(char *, object) except 0
35245  *
35246  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
35247  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
35248  *
35249  */
35250 
35251   /* function exit code */
35252   __Pyx_RefNannyFinishContext();
35253 }
35254 
35255 /* "View.MemoryView":975
35256  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
35257  *
35258  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
35259  *         if self.to_object_func != NULL:
35260  *             return self.to_object_func(itemp)
35261  */
35262 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)35263 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
35264   PyObject *__pyx_r = NULL;
35265   __Pyx_RefNannyDeclarations
35266   int __pyx_t_1;
35267   PyObject *__pyx_t_2 = NULL;
35268   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
35269 
35270   /* "View.MemoryView":976
35271  *
35272  *     cdef convert_item_to_object(self, char *itemp):
35273  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
35274  *             return self.to_object_func(itemp)
35275  *         else:
35276  */
35277   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
35278   if (__pyx_t_1) {
35279 
35280     /* "View.MemoryView":977
35281  *     cdef convert_item_to_object(self, char *itemp):
35282  *         if self.to_object_func != NULL:
35283  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
35284  *         else:
35285  *             return memoryview.convert_item_to_object(self, itemp)
35286  */
35287     __Pyx_XDECREF(__pyx_r);
35288     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
35289     __Pyx_GOTREF(__pyx_t_2);
35290     __pyx_r = __pyx_t_2;
35291     __pyx_t_2 = 0;
35292     goto __pyx_L0;
35293 
35294     /* "View.MemoryView":976
35295  *
35296  *     cdef convert_item_to_object(self, char *itemp):
35297  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
35298  *             return self.to_object_func(itemp)
35299  *         else:
35300  */
35301   }
35302 
35303   /* "View.MemoryView":979
35304  *             return self.to_object_func(itemp)
35305  *         else:
35306  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
35307  *
35308  *     cdef assign_item_from_object(self, char *itemp, object value):
35309  */
35310   /*else*/ {
35311     __Pyx_XDECREF(__pyx_r);
35312     __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 979, __pyx_L1_error)
35313     __Pyx_GOTREF(__pyx_t_2);
35314     __pyx_r = __pyx_t_2;
35315     __pyx_t_2 = 0;
35316     goto __pyx_L0;
35317   }
35318 
35319   /* "View.MemoryView":975
35320  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
35321  *
35322  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
35323  *         if self.to_object_func != NULL:
35324  *             return self.to_object_func(itemp)
35325  */
35326 
35327   /* function exit code */
35328   __pyx_L1_error:;
35329   __Pyx_XDECREF(__pyx_t_2);
35330   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
35331   __pyx_r = 0;
35332   __pyx_L0:;
35333   __Pyx_XGIVEREF(__pyx_r);
35334   __Pyx_RefNannyFinishContext();
35335   return __pyx_r;
35336 }
35337 
35338 /* "View.MemoryView":981
35339  *             return memoryview.convert_item_to_object(self, itemp)
35340  *
35341  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
35342  *         if self.to_dtype_func != NULL:
35343  *             self.to_dtype_func(itemp, value)
35344  */
35345 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)35346 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
35347   PyObject *__pyx_r = NULL;
35348   __Pyx_RefNannyDeclarations
35349   int __pyx_t_1;
35350   int __pyx_t_2;
35351   PyObject *__pyx_t_3 = NULL;
35352   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
35353 
35354   /* "View.MemoryView":982
35355  *
35356  *     cdef assign_item_from_object(self, char *itemp, object value):
35357  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
35358  *             self.to_dtype_func(itemp, value)
35359  *         else:
35360  */
35361   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
35362   if (__pyx_t_1) {
35363 
35364     /* "View.MemoryView":983
35365  *     cdef assign_item_from_object(self, char *itemp, object value):
35366  *         if self.to_dtype_func != NULL:
35367  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
35368  *         else:
35369  *             memoryview.assign_item_from_object(self, itemp, value)
35370  */
35371     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 983, __pyx_L1_error)
35372 
35373     /* "View.MemoryView":982
35374  *
35375  *     cdef assign_item_from_object(self, char *itemp, object value):
35376  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
35377  *             self.to_dtype_func(itemp, value)
35378  *         else:
35379  */
35380     goto __pyx_L3;
35381   }
35382 
35383   /* "View.MemoryView":985
35384  *             self.to_dtype_func(itemp, value)
35385  *         else:
35386  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
35387  *
35388  *     @property
35389  */
35390   /*else*/ {
35391     __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 985, __pyx_L1_error)
35392     __Pyx_GOTREF(__pyx_t_3);
35393     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35394   }
35395   __pyx_L3:;
35396 
35397   /* "View.MemoryView":981
35398  *             return memoryview.convert_item_to_object(self, itemp)
35399  *
35400  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
35401  *         if self.to_dtype_func != NULL:
35402  *             self.to_dtype_func(itemp, value)
35403  */
35404 
35405   /* function exit code */
35406   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35407   goto __pyx_L0;
35408   __pyx_L1_error:;
35409   __Pyx_XDECREF(__pyx_t_3);
35410   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
35411   __pyx_r = 0;
35412   __pyx_L0:;
35413   __Pyx_XGIVEREF(__pyx_r);
35414   __Pyx_RefNannyFinishContext();
35415   return __pyx_r;
35416 }
35417 
35418 /* "View.MemoryView":988
35419  *
35420  *     @property
35421  *     def base(self):             # <<<<<<<<<<<<<<
35422  *         return self.from_object
35423  *
35424  */
35425 
35426 /* Python wrapper */
35427 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject * __pyx_v_self)35428 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
35429   PyObject *__pyx_r = 0;
35430   __Pyx_RefNannyDeclarations
35431   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
35432   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
35433 
35434   /* function exit code */
35435   __Pyx_RefNannyFinishContext();
35436   return __pyx_r;
35437 }
35438 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)35439 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
35440   PyObject *__pyx_r = NULL;
35441   __Pyx_RefNannyDeclarations
35442   __Pyx_RefNannySetupContext("__get__", 0);
35443 
35444   /* "View.MemoryView":989
35445  *     @property
35446  *     def base(self):
35447  *         return self.from_object             # <<<<<<<<<<<<<<
35448  *
35449  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
35450  */
35451   __Pyx_XDECREF(__pyx_r);
35452   __Pyx_INCREF(__pyx_v_self->from_object);
35453   __pyx_r = __pyx_v_self->from_object;
35454   goto __pyx_L0;
35455 
35456   /* "View.MemoryView":988
35457  *
35458  *     @property
35459  *     def base(self):             # <<<<<<<<<<<<<<
35460  *         return self.from_object
35461  *
35462  */
35463 
35464   /* function exit code */
35465   __pyx_L0:;
35466   __Pyx_XGIVEREF(__pyx_r);
35467   __Pyx_RefNannyFinishContext();
35468   return __pyx_r;
35469 }
35470 
35471 /* "(tree fragment)":1
35472  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
35473  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35474  * def __setstate_cython__(self, __pyx_state):
35475  */
35476 
35477 /* Python wrapper */
35478 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)35479 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
35480   PyObject *__pyx_r = 0;
35481   __Pyx_RefNannyDeclarations
35482   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
35483   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
35484 
35485   /* function exit code */
35486   __Pyx_RefNannyFinishContext();
35487   return __pyx_r;
35488 }
35489 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)35490 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
35491   PyObject *__pyx_r = NULL;
35492   __Pyx_RefNannyDeclarations
35493   PyObject *__pyx_t_1 = NULL;
35494   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
35495 
35496   /* "(tree fragment)":2
35497  * def __reduce_cython__(self):
35498  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
35499  * def __setstate_cython__(self, __pyx_state):
35500  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35501  */
35502   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
35503   __Pyx_GOTREF(__pyx_t_1);
35504   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
35505   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35506   __PYX_ERR(1, 2, __pyx_L1_error)
35507 
35508   /* "(tree fragment)":1
35509  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
35510  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35511  * def __setstate_cython__(self, __pyx_state):
35512  */
35513 
35514   /* function exit code */
35515   __pyx_L1_error:;
35516   __Pyx_XDECREF(__pyx_t_1);
35517   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
35518   __pyx_r = NULL;
35519   __Pyx_XGIVEREF(__pyx_r);
35520   __Pyx_RefNannyFinishContext();
35521   return __pyx_r;
35522 }
35523 
35524 /* "(tree fragment)":3
35525  * def __reduce_cython__(self):
35526  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35527  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
35528  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35529  */
35530 
35531 /* Python wrapper */
35532 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)35533 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
35534   PyObject *__pyx_r = 0;
35535   __Pyx_RefNannyDeclarations
35536   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
35537   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
35538 
35539   /* function exit code */
35540   __Pyx_RefNannyFinishContext();
35541   return __pyx_r;
35542 }
35543 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)35544 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
35545   PyObject *__pyx_r = NULL;
35546   __Pyx_RefNannyDeclarations
35547   PyObject *__pyx_t_1 = NULL;
35548   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
35549 
35550   /* "(tree fragment)":4
35551  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35552  * def __setstate_cython__(self, __pyx_state):
35553  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
35554  */
35555   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
35556   __Pyx_GOTREF(__pyx_t_1);
35557   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
35558   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35559   __PYX_ERR(1, 4, __pyx_L1_error)
35560 
35561   /* "(tree fragment)":3
35562  * def __reduce_cython__(self):
35563  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35564  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
35565  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
35566  */
35567 
35568   /* function exit code */
35569   __pyx_L1_error:;
35570   __Pyx_XDECREF(__pyx_t_1);
35571   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
35572   __pyx_r = NULL;
35573   __Pyx_XGIVEREF(__pyx_r);
35574   __Pyx_RefNannyFinishContext();
35575   return __pyx_r;
35576 }
35577 
35578 /* "View.MemoryView":995
35579  *
35580  * @cname('__pyx_memoryview_fromslice')
35581  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
35582  *                           int ndim,
35583  *                           object (*to_object_func)(char *),
35584  */
35585 
__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,int __pyx_v_ndim,PyObject * (* __pyx_v_to_object_func)(char *),int (* __pyx_v_to_dtype_func)(char *,PyObject *),int __pyx_v_dtype_is_object)35586 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
35587   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
35588   Py_ssize_t __pyx_v_suboffset;
35589   PyObject *__pyx_v_length = NULL;
35590   PyObject *__pyx_r = NULL;
35591   __Pyx_RefNannyDeclarations
35592   int __pyx_t_1;
35593   PyObject *__pyx_t_2 = NULL;
35594   PyObject *__pyx_t_3 = NULL;
35595   __Pyx_TypeInfo *__pyx_t_4;
35596   Py_buffer __pyx_t_5;
35597   Py_ssize_t *__pyx_t_6;
35598   Py_ssize_t *__pyx_t_7;
35599   Py_ssize_t *__pyx_t_8;
35600   Py_ssize_t __pyx_t_9;
35601   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
35602 
35603   /* "View.MemoryView":1003
35604  *     cdef _memoryviewslice result
35605  *
35606  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
35607  *         return None
35608  *
35609  */
35610   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
35611   if (__pyx_t_1) {
35612 
35613     /* "View.MemoryView":1004
35614  *
35615  *     if <PyObject *> memviewslice.memview == Py_None:
35616  *         return None             # <<<<<<<<<<<<<<
35617  *
35618  *
35619  */
35620     __Pyx_XDECREF(__pyx_r);
35621     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35622     goto __pyx_L0;
35623 
35624     /* "View.MemoryView":1003
35625  *     cdef _memoryviewslice result
35626  *
35627  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
35628  *         return None
35629  *
35630  */
35631   }
35632 
35633   /* "View.MemoryView":1009
35634  *
35635  *
35636  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
35637  *
35638  *     result.from_slice = memviewslice
35639  */
35640   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
35641   __Pyx_GOTREF(__pyx_t_2);
35642   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
35643   __Pyx_GOTREF(__pyx_t_3);
35644   __Pyx_INCREF(Py_None);
35645   __Pyx_GIVEREF(Py_None);
35646   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
35647   __Pyx_INCREF(__pyx_int_0);
35648   __Pyx_GIVEREF(__pyx_int_0);
35649   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
35650   __Pyx_GIVEREF(__pyx_t_2);
35651   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
35652   __pyx_t_2 = 0;
35653   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
35654   __Pyx_GOTREF(__pyx_t_2);
35655   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35656   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
35657   __pyx_t_2 = 0;
35658 
35659   /* "View.MemoryView":1011
35660  *     result = _memoryviewslice(None, 0, dtype_is_object)
35661  *
35662  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
35663  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
35664  *
35665  */
35666   __pyx_v_result->from_slice = __pyx_v_memviewslice;
35667 
35668   /* "View.MemoryView":1012
35669  *
35670  *     result.from_slice = memviewslice
35671  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
35672  *
35673  *     result.from_object = (<memoryview> memviewslice.memview).base
35674  */
35675   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
35676 
35677   /* "View.MemoryView":1014
35678  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
35679  *
35680  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
35681  *     result.typeinfo = memviewslice.memview.typeinfo
35682  *
35683  */
35684   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
35685   __Pyx_GOTREF(__pyx_t_2);
35686   __Pyx_GIVEREF(__pyx_t_2);
35687   __Pyx_GOTREF(__pyx_v_result->from_object);
35688   __Pyx_DECREF(__pyx_v_result->from_object);
35689   __pyx_v_result->from_object = __pyx_t_2;
35690   __pyx_t_2 = 0;
35691 
35692   /* "View.MemoryView":1015
35693  *
35694  *     result.from_object = (<memoryview> memviewslice.memview).base
35695  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
35696  *
35697  *     result.view = memviewslice.memview.view
35698  */
35699   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
35700   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
35701 
35702   /* "View.MemoryView":1017
35703  *     result.typeinfo = memviewslice.memview.typeinfo
35704  *
35705  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
35706  *     result.view.buf = <void *> memviewslice.data
35707  *     result.view.ndim = ndim
35708  */
35709   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
35710   __pyx_v_result->__pyx_base.view = __pyx_t_5;
35711 
35712   /* "View.MemoryView":1018
35713  *
35714  *     result.view = memviewslice.memview.view
35715  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
35716  *     result.view.ndim = ndim
35717  *     (<__pyx_buffer *> &result.view).obj = Py_None
35718  */
35719   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
35720 
35721   /* "View.MemoryView":1019
35722  *     result.view = memviewslice.memview.view
35723  *     result.view.buf = <void *> memviewslice.data
35724  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
35725  *     (<__pyx_buffer *> &result.view).obj = Py_None
35726  *     Py_INCREF(Py_None)
35727  */
35728   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
35729 
35730   /* "View.MemoryView":1020
35731  *     result.view.buf = <void *> memviewslice.data
35732  *     result.view.ndim = ndim
35733  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
35734  *     Py_INCREF(Py_None)
35735  *
35736  */
35737   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
35738 
35739   /* "View.MemoryView":1021
35740  *     result.view.ndim = ndim
35741  *     (<__pyx_buffer *> &result.view).obj = Py_None
35742  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
35743  *
35744  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
35745  */
35746   Py_INCREF(Py_None);
35747 
35748   /* "View.MemoryView":1023
35749  *     Py_INCREF(Py_None)
35750  *
35751  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
35752  *         result.flags = PyBUF_RECORDS
35753  *     else:
35754  */
35755   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
35756   if (__pyx_t_1) {
35757 
35758     /* "View.MemoryView":1024
35759  *
35760  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
35761  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
35762  *     else:
35763  *         result.flags = PyBUF_RECORDS_RO
35764  */
35765     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
35766 
35767     /* "View.MemoryView":1023
35768  *     Py_INCREF(Py_None)
35769  *
35770  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
35771  *         result.flags = PyBUF_RECORDS
35772  *     else:
35773  */
35774     goto __pyx_L4;
35775   }
35776 
35777   /* "View.MemoryView":1026
35778  *         result.flags = PyBUF_RECORDS
35779  *     else:
35780  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
35781  *
35782  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
35783  */
35784   /*else*/ {
35785     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
35786   }
35787   __pyx_L4:;
35788 
35789   /* "View.MemoryView":1028
35790  *         result.flags = PyBUF_RECORDS_RO
35791  *
35792  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
35793  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
35794  *
35795  */
35796   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
35797 
35798   /* "View.MemoryView":1029
35799  *
35800  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
35801  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
35802  *
35803  *
35804  */
35805   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
35806 
35807   /* "View.MemoryView":1032
35808  *
35809  *
35810  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
35811  *     for suboffset in result.from_slice.suboffsets[:ndim]:
35812  *         if suboffset >= 0:
35813  */
35814   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
35815 
35816   /* "View.MemoryView":1033
35817  *
35818  *     result.view.suboffsets = NULL
35819  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
35820  *         if suboffset >= 0:
35821  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
35822  */
35823   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
35824   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
35825     __pyx_t_6 = __pyx_t_8;
35826     __pyx_v_suboffset = (__pyx_t_6[0]);
35827 
35828     /* "View.MemoryView":1034
35829  *     result.view.suboffsets = NULL
35830  *     for suboffset in result.from_slice.suboffsets[:ndim]:
35831  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
35832  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
35833  *             break
35834  */
35835     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
35836     if (__pyx_t_1) {
35837 
35838       /* "View.MemoryView":1035
35839  *     for suboffset in result.from_slice.suboffsets[:ndim]:
35840  *         if suboffset >= 0:
35841  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
35842  *             break
35843  *
35844  */
35845       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
35846 
35847       /* "View.MemoryView":1036
35848  *         if suboffset >= 0:
35849  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
35850  *             break             # <<<<<<<<<<<<<<
35851  *
35852  *     result.view.len = result.view.itemsize
35853  */
35854       goto __pyx_L6_break;
35855 
35856       /* "View.MemoryView":1034
35857  *     result.view.suboffsets = NULL
35858  *     for suboffset in result.from_slice.suboffsets[:ndim]:
35859  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
35860  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
35861  *             break
35862  */
35863     }
35864   }
35865   __pyx_L6_break:;
35866 
35867   /* "View.MemoryView":1038
35868  *             break
35869  *
35870  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
35871  *     for length in result.view.shape[:ndim]:
35872  *         result.view.len *= length
35873  */
35874   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
35875   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
35876 
35877   /* "View.MemoryView":1039
35878  *
35879  *     result.view.len = result.view.itemsize
35880  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
35881  *         result.view.len *= length
35882  *
35883  */
35884   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
35885   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
35886     __pyx_t_6 = __pyx_t_8;
35887     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
35888     __Pyx_GOTREF(__pyx_t_2);
35889     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
35890     __pyx_t_2 = 0;
35891 
35892     /* "View.MemoryView":1040
35893  *     result.view.len = result.view.itemsize
35894  *     for length in result.view.shape[:ndim]:
35895  *         result.view.len *= length             # <<<<<<<<<<<<<<
35896  *
35897  *     result.to_object_func = to_object_func
35898  */
35899     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
35900     __Pyx_GOTREF(__pyx_t_2);
35901     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
35902     __Pyx_GOTREF(__pyx_t_3);
35903     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35904     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
35905     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35906     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
35907   }
35908 
35909   /* "View.MemoryView":1042
35910  *         result.view.len *= length
35911  *
35912  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
35913  *     result.to_dtype_func = to_dtype_func
35914  *
35915  */
35916   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
35917 
35918   /* "View.MemoryView":1043
35919  *
35920  *     result.to_object_func = to_object_func
35921  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
35922  *
35923  *     return result
35924  */
35925   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
35926 
35927   /* "View.MemoryView":1045
35928  *     result.to_dtype_func = to_dtype_func
35929  *
35930  *     return result             # <<<<<<<<<<<<<<
35931  *
35932  * @cname('__pyx_memoryview_get_slice_from_memoryview')
35933  */
35934   __Pyx_XDECREF(__pyx_r);
35935   __Pyx_INCREF(((PyObject *)__pyx_v_result));
35936   __pyx_r = ((PyObject *)__pyx_v_result);
35937   goto __pyx_L0;
35938 
35939   /* "View.MemoryView":995
35940  *
35941  * @cname('__pyx_memoryview_fromslice')
35942  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
35943  *                           int ndim,
35944  *                           object (*to_object_func)(char *),
35945  */
35946 
35947   /* function exit code */
35948   __pyx_L1_error:;
35949   __Pyx_XDECREF(__pyx_t_2);
35950   __Pyx_XDECREF(__pyx_t_3);
35951   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
35952   __pyx_r = 0;
35953   __pyx_L0:;
35954   __Pyx_XDECREF((PyObject *)__pyx_v_result);
35955   __Pyx_XDECREF(__pyx_v_length);
35956   __Pyx_XGIVEREF(__pyx_r);
35957   __Pyx_RefNannyFinishContext();
35958   return __pyx_r;
35959 }
35960 
35961 /* "View.MemoryView":1048
35962  *
35963  * @cname('__pyx_memoryview_get_slice_from_memoryview')
35964  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
35965  *                                                    __Pyx_memviewslice *mslice):
35966  *     cdef _memoryviewslice obj
35967  */
35968 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)35969 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
35970   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
35971   __Pyx_memviewslice *__pyx_r;
35972   __Pyx_RefNannyDeclarations
35973   int __pyx_t_1;
35974   int __pyx_t_2;
35975   PyObject *__pyx_t_3 = NULL;
35976   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
35977 
35978   /* "View.MemoryView":1051
35979  *                                                    __Pyx_memviewslice *mslice):
35980  *     cdef _memoryviewslice obj
35981  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
35982  *         obj = memview
35983  *         return &obj.from_slice
35984  */
35985   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
35986   __pyx_t_2 = (__pyx_t_1 != 0);
35987   if (__pyx_t_2) {
35988 
35989     /* "View.MemoryView":1052
35990  *     cdef _memoryviewslice obj
35991  *     if isinstance(memview, _memoryviewslice):
35992  *         obj = memview             # <<<<<<<<<<<<<<
35993  *         return &obj.from_slice
35994  *     else:
35995  */
35996     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
35997     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
35998     __Pyx_INCREF(__pyx_t_3);
35999     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
36000     __pyx_t_3 = 0;
36001 
36002     /* "View.MemoryView":1053
36003  *     if isinstance(memview, _memoryviewslice):
36004  *         obj = memview
36005  *         return &obj.from_slice             # <<<<<<<<<<<<<<
36006  *     else:
36007  *         slice_copy(memview, mslice)
36008  */
36009     __pyx_r = (&__pyx_v_obj->from_slice);
36010     goto __pyx_L0;
36011 
36012     /* "View.MemoryView":1051
36013  *                                                    __Pyx_memviewslice *mslice):
36014  *     cdef _memoryviewslice obj
36015  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
36016  *         obj = memview
36017  *         return &obj.from_slice
36018  */
36019   }
36020 
36021   /* "View.MemoryView":1055
36022  *         return &obj.from_slice
36023  *     else:
36024  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
36025  *         return mslice
36026  *
36027  */
36028   /*else*/ {
36029     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
36030 
36031     /* "View.MemoryView":1056
36032  *     else:
36033  *         slice_copy(memview, mslice)
36034  *         return mslice             # <<<<<<<<<<<<<<
36035  *
36036  * @cname('__pyx_memoryview_slice_copy')
36037  */
36038     __pyx_r = __pyx_v_mslice;
36039     goto __pyx_L0;
36040   }
36041 
36042   /* "View.MemoryView":1048
36043  *
36044  * @cname('__pyx_memoryview_get_slice_from_memoryview')
36045  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
36046  *                                                    __Pyx_memviewslice *mslice):
36047  *     cdef _memoryviewslice obj
36048  */
36049 
36050   /* function exit code */
36051   __pyx_L1_error:;
36052   __Pyx_XDECREF(__pyx_t_3);
36053   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
36054   __pyx_r = 0;
36055   __pyx_L0:;
36056   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
36057   __Pyx_RefNannyFinishContext();
36058   return __pyx_r;
36059 }
36060 
36061 /* "View.MemoryView":1059
36062  *
36063  * @cname('__pyx_memoryview_slice_copy')
36064  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
36065  *     cdef int dim
36066  *     cdef (Py_ssize_t*) shape, strides, suboffsets
36067  */
36068 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)36069 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
36070   int __pyx_v_dim;
36071   Py_ssize_t *__pyx_v_shape;
36072   Py_ssize_t *__pyx_v_strides;
36073   Py_ssize_t *__pyx_v_suboffsets;
36074   __Pyx_RefNannyDeclarations
36075   Py_ssize_t *__pyx_t_1;
36076   int __pyx_t_2;
36077   int __pyx_t_3;
36078   int __pyx_t_4;
36079   Py_ssize_t __pyx_t_5;
36080   __Pyx_RefNannySetupContext("slice_copy", 0);
36081 
36082   /* "View.MemoryView":1063
36083  *     cdef (Py_ssize_t*) shape, strides, suboffsets
36084  *
36085  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
36086  *     strides = memview.view.strides
36087  *     suboffsets = memview.view.suboffsets
36088  */
36089   __pyx_t_1 = __pyx_v_memview->view.shape;
36090   __pyx_v_shape = __pyx_t_1;
36091 
36092   /* "View.MemoryView":1064
36093  *
36094  *     shape = memview.view.shape
36095  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
36096  *     suboffsets = memview.view.suboffsets
36097  *
36098  */
36099   __pyx_t_1 = __pyx_v_memview->view.strides;
36100   __pyx_v_strides = __pyx_t_1;
36101 
36102   /* "View.MemoryView":1065
36103  *     shape = memview.view.shape
36104  *     strides = memview.view.strides
36105  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
36106  *
36107  *     dst.memview = <__pyx_memoryview *> memview
36108  */
36109   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
36110   __pyx_v_suboffsets = __pyx_t_1;
36111 
36112   /* "View.MemoryView":1067
36113  *     suboffsets = memview.view.suboffsets
36114  *
36115  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
36116  *     dst.data = <char *> memview.view.buf
36117  *
36118  */
36119   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
36120 
36121   /* "View.MemoryView":1068
36122  *
36123  *     dst.memview = <__pyx_memoryview *> memview
36124  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
36125  *
36126  *     for dim in range(memview.view.ndim):
36127  */
36128   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
36129 
36130   /* "View.MemoryView":1070
36131  *     dst.data = <char *> memview.view.buf
36132  *
36133  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
36134  *         dst.shape[dim] = shape[dim]
36135  *         dst.strides[dim] = strides[dim]
36136  */
36137   __pyx_t_2 = __pyx_v_memview->view.ndim;
36138   __pyx_t_3 = __pyx_t_2;
36139   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
36140     __pyx_v_dim = __pyx_t_4;
36141 
36142     /* "View.MemoryView":1071
36143  *
36144  *     for dim in range(memview.view.ndim):
36145  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
36146  *         dst.strides[dim] = strides[dim]
36147  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
36148  */
36149     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
36150 
36151     /* "View.MemoryView":1072
36152  *     for dim in range(memview.view.ndim):
36153  *         dst.shape[dim] = shape[dim]
36154  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
36155  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
36156  *
36157  */
36158     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
36159 
36160     /* "View.MemoryView":1073
36161  *         dst.shape[dim] = shape[dim]
36162  *         dst.strides[dim] = strides[dim]
36163  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
36164  *
36165  * @cname('__pyx_memoryview_copy_object')
36166  */
36167     if ((__pyx_v_suboffsets != 0)) {
36168       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
36169     } else {
36170       __pyx_t_5 = -1L;
36171     }
36172     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
36173   }
36174 
36175   /* "View.MemoryView":1059
36176  *
36177  * @cname('__pyx_memoryview_slice_copy')
36178  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
36179  *     cdef int dim
36180  *     cdef (Py_ssize_t*) shape, strides, suboffsets
36181  */
36182 
36183   /* function exit code */
36184   __Pyx_RefNannyFinishContext();
36185 }
36186 
36187 /* "View.MemoryView":1076
36188  *
36189  * @cname('__pyx_memoryview_copy_object')
36190  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
36191  *     "Create a new memoryview object"
36192  *     cdef __Pyx_memviewslice memviewslice
36193  */
36194 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)36195 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
36196   __Pyx_memviewslice __pyx_v_memviewslice;
36197   PyObject *__pyx_r = NULL;
36198   __Pyx_RefNannyDeclarations
36199   PyObject *__pyx_t_1 = NULL;
36200   __Pyx_RefNannySetupContext("memoryview_copy", 0);
36201 
36202   /* "View.MemoryView":1079
36203  *     "Create a new memoryview object"
36204  *     cdef __Pyx_memviewslice memviewslice
36205  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
36206  *     return memoryview_copy_from_slice(memview, &memviewslice)
36207  *
36208  */
36209   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
36210 
36211   /* "View.MemoryView":1080
36212  *     cdef __Pyx_memviewslice memviewslice
36213  *     slice_copy(memview, &memviewslice)
36214  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
36215  *
36216  * @cname('__pyx_memoryview_copy_object_from_slice')
36217  */
36218   __Pyx_XDECREF(__pyx_r);
36219   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
36220   __Pyx_GOTREF(__pyx_t_1);
36221   __pyx_r = __pyx_t_1;
36222   __pyx_t_1 = 0;
36223   goto __pyx_L0;
36224 
36225   /* "View.MemoryView":1076
36226  *
36227  * @cname('__pyx_memoryview_copy_object')
36228  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
36229  *     "Create a new memoryview object"
36230  *     cdef __Pyx_memviewslice memviewslice
36231  */
36232 
36233   /* function exit code */
36234   __pyx_L1_error:;
36235   __Pyx_XDECREF(__pyx_t_1);
36236   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
36237   __pyx_r = 0;
36238   __pyx_L0:;
36239   __Pyx_XGIVEREF(__pyx_r);
36240   __Pyx_RefNannyFinishContext();
36241   return __pyx_r;
36242 }
36243 
36244 /* "View.MemoryView":1083
36245  *
36246  * @cname('__pyx_memoryview_copy_object_from_slice')
36247  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
36248  *     """
36249  *     Create a new memoryview object from a given memoryview object and slice.
36250  */
36251 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)36252 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
36253   PyObject *(*__pyx_v_to_object_func)(char *);
36254   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
36255   PyObject *__pyx_r = NULL;
36256   __Pyx_RefNannyDeclarations
36257   int __pyx_t_1;
36258   int __pyx_t_2;
36259   PyObject *(*__pyx_t_3)(char *);
36260   int (*__pyx_t_4)(char *, PyObject *);
36261   PyObject *__pyx_t_5 = NULL;
36262   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
36263 
36264   /* "View.MemoryView":1090
36265  *     cdef int (*to_dtype_func)(char *, object) except 0
36266  *
36267  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
36268  *         to_object_func = (<_memoryviewslice> memview).to_object_func
36269  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
36270  */
36271   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
36272   __pyx_t_2 = (__pyx_t_1 != 0);
36273   if (__pyx_t_2) {
36274 
36275     /* "View.MemoryView":1091
36276  *
36277  *     if isinstance(memview, _memoryviewslice):
36278  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
36279  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
36280  *     else:
36281  */
36282     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
36283     __pyx_v_to_object_func = __pyx_t_3;
36284 
36285     /* "View.MemoryView":1092
36286  *     if isinstance(memview, _memoryviewslice):
36287  *         to_object_func = (<_memoryviewslice> memview).to_object_func
36288  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
36289  *     else:
36290  *         to_object_func = NULL
36291  */
36292     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
36293     __pyx_v_to_dtype_func = __pyx_t_4;
36294 
36295     /* "View.MemoryView":1090
36296  *     cdef int (*to_dtype_func)(char *, object) except 0
36297  *
36298  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
36299  *         to_object_func = (<_memoryviewslice> memview).to_object_func
36300  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
36301  */
36302     goto __pyx_L3;
36303   }
36304 
36305   /* "View.MemoryView":1094
36306  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
36307  *     else:
36308  *         to_object_func = NULL             # <<<<<<<<<<<<<<
36309  *         to_dtype_func = NULL
36310  *
36311  */
36312   /*else*/ {
36313     __pyx_v_to_object_func = NULL;
36314 
36315     /* "View.MemoryView":1095
36316  *     else:
36317  *         to_object_func = NULL
36318  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
36319  *
36320  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
36321  */
36322     __pyx_v_to_dtype_func = NULL;
36323   }
36324   __pyx_L3:;
36325 
36326   /* "View.MemoryView":1097
36327  *         to_dtype_func = NULL
36328  *
36329  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
36330  *                                 to_object_func, to_dtype_func,
36331  *                                 memview.dtype_is_object)
36332  */
36333   __Pyx_XDECREF(__pyx_r);
36334 
36335   /* "View.MemoryView":1099
36336  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
36337  *                                 to_object_func, to_dtype_func,
36338  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
36339  *
36340  *
36341  */
36342   __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1097, __pyx_L1_error)
36343   __Pyx_GOTREF(__pyx_t_5);
36344   __pyx_r = __pyx_t_5;
36345   __pyx_t_5 = 0;
36346   goto __pyx_L0;
36347 
36348   /* "View.MemoryView":1083
36349  *
36350  * @cname('__pyx_memoryview_copy_object_from_slice')
36351  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
36352  *     """
36353  *     Create a new memoryview object from a given memoryview object and slice.
36354  */
36355 
36356   /* function exit code */
36357   __pyx_L1_error:;
36358   __Pyx_XDECREF(__pyx_t_5);
36359   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
36360   __pyx_r = 0;
36361   __pyx_L0:;
36362   __Pyx_XGIVEREF(__pyx_r);
36363   __Pyx_RefNannyFinishContext();
36364   return __pyx_r;
36365 }
36366 
36367 /* "View.MemoryView":1105
36368  *
36369  *
36370  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
36371  *     if arg < 0:
36372  *         return -arg
36373  */
36374 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)36375 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
36376   Py_ssize_t __pyx_r;
36377   int __pyx_t_1;
36378 
36379   /* "View.MemoryView":1106
36380  *
36381  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
36382  *     if arg < 0:             # <<<<<<<<<<<<<<
36383  *         return -arg
36384  *     else:
36385  */
36386   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
36387   if (__pyx_t_1) {
36388 
36389     /* "View.MemoryView":1107
36390  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
36391  *     if arg < 0:
36392  *         return -arg             # <<<<<<<<<<<<<<
36393  *     else:
36394  *         return arg
36395  */
36396     __pyx_r = (-__pyx_v_arg);
36397     goto __pyx_L0;
36398 
36399     /* "View.MemoryView":1106
36400  *
36401  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
36402  *     if arg < 0:             # <<<<<<<<<<<<<<
36403  *         return -arg
36404  *     else:
36405  */
36406   }
36407 
36408   /* "View.MemoryView":1109
36409  *         return -arg
36410  *     else:
36411  *         return arg             # <<<<<<<<<<<<<<
36412  *
36413  * @cname('__pyx_get_best_slice_order')
36414  */
36415   /*else*/ {
36416     __pyx_r = __pyx_v_arg;
36417     goto __pyx_L0;
36418   }
36419 
36420   /* "View.MemoryView":1105
36421  *
36422  *
36423  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
36424  *     if arg < 0:
36425  *         return -arg
36426  */
36427 
36428   /* function exit code */
36429   __pyx_L0:;
36430   return __pyx_r;
36431 }
36432 
36433 /* "View.MemoryView":1112
36434  *
36435  * @cname('__pyx_get_best_slice_order')
36436  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
36437  *     """
36438  *     Figure out the best memory access order for a given slice.
36439  */
36440 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)36441 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
36442   int __pyx_v_i;
36443   Py_ssize_t __pyx_v_c_stride;
36444   Py_ssize_t __pyx_v_f_stride;
36445   char __pyx_r;
36446   int __pyx_t_1;
36447   int __pyx_t_2;
36448   int __pyx_t_3;
36449   int __pyx_t_4;
36450 
36451   /* "View.MemoryView":1117
36452  *     """
36453  *     cdef int i
36454  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
36455  *     cdef Py_ssize_t f_stride = 0
36456  *
36457  */
36458   __pyx_v_c_stride = 0;
36459 
36460   /* "View.MemoryView":1118
36461  *     cdef int i
36462  *     cdef Py_ssize_t c_stride = 0
36463  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
36464  *
36465  *     for i in range(ndim - 1, -1, -1):
36466  */
36467   __pyx_v_f_stride = 0;
36468 
36469   /* "View.MemoryView":1120
36470  *     cdef Py_ssize_t f_stride = 0
36471  *
36472  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
36473  *         if mslice.shape[i] > 1:
36474  *             c_stride = mslice.strides[i]
36475  */
36476   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
36477     __pyx_v_i = __pyx_t_1;
36478 
36479     /* "View.MemoryView":1121
36480  *
36481  *     for i in range(ndim - 1, -1, -1):
36482  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
36483  *             c_stride = mslice.strides[i]
36484  *             break
36485  */
36486     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
36487     if (__pyx_t_2) {
36488 
36489       /* "View.MemoryView":1122
36490  *     for i in range(ndim - 1, -1, -1):
36491  *         if mslice.shape[i] > 1:
36492  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
36493  *             break
36494  *
36495  */
36496       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
36497 
36498       /* "View.MemoryView":1123
36499  *         if mslice.shape[i] > 1:
36500  *             c_stride = mslice.strides[i]
36501  *             break             # <<<<<<<<<<<<<<
36502  *
36503  *     for i in range(ndim):
36504  */
36505       goto __pyx_L4_break;
36506 
36507       /* "View.MemoryView":1121
36508  *
36509  *     for i in range(ndim - 1, -1, -1):
36510  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
36511  *             c_stride = mslice.strides[i]
36512  *             break
36513  */
36514     }
36515   }
36516   __pyx_L4_break:;
36517 
36518   /* "View.MemoryView":1125
36519  *             break
36520  *
36521  *     for i in range(ndim):             # <<<<<<<<<<<<<<
36522  *         if mslice.shape[i] > 1:
36523  *             f_stride = mslice.strides[i]
36524  */
36525   __pyx_t_1 = __pyx_v_ndim;
36526   __pyx_t_3 = __pyx_t_1;
36527   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
36528     __pyx_v_i = __pyx_t_4;
36529 
36530     /* "View.MemoryView":1126
36531  *
36532  *     for i in range(ndim):
36533  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
36534  *             f_stride = mslice.strides[i]
36535  *             break
36536  */
36537     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
36538     if (__pyx_t_2) {
36539 
36540       /* "View.MemoryView":1127
36541  *     for i in range(ndim):
36542  *         if mslice.shape[i] > 1:
36543  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
36544  *             break
36545  *
36546  */
36547       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
36548 
36549       /* "View.MemoryView":1128
36550  *         if mslice.shape[i] > 1:
36551  *             f_stride = mslice.strides[i]
36552  *             break             # <<<<<<<<<<<<<<
36553  *
36554  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
36555  */
36556       goto __pyx_L7_break;
36557 
36558       /* "View.MemoryView":1126
36559  *
36560  *     for i in range(ndim):
36561  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
36562  *             f_stride = mslice.strides[i]
36563  *             break
36564  */
36565     }
36566   }
36567   __pyx_L7_break:;
36568 
36569   /* "View.MemoryView":1130
36570  *             break
36571  *
36572  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
36573  *         return 'C'
36574  *     else:
36575  */
36576   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
36577   if (__pyx_t_2) {
36578 
36579     /* "View.MemoryView":1131
36580  *
36581  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
36582  *         return 'C'             # <<<<<<<<<<<<<<
36583  *     else:
36584  *         return 'F'
36585  */
36586     __pyx_r = 'C';
36587     goto __pyx_L0;
36588 
36589     /* "View.MemoryView":1130
36590  *             break
36591  *
36592  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
36593  *         return 'C'
36594  *     else:
36595  */
36596   }
36597 
36598   /* "View.MemoryView":1133
36599  *         return 'C'
36600  *     else:
36601  *         return 'F'             # <<<<<<<<<<<<<<
36602  *
36603  * @cython.cdivision(True)
36604  */
36605   /*else*/ {
36606     __pyx_r = 'F';
36607     goto __pyx_L0;
36608   }
36609 
36610   /* "View.MemoryView":1112
36611  *
36612  * @cname('__pyx_get_best_slice_order')
36613  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
36614  *     """
36615  *     Figure out the best memory access order for a given slice.
36616  */
36617 
36618   /* function exit code */
36619   __pyx_L0:;
36620   return __pyx_r;
36621 }
36622 
36623 /* "View.MemoryView":1136
36624  *
36625  * @cython.cdivision(True)
36626  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
36627  *                                    char *dst_data, Py_ssize_t *dst_strides,
36628  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
36629  */
36630 
_copy_strided_to_strided(char * __pyx_v_src_data,Py_ssize_t * __pyx_v_src_strides,char * __pyx_v_dst_data,Py_ssize_t * __pyx_v_dst_strides,Py_ssize_t * __pyx_v_src_shape,Py_ssize_t * __pyx_v_dst_shape,int __pyx_v_ndim,size_t __pyx_v_itemsize)36631 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
36632   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
36633   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
36634   Py_ssize_t __pyx_v_dst_extent;
36635   Py_ssize_t __pyx_v_src_stride;
36636   Py_ssize_t __pyx_v_dst_stride;
36637   int __pyx_t_1;
36638   int __pyx_t_2;
36639   int __pyx_t_3;
36640   Py_ssize_t __pyx_t_4;
36641   Py_ssize_t __pyx_t_5;
36642   Py_ssize_t __pyx_t_6;
36643 
36644   /* "View.MemoryView":1143
36645  *
36646  *     cdef Py_ssize_t i
36647  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
36648  *     cdef Py_ssize_t dst_extent = dst_shape[0]
36649  *     cdef Py_ssize_t src_stride = src_strides[0]
36650  */
36651   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
36652 
36653   /* "View.MemoryView":1144
36654  *     cdef Py_ssize_t i
36655  *     cdef Py_ssize_t src_extent = src_shape[0]
36656  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
36657  *     cdef Py_ssize_t src_stride = src_strides[0]
36658  *     cdef Py_ssize_t dst_stride = dst_strides[0]
36659  */
36660   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
36661 
36662   /* "View.MemoryView":1145
36663  *     cdef Py_ssize_t src_extent = src_shape[0]
36664  *     cdef Py_ssize_t dst_extent = dst_shape[0]
36665  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
36666  *     cdef Py_ssize_t dst_stride = dst_strides[0]
36667  *
36668  */
36669   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
36670 
36671   /* "View.MemoryView":1146
36672  *     cdef Py_ssize_t dst_extent = dst_shape[0]
36673  *     cdef Py_ssize_t src_stride = src_strides[0]
36674  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
36675  *
36676  *     if ndim == 1:
36677  */
36678   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
36679 
36680   /* "View.MemoryView":1148
36681  *     cdef Py_ssize_t dst_stride = dst_strides[0]
36682  *
36683  *     if ndim == 1:             # <<<<<<<<<<<<<<
36684  *        if (src_stride > 0 and dst_stride > 0 and
36685  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36686  */
36687   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
36688   if (__pyx_t_1) {
36689 
36690     /* "View.MemoryView":1149
36691  *
36692  *     if ndim == 1:
36693  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
36694  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36695  *            memcpy(dst_data, src_data, itemsize * dst_extent)
36696  */
36697     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
36698     if (__pyx_t_2) {
36699     } else {
36700       __pyx_t_1 = __pyx_t_2;
36701       goto __pyx_L5_bool_binop_done;
36702     }
36703     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
36704     if (__pyx_t_2) {
36705     } else {
36706       __pyx_t_1 = __pyx_t_2;
36707       goto __pyx_L5_bool_binop_done;
36708     }
36709 
36710     /* "View.MemoryView":1150
36711  *     if ndim == 1:
36712  *        if (src_stride > 0 and dst_stride > 0 and
36713  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
36714  *            memcpy(dst_data, src_data, itemsize * dst_extent)
36715  *        else:
36716  */
36717     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
36718     if (__pyx_t_2) {
36719       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
36720     }
36721     __pyx_t_3 = (__pyx_t_2 != 0);
36722     __pyx_t_1 = __pyx_t_3;
36723     __pyx_L5_bool_binop_done:;
36724 
36725     /* "View.MemoryView":1149
36726  *
36727  *     if ndim == 1:
36728  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
36729  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36730  *            memcpy(dst_data, src_data, itemsize * dst_extent)
36731  */
36732     if (__pyx_t_1) {
36733 
36734       /* "View.MemoryView":1151
36735  *        if (src_stride > 0 and dst_stride > 0 and
36736  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36737  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
36738  *        else:
36739  *            for i in range(dst_extent):
36740  */
36741       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
36742 
36743       /* "View.MemoryView":1149
36744  *
36745  *     if ndim == 1:
36746  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
36747  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36748  *            memcpy(dst_data, src_data, itemsize * dst_extent)
36749  */
36750       goto __pyx_L4;
36751     }
36752 
36753     /* "View.MemoryView":1153
36754  *            memcpy(dst_data, src_data, itemsize * dst_extent)
36755  *        else:
36756  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
36757  *                memcpy(dst_data, src_data, itemsize)
36758  *                src_data += src_stride
36759  */
36760     /*else*/ {
36761       __pyx_t_4 = __pyx_v_dst_extent;
36762       __pyx_t_5 = __pyx_t_4;
36763       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
36764         __pyx_v_i = __pyx_t_6;
36765 
36766         /* "View.MemoryView":1154
36767  *        else:
36768  *            for i in range(dst_extent):
36769  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
36770  *                src_data += src_stride
36771  *                dst_data += dst_stride
36772  */
36773         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
36774 
36775         /* "View.MemoryView":1155
36776  *            for i in range(dst_extent):
36777  *                memcpy(dst_data, src_data, itemsize)
36778  *                src_data += src_stride             # <<<<<<<<<<<<<<
36779  *                dst_data += dst_stride
36780  *     else:
36781  */
36782         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
36783 
36784         /* "View.MemoryView":1156
36785  *                memcpy(dst_data, src_data, itemsize)
36786  *                src_data += src_stride
36787  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
36788  *     else:
36789  *         for i in range(dst_extent):
36790  */
36791         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
36792       }
36793     }
36794     __pyx_L4:;
36795 
36796     /* "View.MemoryView":1148
36797  *     cdef Py_ssize_t dst_stride = dst_strides[0]
36798  *
36799  *     if ndim == 1:             # <<<<<<<<<<<<<<
36800  *        if (src_stride > 0 and dst_stride > 0 and
36801  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
36802  */
36803     goto __pyx_L3;
36804   }
36805 
36806   /* "View.MemoryView":1158
36807  *                dst_data += dst_stride
36808  *     else:
36809  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
36810  *             _copy_strided_to_strided(src_data, src_strides + 1,
36811  *                                      dst_data, dst_strides + 1,
36812  */
36813   /*else*/ {
36814     __pyx_t_4 = __pyx_v_dst_extent;
36815     __pyx_t_5 = __pyx_t_4;
36816     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
36817       __pyx_v_i = __pyx_t_6;
36818 
36819       /* "View.MemoryView":1159
36820  *     else:
36821  *         for i in range(dst_extent):
36822  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
36823  *                                      dst_data, dst_strides + 1,
36824  *                                      src_shape + 1, dst_shape + 1,
36825  */
36826       _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
36827 
36828       /* "View.MemoryView":1163
36829  *                                      src_shape + 1, dst_shape + 1,
36830  *                                      ndim - 1, itemsize)
36831  *             src_data += src_stride             # <<<<<<<<<<<<<<
36832  *             dst_data += dst_stride
36833  *
36834  */
36835       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
36836 
36837       /* "View.MemoryView":1164
36838  *                                      ndim - 1, itemsize)
36839  *             src_data += src_stride
36840  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
36841  *
36842  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
36843  */
36844       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
36845     }
36846   }
36847   __pyx_L3:;
36848 
36849   /* "View.MemoryView":1136
36850  *
36851  * @cython.cdivision(True)
36852  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
36853  *                                    char *dst_data, Py_ssize_t *dst_strides,
36854  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
36855  */
36856 
36857   /* function exit code */
36858 }
36859 
36860 /* "View.MemoryView":1166
36861  *             dst_data += dst_stride
36862  *
36863  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
36864  *                                   __Pyx_memviewslice *dst,
36865  *                                   int ndim, size_t itemsize) nogil:
36866  */
36867 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)36868 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
36869 
36870   /* "View.MemoryView":1169
36871  *                                   __Pyx_memviewslice *dst,
36872  *                                   int ndim, size_t itemsize) nogil:
36873  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
36874  *                              src.shape, dst.shape, ndim, itemsize)
36875  *
36876  */
36877   _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
36878 
36879   /* "View.MemoryView":1166
36880  *             dst_data += dst_stride
36881  *
36882  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
36883  *                                   __Pyx_memviewslice *dst,
36884  *                                   int ndim, size_t itemsize) nogil:
36885  */
36886 
36887   /* function exit code */
36888 }
36889 
36890 /* "View.MemoryView":1173
36891  *
36892  * @cname('__pyx_memoryview_slice_get_size')
36893  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
36894  *     "Return the size of the memory occupied by the slice in number of bytes"
36895  *     cdef int i
36896  */
36897 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)36898 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
36899   int __pyx_v_i;
36900   Py_ssize_t __pyx_v_size;
36901   Py_ssize_t __pyx_r;
36902   Py_ssize_t __pyx_t_1;
36903   int __pyx_t_2;
36904   int __pyx_t_3;
36905   int __pyx_t_4;
36906 
36907   /* "View.MemoryView":1176
36908  *     "Return the size of the memory occupied by the slice in number of bytes"
36909  *     cdef int i
36910  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
36911  *
36912  *     for i in range(ndim):
36913  */
36914   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
36915   __pyx_v_size = __pyx_t_1;
36916 
36917   /* "View.MemoryView":1178
36918  *     cdef Py_ssize_t size = src.memview.view.itemsize
36919  *
36920  *     for i in range(ndim):             # <<<<<<<<<<<<<<
36921  *         size *= src.shape[i]
36922  *
36923  */
36924   __pyx_t_2 = __pyx_v_ndim;
36925   __pyx_t_3 = __pyx_t_2;
36926   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
36927     __pyx_v_i = __pyx_t_4;
36928 
36929     /* "View.MemoryView":1179
36930  *
36931  *     for i in range(ndim):
36932  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
36933  *
36934  *     return size
36935  */
36936     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
36937   }
36938 
36939   /* "View.MemoryView":1181
36940  *         size *= src.shape[i]
36941  *
36942  *     return size             # <<<<<<<<<<<<<<
36943  *
36944  * @cname('__pyx_fill_contig_strides_array')
36945  */
36946   __pyx_r = __pyx_v_size;
36947   goto __pyx_L0;
36948 
36949   /* "View.MemoryView":1173
36950  *
36951  * @cname('__pyx_memoryview_slice_get_size')
36952  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
36953  *     "Return the size of the memory occupied by the slice in number of bytes"
36954  *     cdef int i
36955  */
36956 
36957   /* function exit code */
36958   __pyx_L0:;
36959   return __pyx_r;
36960 }
36961 
36962 /* "View.MemoryView":1184
36963  *
36964  * @cname('__pyx_fill_contig_strides_array')
36965  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
36966  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
36967  *                 int ndim, char order) nogil:
36968  */
36969 
__pyx_fill_contig_strides_array(Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,Py_ssize_t __pyx_v_stride,int __pyx_v_ndim,char __pyx_v_order)36970 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
36971   int __pyx_v_idx;
36972   Py_ssize_t __pyx_r;
36973   int __pyx_t_1;
36974   int __pyx_t_2;
36975   int __pyx_t_3;
36976   int __pyx_t_4;
36977 
36978   /* "View.MemoryView":1193
36979  *     cdef int idx
36980  *
36981  *     if order == 'F':             # <<<<<<<<<<<<<<
36982  *         for idx in range(ndim):
36983  *             strides[idx] = stride
36984  */
36985   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
36986   if (__pyx_t_1) {
36987 
36988     /* "View.MemoryView":1194
36989  *
36990  *     if order == 'F':
36991  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
36992  *             strides[idx] = stride
36993  *             stride = stride * shape[idx]
36994  */
36995     __pyx_t_2 = __pyx_v_ndim;
36996     __pyx_t_3 = __pyx_t_2;
36997     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
36998       __pyx_v_idx = __pyx_t_4;
36999 
37000       /* "View.MemoryView":1195
37001  *     if order == 'F':
37002  *         for idx in range(ndim):
37003  *             strides[idx] = stride             # <<<<<<<<<<<<<<
37004  *             stride = stride * shape[idx]
37005  *     else:
37006  */
37007       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
37008 
37009       /* "View.MemoryView":1196
37010  *         for idx in range(ndim):
37011  *             strides[idx] = stride
37012  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
37013  *     else:
37014  *         for idx in range(ndim - 1, -1, -1):
37015  */
37016       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
37017     }
37018 
37019     /* "View.MemoryView":1193
37020  *     cdef int idx
37021  *
37022  *     if order == 'F':             # <<<<<<<<<<<<<<
37023  *         for idx in range(ndim):
37024  *             strides[idx] = stride
37025  */
37026     goto __pyx_L3;
37027   }
37028 
37029   /* "View.MemoryView":1198
37030  *             stride = stride * shape[idx]
37031  *     else:
37032  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
37033  *             strides[idx] = stride
37034  *             stride = stride * shape[idx]
37035  */
37036   /*else*/ {
37037     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
37038       __pyx_v_idx = __pyx_t_2;
37039 
37040       /* "View.MemoryView":1199
37041  *     else:
37042  *         for idx in range(ndim - 1, -1, -1):
37043  *             strides[idx] = stride             # <<<<<<<<<<<<<<
37044  *             stride = stride * shape[idx]
37045  *
37046  */
37047       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
37048 
37049       /* "View.MemoryView":1200
37050  *         for idx in range(ndim - 1, -1, -1):
37051  *             strides[idx] = stride
37052  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
37053  *
37054  *     return stride
37055  */
37056       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
37057     }
37058   }
37059   __pyx_L3:;
37060 
37061   /* "View.MemoryView":1202
37062  *             stride = stride * shape[idx]
37063  *
37064  *     return stride             # <<<<<<<<<<<<<<
37065  *
37066  * @cname('__pyx_memoryview_copy_data_to_temp')
37067  */
37068   __pyx_r = __pyx_v_stride;
37069   goto __pyx_L0;
37070 
37071   /* "View.MemoryView":1184
37072  *
37073  * @cname('__pyx_fill_contig_strides_array')
37074  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
37075  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
37076  *                 int ndim, char order) nogil:
37077  */
37078 
37079   /* function exit code */
37080   __pyx_L0:;
37081   return __pyx_r;
37082 }
37083 
37084 /* "View.MemoryView":1205
37085  *
37086  * @cname('__pyx_memoryview_copy_data_to_temp')
37087  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
37088  *                              __Pyx_memviewslice *tmpslice,
37089  *                              char order,
37090  */
37091 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)37092 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
37093   int __pyx_v_i;
37094   void *__pyx_v_result;
37095   size_t __pyx_v_itemsize;
37096   size_t __pyx_v_size;
37097   void *__pyx_r;
37098   Py_ssize_t __pyx_t_1;
37099   int __pyx_t_2;
37100   int __pyx_t_3;
37101   struct __pyx_memoryview_obj *__pyx_t_4;
37102   int __pyx_t_5;
37103   int __pyx_t_6;
37104 
37105   /* "View.MemoryView":1216
37106  *     cdef void *result
37107  *
37108  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
37109  *     cdef size_t size = slice_get_size(src, ndim)
37110  *
37111  */
37112   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
37113   __pyx_v_itemsize = __pyx_t_1;
37114 
37115   /* "View.MemoryView":1217
37116  *
37117  *     cdef size_t itemsize = src.memview.view.itemsize
37118  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
37119  *
37120  *     result = malloc(size)
37121  */
37122   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
37123 
37124   /* "View.MemoryView":1219
37125  *     cdef size_t size = slice_get_size(src, ndim)
37126  *
37127  *     result = malloc(size)             # <<<<<<<<<<<<<<
37128  *     if not result:
37129  *         _err(MemoryError, NULL)
37130  */
37131   __pyx_v_result = malloc(__pyx_v_size);
37132 
37133   /* "View.MemoryView":1220
37134  *
37135  *     result = malloc(size)
37136  *     if not result:             # <<<<<<<<<<<<<<
37137  *         _err(MemoryError, NULL)
37138  *
37139  */
37140   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
37141   if (__pyx_t_2) {
37142 
37143     /* "View.MemoryView":1221
37144  *     result = malloc(size)
37145  *     if not result:
37146  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
37147  *
37148  *
37149  */
37150     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
37151 
37152     /* "View.MemoryView":1220
37153  *
37154  *     result = malloc(size)
37155  *     if not result:             # <<<<<<<<<<<<<<
37156  *         _err(MemoryError, NULL)
37157  *
37158  */
37159   }
37160 
37161   /* "View.MemoryView":1224
37162  *
37163  *
37164  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
37165  *     tmpslice.memview = src.memview
37166  *     for i in range(ndim):
37167  */
37168   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
37169 
37170   /* "View.MemoryView":1225
37171  *
37172  *     tmpslice.data = <char *> result
37173  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
37174  *     for i in range(ndim):
37175  *         tmpslice.shape[i] = src.shape[i]
37176  */
37177   __pyx_t_4 = __pyx_v_src->memview;
37178   __pyx_v_tmpslice->memview = __pyx_t_4;
37179 
37180   /* "View.MemoryView":1226
37181  *     tmpslice.data = <char *> result
37182  *     tmpslice.memview = src.memview
37183  *     for i in range(ndim):             # <<<<<<<<<<<<<<
37184  *         tmpslice.shape[i] = src.shape[i]
37185  *         tmpslice.suboffsets[i] = -1
37186  */
37187   __pyx_t_3 = __pyx_v_ndim;
37188   __pyx_t_5 = __pyx_t_3;
37189   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
37190     __pyx_v_i = __pyx_t_6;
37191 
37192     /* "View.MemoryView":1227
37193  *     tmpslice.memview = src.memview
37194  *     for i in range(ndim):
37195  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
37196  *         tmpslice.suboffsets[i] = -1
37197  *
37198  */
37199     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
37200 
37201     /* "View.MemoryView":1228
37202  *     for i in range(ndim):
37203  *         tmpslice.shape[i] = src.shape[i]
37204  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
37205  *
37206  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
37207  */
37208     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
37209   }
37210 
37211   /* "View.MemoryView":1230
37212  *         tmpslice.suboffsets[i] = -1
37213  *
37214  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
37215  *                               ndim, order)
37216  *
37217  */
37218   (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
37219 
37220   /* "View.MemoryView":1234
37221  *
37222  *
37223  *     for i in range(ndim):             # <<<<<<<<<<<<<<
37224  *         if tmpslice.shape[i] == 1:
37225  *             tmpslice.strides[i] = 0
37226  */
37227   __pyx_t_3 = __pyx_v_ndim;
37228   __pyx_t_5 = __pyx_t_3;
37229   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
37230     __pyx_v_i = __pyx_t_6;
37231 
37232     /* "View.MemoryView":1235
37233  *
37234  *     for i in range(ndim):
37235  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
37236  *             tmpslice.strides[i] = 0
37237  *
37238  */
37239     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
37240     if (__pyx_t_2) {
37241 
37242       /* "View.MemoryView":1236
37243  *     for i in range(ndim):
37244  *         if tmpslice.shape[i] == 1:
37245  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
37246  *
37247  *     if slice_is_contig(src[0], order, ndim):
37248  */
37249       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
37250 
37251       /* "View.MemoryView":1235
37252  *
37253  *     for i in range(ndim):
37254  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
37255  *             tmpslice.strides[i] = 0
37256  *
37257  */
37258     }
37259   }
37260 
37261   /* "View.MemoryView":1238
37262  *             tmpslice.strides[i] = 0
37263  *
37264  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
37265  *         memcpy(result, src.data, size)
37266  *     else:
37267  */
37268   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
37269   if (__pyx_t_2) {
37270 
37271     /* "View.MemoryView":1239
37272  *
37273  *     if slice_is_contig(src[0], order, ndim):
37274  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
37275  *     else:
37276  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
37277  */
37278     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
37279 
37280     /* "View.MemoryView":1238
37281  *             tmpslice.strides[i] = 0
37282  *
37283  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
37284  *         memcpy(result, src.data, size)
37285  *     else:
37286  */
37287     goto __pyx_L9;
37288   }
37289 
37290   /* "View.MemoryView":1241
37291  *         memcpy(result, src.data, size)
37292  *     else:
37293  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
37294  *
37295  *     return result
37296  */
37297   /*else*/ {
37298     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
37299   }
37300   __pyx_L9:;
37301 
37302   /* "View.MemoryView":1243
37303  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
37304  *
37305  *     return result             # <<<<<<<<<<<<<<
37306  *
37307  *
37308  */
37309   __pyx_r = __pyx_v_result;
37310   goto __pyx_L0;
37311 
37312   /* "View.MemoryView":1205
37313  *
37314  * @cname('__pyx_memoryview_copy_data_to_temp')
37315  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
37316  *                              __Pyx_memviewslice *tmpslice,
37317  *                              char order,
37318  */
37319 
37320   /* function exit code */
37321   __pyx_L1_error:;
37322   {
37323     #ifdef WITH_THREAD
37324     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
37325     #endif
37326     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
37327     #ifdef WITH_THREAD
37328     __Pyx_PyGILState_Release(__pyx_gilstate_save);
37329     #endif
37330   }
37331   __pyx_r = NULL;
37332   __pyx_L0:;
37333   return __pyx_r;
37334 }
37335 
37336 /* "View.MemoryView":1248
37337  *
37338  * @cname('__pyx_memoryview_err_extents')
37339  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
37340  *                              Py_ssize_t extent2) except -1 with gil:
37341  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
37342  */
37343 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)37344 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
37345   int __pyx_r;
37346   __Pyx_RefNannyDeclarations
37347   PyObject *__pyx_t_1 = NULL;
37348   PyObject *__pyx_t_2 = NULL;
37349   PyObject *__pyx_t_3 = NULL;
37350   PyObject *__pyx_t_4 = NULL;
37351   #ifdef WITH_THREAD
37352   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
37353   #endif
37354   __Pyx_RefNannySetupContext("_err_extents", 0);
37355 
37356   /* "View.MemoryView":1251
37357  *                              Py_ssize_t extent2) except -1 with gil:
37358  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
37359  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
37360  *
37361  * @cname('__pyx_memoryview_err_dim')
37362  */
37363   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
37364   __Pyx_GOTREF(__pyx_t_1);
37365   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
37366   __Pyx_GOTREF(__pyx_t_2);
37367   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
37368   __Pyx_GOTREF(__pyx_t_3);
37369   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
37370   __Pyx_GOTREF(__pyx_t_4);
37371   __Pyx_GIVEREF(__pyx_t_1);
37372   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
37373   __Pyx_GIVEREF(__pyx_t_2);
37374   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
37375   __Pyx_GIVEREF(__pyx_t_3);
37376   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
37377   __pyx_t_1 = 0;
37378   __pyx_t_2 = 0;
37379   __pyx_t_3 = 0;
37380 
37381   /* "View.MemoryView":1250
37382  * cdef int _err_extents(int i, Py_ssize_t extent1,
37383  *                              Py_ssize_t extent2) except -1 with gil:
37384  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
37385  *                                                         (i, extent1, extent2))
37386  *
37387  */
37388   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
37389   __Pyx_GOTREF(__pyx_t_3);
37390   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37391   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
37392   __Pyx_GOTREF(__pyx_t_4);
37393   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37394   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
37395   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37396   __PYX_ERR(1, 1250, __pyx_L1_error)
37397 
37398   /* "View.MemoryView":1248
37399  *
37400  * @cname('__pyx_memoryview_err_extents')
37401  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
37402  *                              Py_ssize_t extent2) except -1 with gil:
37403  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
37404  */
37405 
37406   /* function exit code */
37407   __pyx_L1_error:;
37408   __Pyx_XDECREF(__pyx_t_1);
37409   __Pyx_XDECREF(__pyx_t_2);
37410   __Pyx_XDECREF(__pyx_t_3);
37411   __Pyx_XDECREF(__pyx_t_4);
37412   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
37413   __pyx_r = -1;
37414   __Pyx_RefNannyFinishContext();
37415   #ifdef WITH_THREAD
37416   __Pyx_PyGILState_Release(__pyx_gilstate_save);
37417   #endif
37418   return __pyx_r;
37419 }
37420 
37421 /* "View.MemoryView":1254
37422  *
37423  * @cname('__pyx_memoryview_err_dim')
37424  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
37425  *     raise error(msg.decode('ascii') % dim)
37426  *
37427  */
37428 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)37429 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
37430   int __pyx_r;
37431   __Pyx_RefNannyDeclarations
37432   PyObject *__pyx_t_1 = NULL;
37433   PyObject *__pyx_t_2 = NULL;
37434   PyObject *__pyx_t_3 = NULL;
37435   PyObject *__pyx_t_4 = NULL;
37436   #ifdef WITH_THREAD
37437   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
37438   #endif
37439   __Pyx_RefNannySetupContext("_err_dim", 0);
37440   __Pyx_INCREF(__pyx_v_error);
37441 
37442   /* "View.MemoryView":1255
37443  * @cname('__pyx_memoryview_err_dim')
37444  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
37445  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
37446  *
37447  * @cname('__pyx_memoryview_err')
37448  */
37449   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1255, __pyx_L1_error)
37450   __Pyx_GOTREF(__pyx_t_2);
37451   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
37452   __Pyx_GOTREF(__pyx_t_3);
37453   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
37454   __Pyx_GOTREF(__pyx_t_4);
37455   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37456   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37457   __Pyx_INCREF(__pyx_v_error);
37458   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
37459   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
37460     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
37461     if (likely(__pyx_t_2)) {
37462       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
37463       __Pyx_INCREF(__pyx_t_2);
37464       __Pyx_INCREF(function);
37465       __Pyx_DECREF_SET(__pyx_t_3, function);
37466     }
37467   }
37468   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
37469   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37470   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37471   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
37472   __Pyx_GOTREF(__pyx_t_1);
37473   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37474   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
37475   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37476   __PYX_ERR(1, 1255, __pyx_L1_error)
37477 
37478   /* "View.MemoryView":1254
37479  *
37480  * @cname('__pyx_memoryview_err_dim')
37481  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
37482  *     raise error(msg.decode('ascii') % dim)
37483  *
37484  */
37485 
37486   /* function exit code */
37487   __pyx_L1_error:;
37488   __Pyx_XDECREF(__pyx_t_1);
37489   __Pyx_XDECREF(__pyx_t_2);
37490   __Pyx_XDECREF(__pyx_t_3);
37491   __Pyx_XDECREF(__pyx_t_4);
37492   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
37493   __pyx_r = -1;
37494   __Pyx_XDECREF(__pyx_v_error);
37495   __Pyx_RefNannyFinishContext();
37496   #ifdef WITH_THREAD
37497   __Pyx_PyGILState_Release(__pyx_gilstate_save);
37498   #endif
37499   return __pyx_r;
37500 }
37501 
37502 /* "View.MemoryView":1258
37503  *
37504  * @cname('__pyx_memoryview_err')
37505  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
37506  *     if msg != NULL:
37507  *         raise error(msg.decode('ascii'))
37508  */
37509 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)37510 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
37511   int __pyx_r;
37512   __Pyx_RefNannyDeclarations
37513   int __pyx_t_1;
37514   PyObject *__pyx_t_2 = NULL;
37515   PyObject *__pyx_t_3 = NULL;
37516   PyObject *__pyx_t_4 = NULL;
37517   PyObject *__pyx_t_5 = NULL;
37518   #ifdef WITH_THREAD
37519   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
37520   #endif
37521   __Pyx_RefNannySetupContext("_err", 0);
37522   __Pyx_INCREF(__pyx_v_error);
37523 
37524   /* "View.MemoryView":1259
37525  * @cname('__pyx_memoryview_err')
37526  * cdef int _err(object error, char *msg) except -1 with gil:
37527  *     if msg != NULL:             # <<<<<<<<<<<<<<
37528  *         raise error(msg.decode('ascii'))
37529  *     else:
37530  */
37531   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
37532   if (unlikely(__pyx_t_1)) {
37533 
37534     /* "View.MemoryView":1260
37535  * cdef int _err(object error, char *msg) except -1 with gil:
37536  *     if msg != NULL:
37537  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
37538  *     else:
37539  *         raise error
37540  */
37541     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
37542     __Pyx_GOTREF(__pyx_t_3);
37543     __Pyx_INCREF(__pyx_v_error);
37544     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
37545     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37546       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
37547       if (likely(__pyx_t_5)) {
37548         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
37549         __Pyx_INCREF(__pyx_t_5);
37550         __Pyx_INCREF(function);
37551         __Pyx_DECREF_SET(__pyx_t_4, function);
37552       }
37553     }
37554     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
37555     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
37556     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37557     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
37558     __Pyx_GOTREF(__pyx_t_2);
37559     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37560     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37561     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37562     __PYX_ERR(1, 1260, __pyx_L1_error)
37563 
37564     /* "View.MemoryView":1259
37565  * @cname('__pyx_memoryview_err')
37566  * cdef int _err(object error, char *msg) except -1 with gil:
37567  *     if msg != NULL:             # <<<<<<<<<<<<<<
37568  *         raise error(msg.decode('ascii'))
37569  *     else:
37570  */
37571   }
37572 
37573   /* "View.MemoryView":1262
37574  *         raise error(msg.decode('ascii'))
37575  *     else:
37576  *         raise error             # <<<<<<<<<<<<<<
37577  *
37578  * @cname('__pyx_memoryview_copy_contents')
37579  */
37580   /*else*/ {
37581     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
37582     __PYX_ERR(1, 1262, __pyx_L1_error)
37583   }
37584 
37585   /* "View.MemoryView":1258
37586  *
37587  * @cname('__pyx_memoryview_err')
37588  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
37589  *     if msg != NULL:
37590  *         raise error(msg.decode('ascii'))
37591  */
37592 
37593   /* function exit code */
37594   __pyx_L1_error:;
37595   __Pyx_XDECREF(__pyx_t_2);
37596   __Pyx_XDECREF(__pyx_t_3);
37597   __Pyx_XDECREF(__pyx_t_4);
37598   __Pyx_XDECREF(__pyx_t_5);
37599   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
37600   __pyx_r = -1;
37601   __Pyx_XDECREF(__pyx_v_error);
37602   __Pyx_RefNannyFinishContext();
37603   #ifdef WITH_THREAD
37604   __Pyx_PyGILState_Release(__pyx_gilstate_save);
37605   #endif
37606   return __pyx_r;
37607 }
37608 
37609 /* "View.MemoryView":1265
37610  *
37611  * @cname('__pyx_memoryview_copy_contents')
37612  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
37613  *                                   __Pyx_memviewslice dst,
37614  *                                   int src_ndim, int dst_ndim,
37615  */
37616 
__pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src,__Pyx_memviewslice __pyx_v_dst,int __pyx_v_src_ndim,int __pyx_v_dst_ndim,int __pyx_v_dtype_is_object)37617 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
37618   void *__pyx_v_tmpdata;
37619   size_t __pyx_v_itemsize;
37620   int __pyx_v_i;
37621   char __pyx_v_order;
37622   int __pyx_v_broadcasting;
37623   int __pyx_v_direct_copy;
37624   __Pyx_memviewslice __pyx_v_tmp;
37625   int __pyx_v_ndim;
37626   int __pyx_r;
37627   Py_ssize_t __pyx_t_1;
37628   int __pyx_t_2;
37629   int __pyx_t_3;
37630   int __pyx_t_4;
37631   int __pyx_t_5;
37632   int __pyx_t_6;
37633   void *__pyx_t_7;
37634   int __pyx_t_8;
37635 
37636   /* "View.MemoryView":1273
37637  *     Check for overlapping memory and verify the shapes.
37638  *     """
37639  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
37640  *     cdef size_t itemsize = src.memview.view.itemsize
37641  *     cdef int i
37642  */
37643   __pyx_v_tmpdata = NULL;
37644 
37645   /* "View.MemoryView":1274
37646  *     """
37647  *     cdef void *tmpdata = NULL
37648  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
37649  *     cdef int i
37650  *     cdef char order = get_best_order(&src, src_ndim)
37651  */
37652   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
37653   __pyx_v_itemsize = __pyx_t_1;
37654 
37655   /* "View.MemoryView":1276
37656  *     cdef size_t itemsize = src.memview.view.itemsize
37657  *     cdef int i
37658  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
37659  *     cdef bint broadcasting = False
37660  *     cdef bint direct_copy = False
37661  */
37662   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
37663 
37664   /* "View.MemoryView":1277
37665  *     cdef int i
37666  *     cdef char order = get_best_order(&src, src_ndim)
37667  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
37668  *     cdef bint direct_copy = False
37669  *     cdef __Pyx_memviewslice tmp
37670  */
37671   __pyx_v_broadcasting = 0;
37672 
37673   /* "View.MemoryView":1278
37674  *     cdef char order = get_best_order(&src, src_ndim)
37675  *     cdef bint broadcasting = False
37676  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
37677  *     cdef __Pyx_memviewslice tmp
37678  *
37679  */
37680   __pyx_v_direct_copy = 0;
37681 
37682   /* "View.MemoryView":1281
37683  *     cdef __Pyx_memviewslice tmp
37684  *
37685  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
37686  *         broadcast_leading(&src, src_ndim, dst_ndim)
37687  *     elif dst_ndim < src_ndim:
37688  */
37689   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
37690   if (__pyx_t_2) {
37691 
37692     /* "View.MemoryView":1282
37693  *
37694  *     if src_ndim < dst_ndim:
37695  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
37696  *     elif dst_ndim < src_ndim:
37697  *         broadcast_leading(&dst, dst_ndim, src_ndim)
37698  */
37699     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
37700 
37701     /* "View.MemoryView":1281
37702  *     cdef __Pyx_memviewslice tmp
37703  *
37704  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
37705  *         broadcast_leading(&src, src_ndim, dst_ndim)
37706  *     elif dst_ndim < src_ndim:
37707  */
37708     goto __pyx_L3;
37709   }
37710 
37711   /* "View.MemoryView":1283
37712  *     if src_ndim < dst_ndim:
37713  *         broadcast_leading(&src, src_ndim, dst_ndim)
37714  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
37715  *         broadcast_leading(&dst, dst_ndim, src_ndim)
37716  *
37717  */
37718   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
37719   if (__pyx_t_2) {
37720 
37721     /* "View.MemoryView":1284
37722  *         broadcast_leading(&src, src_ndim, dst_ndim)
37723  *     elif dst_ndim < src_ndim:
37724  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
37725  *
37726  *     cdef int ndim = max(src_ndim, dst_ndim)
37727  */
37728     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
37729 
37730     /* "View.MemoryView":1283
37731  *     if src_ndim < dst_ndim:
37732  *         broadcast_leading(&src, src_ndim, dst_ndim)
37733  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
37734  *         broadcast_leading(&dst, dst_ndim, src_ndim)
37735  *
37736  */
37737   }
37738   __pyx_L3:;
37739 
37740   /* "View.MemoryView":1286
37741  *         broadcast_leading(&dst, dst_ndim, src_ndim)
37742  *
37743  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
37744  *
37745  *     for i in range(ndim):
37746  */
37747   __pyx_t_3 = __pyx_v_dst_ndim;
37748   __pyx_t_4 = __pyx_v_src_ndim;
37749   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
37750     __pyx_t_5 = __pyx_t_3;
37751   } else {
37752     __pyx_t_5 = __pyx_t_4;
37753   }
37754   __pyx_v_ndim = __pyx_t_5;
37755 
37756   /* "View.MemoryView":1288
37757  *     cdef int ndim = max(src_ndim, dst_ndim)
37758  *
37759  *     for i in range(ndim):             # <<<<<<<<<<<<<<
37760  *         if src.shape[i] != dst.shape[i]:
37761  *             if src.shape[i] == 1:
37762  */
37763   __pyx_t_5 = __pyx_v_ndim;
37764   __pyx_t_3 = __pyx_t_5;
37765   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
37766     __pyx_v_i = __pyx_t_4;
37767 
37768     /* "View.MemoryView":1289
37769  *
37770  *     for i in range(ndim):
37771  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
37772  *             if src.shape[i] == 1:
37773  *                 broadcasting = True
37774  */
37775     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
37776     if (__pyx_t_2) {
37777 
37778       /* "View.MemoryView":1290
37779  *     for i in range(ndim):
37780  *         if src.shape[i] != dst.shape[i]:
37781  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
37782  *                 broadcasting = True
37783  *                 src.strides[i] = 0
37784  */
37785       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
37786       if (__pyx_t_2) {
37787 
37788         /* "View.MemoryView":1291
37789  *         if src.shape[i] != dst.shape[i]:
37790  *             if src.shape[i] == 1:
37791  *                 broadcasting = True             # <<<<<<<<<<<<<<
37792  *                 src.strides[i] = 0
37793  *             else:
37794  */
37795         __pyx_v_broadcasting = 1;
37796 
37797         /* "View.MemoryView":1292
37798  *             if src.shape[i] == 1:
37799  *                 broadcasting = True
37800  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
37801  *             else:
37802  *                 _err_extents(i, dst.shape[i], src.shape[i])
37803  */
37804         (__pyx_v_src.strides[__pyx_v_i]) = 0;
37805 
37806         /* "View.MemoryView":1290
37807  *     for i in range(ndim):
37808  *         if src.shape[i] != dst.shape[i]:
37809  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
37810  *                 broadcasting = True
37811  *                 src.strides[i] = 0
37812  */
37813         goto __pyx_L7;
37814       }
37815 
37816       /* "View.MemoryView":1294
37817  *                 src.strides[i] = 0
37818  *             else:
37819  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
37820  *
37821  *         if src.suboffsets[i] >= 0:
37822  */
37823       /*else*/ {
37824         __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
37825       }
37826       __pyx_L7:;
37827 
37828       /* "View.MemoryView":1289
37829  *
37830  *     for i in range(ndim):
37831  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
37832  *             if src.shape[i] == 1:
37833  *                 broadcasting = True
37834  */
37835     }
37836 
37837     /* "View.MemoryView":1296
37838  *                 _err_extents(i, dst.shape[i], src.shape[i])
37839  *
37840  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
37841  *             _err_dim(ValueError, "Dimension %d is not direct", i)
37842  *
37843  */
37844     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
37845     if (__pyx_t_2) {
37846 
37847       /* "View.MemoryView":1297
37848  *
37849  *         if src.suboffsets[i] >= 0:
37850  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
37851  *
37852  *     if slices_overlap(&src, &dst, ndim, itemsize):
37853  */
37854       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
37855 
37856       /* "View.MemoryView":1296
37857  *                 _err_extents(i, dst.shape[i], src.shape[i])
37858  *
37859  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
37860  *             _err_dim(ValueError, "Dimension %d is not direct", i)
37861  *
37862  */
37863     }
37864   }
37865 
37866   /* "View.MemoryView":1299
37867  *             _err_dim(ValueError, "Dimension %d is not direct", i)
37868  *
37869  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
37870  *
37871  *         if not slice_is_contig(src, order, ndim):
37872  */
37873   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
37874   if (__pyx_t_2) {
37875 
37876     /* "View.MemoryView":1301
37877  *     if slices_overlap(&src, &dst, ndim, itemsize):
37878  *
37879  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
37880  *             order = get_best_order(&dst, ndim)
37881  *
37882  */
37883     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
37884     if (__pyx_t_2) {
37885 
37886       /* "View.MemoryView":1302
37887  *
37888  *         if not slice_is_contig(src, order, ndim):
37889  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
37890  *
37891  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
37892  */
37893       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
37894 
37895       /* "View.MemoryView":1301
37896  *     if slices_overlap(&src, &dst, ndim, itemsize):
37897  *
37898  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
37899  *             order = get_best_order(&dst, ndim)
37900  *
37901  */
37902     }
37903 
37904     /* "View.MemoryView":1304
37905  *             order = get_best_order(&dst, ndim)
37906  *
37907  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
37908  *         src = tmp
37909  *
37910  */
37911     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
37912     __pyx_v_tmpdata = __pyx_t_7;
37913 
37914     /* "View.MemoryView":1305
37915  *
37916  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
37917  *         src = tmp             # <<<<<<<<<<<<<<
37918  *
37919  *     if not broadcasting:
37920  */
37921     __pyx_v_src = __pyx_v_tmp;
37922 
37923     /* "View.MemoryView":1299
37924  *             _err_dim(ValueError, "Dimension %d is not direct", i)
37925  *
37926  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
37927  *
37928  *         if not slice_is_contig(src, order, ndim):
37929  */
37930   }
37931 
37932   /* "View.MemoryView":1307
37933  *         src = tmp
37934  *
37935  *     if not broadcasting:             # <<<<<<<<<<<<<<
37936  *
37937  *
37938  */
37939   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
37940   if (__pyx_t_2) {
37941 
37942     /* "View.MemoryView":1310
37943  *
37944  *
37945  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
37946  *             direct_copy = slice_is_contig(dst, 'C', ndim)
37947  *         elif slice_is_contig(src, 'F', ndim):
37948  */
37949     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
37950     if (__pyx_t_2) {
37951 
37952       /* "View.MemoryView":1311
37953  *
37954  *         if slice_is_contig(src, 'C', ndim):
37955  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
37956  *         elif slice_is_contig(src, 'F', ndim):
37957  *             direct_copy = slice_is_contig(dst, 'F', ndim)
37958  */
37959       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
37960 
37961       /* "View.MemoryView":1310
37962  *
37963  *
37964  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
37965  *             direct_copy = slice_is_contig(dst, 'C', ndim)
37966  *         elif slice_is_contig(src, 'F', ndim):
37967  */
37968       goto __pyx_L12;
37969     }
37970 
37971     /* "View.MemoryView":1312
37972  *         if slice_is_contig(src, 'C', ndim):
37973  *             direct_copy = slice_is_contig(dst, 'C', ndim)
37974  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
37975  *             direct_copy = slice_is_contig(dst, 'F', ndim)
37976  *
37977  */
37978     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
37979     if (__pyx_t_2) {
37980 
37981       /* "View.MemoryView":1313
37982  *             direct_copy = slice_is_contig(dst, 'C', ndim)
37983  *         elif slice_is_contig(src, 'F', ndim):
37984  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
37985  *
37986  *         if direct_copy:
37987  */
37988       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
37989 
37990       /* "View.MemoryView":1312
37991  *         if slice_is_contig(src, 'C', ndim):
37992  *             direct_copy = slice_is_contig(dst, 'C', ndim)
37993  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
37994  *             direct_copy = slice_is_contig(dst, 'F', ndim)
37995  *
37996  */
37997     }
37998     __pyx_L12:;
37999 
38000     /* "View.MemoryView":1315
38001  *             direct_copy = slice_is_contig(dst, 'F', ndim)
38002  *
38003  *         if direct_copy:             # <<<<<<<<<<<<<<
38004  *
38005  *             refcount_copying(&dst, dtype_is_object, ndim, False)
38006  */
38007     __pyx_t_2 = (__pyx_v_direct_copy != 0);
38008     if (__pyx_t_2) {
38009 
38010       /* "View.MemoryView":1317
38011  *         if direct_copy:
38012  *
38013  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
38014  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
38015  *             refcount_copying(&dst, dtype_is_object, ndim, True)
38016  */
38017       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
38018 
38019       /* "View.MemoryView":1318
38020  *
38021  *             refcount_copying(&dst, dtype_is_object, ndim, False)
38022  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
38023  *             refcount_copying(&dst, dtype_is_object, ndim, True)
38024  *             free(tmpdata)
38025  */
38026       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
38027 
38028       /* "View.MemoryView":1319
38029  *             refcount_copying(&dst, dtype_is_object, ndim, False)
38030  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
38031  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
38032  *             free(tmpdata)
38033  *             return 0
38034  */
38035       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
38036 
38037       /* "View.MemoryView":1320
38038  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
38039  *             refcount_copying(&dst, dtype_is_object, ndim, True)
38040  *             free(tmpdata)             # <<<<<<<<<<<<<<
38041  *             return 0
38042  *
38043  */
38044       free(__pyx_v_tmpdata);
38045 
38046       /* "View.MemoryView":1321
38047  *             refcount_copying(&dst, dtype_is_object, ndim, True)
38048  *             free(tmpdata)
38049  *             return 0             # <<<<<<<<<<<<<<
38050  *
38051  *     if order == 'F' == get_best_order(&dst, ndim):
38052  */
38053       __pyx_r = 0;
38054       goto __pyx_L0;
38055 
38056       /* "View.MemoryView":1315
38057  *             direct_copy = slice_is_contig(dst, 'F', ndim)
38058  *
38059  *         if direct_copy:             # <<<<<<<<<<<<<<
38060  *
38061  *             refcount_copying(&dst, dtype_is_object, ndim, False)
38062  */
38063     }
38064 
38065     /* "View.MemoryView":1307
38066  *         src = tmp
38067  *
38068  *     if not broadcasting:             # <<<<<<<<<<<<<<
38069  *
38070  *
38071  */
38072   }
38073 
38074   /* "View.MemoryView":1323
38075  *             return 0
38076  *
38077  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
38078  *
38079  *
38080  */
38081   __pyx_t_2 = (__pyx_v_order == 'F');
38082   if (__pyx_t_2) {
38083     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
38084   }
38085   __pyx_t_8 = (__pyx_t_2 != 0);
38086   if (__pyx_t_8) {
38087 
38088     /* "View.MemoryView":1326
38089  *
38090  *
38091  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
38092  *         transpose_memslice(&dst)
38093  *
38094  */
38095     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
38096 
38097     /* "View.MemoryView":1327
38098  *
38099  *         transpose_memslice(&src)
38100  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
38101  *
38102  *     refcount_copying(&dst, dtype_is_object, ndim, False)
38103  */
38104     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
38105 
38106     /* "View.MemoryView":1323
38107  *             return 0
38108  *
38109  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
38110  *
38111  *
38112  */
38113   }
38114 
38115   /* "View.MemoryView":1329
38116  *         transpose_memslice(&dst)
38117  *
38118  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
38119  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
38120  *     refcount_copying(&dst, dtype_is_object, ndim, True)
38121  */
38122   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
38123 
38124   /* "View.MemoryView":1330
38125  *
38126  *     refcount_copying(&dst, dtype_is_object, ndim, False)
38127  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
38128  *     refcount_copying(&dst, dtype_is_object, ndim, True)
38129  *
38130  */
38131   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
38132 
38133   /* "View.MemoryView":1331
38134  *     refcount_copying(&dst, dtype_is_object, ndim, False)
38135  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
38136  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
38137  *
38138  *     free(tmpdata)
38139  */
38140   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
38141 
38142   /* "View.MemoryView":1333
38143  *     refcount_copying(&dst, dtype_is_object, ndim, True)
38144  *
38145  *     free(tmpdata)             # <<<<<<<<<<<<<<
38146  *     return 0
38147  *
38148  */
38149   free(__pyx_v_tmpdata);
38150 
38151   /* "View.MemoryView":1334
38152  *
38153  *     free(tmpdata)
38154  *     return 0             # <<<<<<<<<<<<<<
38155  *
38156  * @cname('__pyx_memoryview_broadcast_leading')
38157  */
38158   __pyx_r = 0;
38159   goto __pyx_L0;
38160 
38161   /* "View.MemoryView":1265
38162  *
38163  * @cname('__pyx_memoryview_copy_contents')
38164  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
38165  *                                   __Pyx_memviewslice dst,
38166  *                                   int src_ndim, int dst_ndim,
38167  */
38168 
38169   /* function exit code */
38170   __pyx_L1_error:;
38171   {
38172     #ifdef WITH_THREAD
38173     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
38174     #endif
38175     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
38176     #ifdef WITH_THREAD
38177     __Pyx_PyGILState_Release(__pyx_gilstate_save);
38178     #endif
38179   }
38180   __pyx_r = -1;
38181   __pyx_L0:;
38182   return __pyx_r;
38183 }
38184 
38185 /* "View.MemoryView":1337
38186  *
38187  * @cname('__pyx_memoryview_broadcast_leading')
38188  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
38189  *                             int ndim,
38190  *                             int ndim_other) nogil:
38191  */
38192 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)38193 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
38194   int __pyx_v_i;
38195   int __pyx_v_offset;
38196   int __pyx_t_1;
38197   int __pyx_t_2;
38198   int __pyx_t_3;
38199 
38200   /* "View.MemoryView":1341
38201  *                             int ndim_other) nogil:
38202  *     cdef int i
38203  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
38204  *
38205  *     for i in range(ndim - 1, -1, -1):
38206  */
38207   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
38208 
38209   /* "View.MemoryView":1343
38210  *     cdef int offset = ndim_other - ndim
38211  *
38212  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
38213  *         mslice.shape[i + offset] = mslice.shape[i]
38214  *         mslice.strides[i + offset] = mslice.strides[i]
38215  */
38216   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
38217     __pyx_v_i = __pyx_t_1;
38218 
38219     /* "View.MemoryView":1344
38220  *
38221  *     for i in range(ndim - 1, -1, -1):
38222  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
38223  *         mslice.strides[i + offset] = mslice.strides[i]
38224  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
38225  */
38226     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
38227 
38228     /* "View.MemoryView":1345
38229  *     for i in range(ndim - 1, -1, -1):
38230  *         mslice.shape[i + offset] = mslice.shape[i]
38231  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
38232  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
38233  *
38234  */
38235     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
38236 
38237     /* "View.MemoryView":1346
38238  *         mslice.shape[i + offset] = mslice.shape[i]
38239  *         mslice.strides[i + offset] = mslice.strides[i]
38240  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
38241  *
38242  *     for i in range(offset):
38243  */
38244     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
38245   }
38246 
38247   /* "View.MemoryView":1348
38248  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
38249  *
38250  *     for i in range(offset):             # <<<<<<<<<<<<<<
38251  *         mslice.shape[i] = 1
38252  *         mslice.strides[i] = mslice.strides[0]
38253  */
38254   __pyx_t_1 = __pyx_v_offset;
38255   __pyx_t_2 = __pyx_t_1;
38256   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
38257     __pyx_v_i = __pyx_t_3;
38258 
38259     /* "View.MemoryView":1349
38260  *
38261  *     for i in range(offset):
38262  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
38263  *         mslice.strides[i] = mslice.strides[0]
38264  *         mslice.suboffsets[i] = -1
38265  */
38266     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
38267 
38268     /* "View.MemoryView":1350
38269  *     for i in range(offset):
38270  *         mslice.shape[i] = 1
38271  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
38272  *         mslice.suboffsets[i] = -1
38273  *
38274  */
38275     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
38276 
38277     /* "View.MemoryView":1351
38278  *         mslice.shape[i] = 1
38279  *         mslice.strides[i] = mslice.strides[0]
38280  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
38281  *
38282  *
38283  */
38284     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
38285   }
38286 
38287   /* "View.MemoryView":1337
38288  *
38289  * @cname('__pyx_memoryview_broadcast_leading')
38290  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
38291  *                             int ndim,
38292  *                             int ndim_other) nogil:
38293  */
38294 
38295   /* function exit code */
38296 }
38297 
38298 /* "View.MemoryView":1359
38299  *
38300  * @cname('__pyx_memoryview_refcount_copying')
38301  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
38302  *                            int ndim, bint inc) nogil:
38303  *
38304  */
38305 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)38306 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
38307   int __pyx_t_1;
38308 
38309   /* "View.MemoryView":1363
38310  *
38311  *
38312  *     if dtype_is_object:             # <<<<<<<<<<<<<<
38313  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
38314  *                                            dst.strides, ndim, inc)
38315  */
38316   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
38317   if (__pyx_t_1) {
38318 
38319     /* "View.MemoryView":1364
38320  *
38321  *     if dtype_is_object:
38322  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
38323  *                                            dst.strides, ndim, inc)
38324  *
38325  */
38326     __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
38327 
38328     /* "View.MemoryView":1363
38329  *
38330  *
38331  *     if dtype_is_object:             # <<<<<<<<<<<<<<
38332  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
38333  *                                            dst.strides, ndim, inc)
38334  */
38335   }
38336 
38337   /* "View.MemoryView":1359
38338  *
38339  * @cname('__pyx_memoryview_refcount_copying')
38340  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
38341  *                            int ndim, bint inc) nogil:
38342  *
38343  */
38344 
38345   /* function exit code */
38346 }
38347 
38348 /* "View.MemoryView":1368
38349  *
38350  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
38351  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38352  *                                              Py_ssize_t *strides, int ndim,
38353  *                                              bint inc) with gil:
38354  */
38355 
__pyx_memoryview_refcount_objects_in_slice_with_gil(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)38356 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
38357   __Pyx_RefNannyDeclarations
38358   #ifdef WITH_THREAD
38359   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
38360   #endif
38361   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
38362 
38363   /* "View.MemoryView":1371
38364  *                                              Py_ssize_t *strides, int ndim,
38365  *                                              bint inc) with gil:
38366  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
38367  *
38368  * @cname('__pyx_memoryview_refcount_objects_in_slice')
38369  */
38370   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
38371 
38372   /* "View.MemoryView":1368
38373  *
38374  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
38375  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38376  *                                              Py_ssize_t *strides, int ndim,
38377  *                                              bint inc) with gil:
38378  */
38379 
38380   /* function exit code */
38381   __Pyx_RefNannyFinishContext();
38382   #ifdef WITH_THREAD
38383   __Pyx_PyGILState_Release(__pyx_gilstate_save);
38384   #endif
38385 }
38386 
38387 /* "View.MemoryView":1374
38388  *
38389  * @cname('__pyx_memoryview_refcount_objects_in_slice')
38390  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38391  *                                     Py_ssize_t *strides, int ndim, bint inc):
38392  *     cdef Py_ssize_t i
38393  */
38394 
__pyx_memoryview_refcount_objects_in_slice(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,int __pyx_v_inc)38395 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
38396   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
38397   __Pyx_RefNannyDeclarations
38398   Py_ssize_t __pyx_t_1;
38399   Py_ssize_t __pyx_t_2;
38400   Py_ssize_t __pyx_t_3;
38401   int __pyx_t_4;
38402   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
38403 
38404   /* "View.MemoryView":1378
38405  *     cdef Py_ssize_t i
38406  *
38407  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
38408  *         if ndim == 1:
38409  *             if inc:
38410  */
38411   __pyx_t_1 = (__pyx_v_shape[0]);
38412   __pyx_t_2 = __pyx_t_1;
38413   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
38414     __pyx_v_i = __pyx_t_3;
38415 
38416     /* "View.MemoryView":1379
38417  *
38418  *     for i in range(shape[0]):
38419  *         if ndim == 1:             # <<<<<<<<<<<<<<
38420  *             if inc:
38421  *                 Py_INCREF((<PyObject **> data)[0])
38422  */
38423     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
38424     if (__pyx_t_4) {
38425 
38426       /* "View.MemoryView":1380
38427  *     for i in range(shape[0]):
38428  *         if ndim == 1:
38429  *             if inc:             # <<<<<<<<<<<<<<
38430  *                 Py_INCREF((<PyObject **> data)[0])
38431  *             else:
38432  */
38433       __pyx_t_4 = (__pyx_v_inc != 0);
38434       if (__pyx_t_4) {
38435 
38436         /* "View.MemoryView":1381
38437  *         if ndim == 1:
38438  *             if inc:
38439  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
38440  *             else:
38441  *                 Py_DECREF((<PyObject **> data)[0])
38442  */
38443         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
38444 
38445         /* "View.MemoryView":1380
38446  *     for i in range(shape[0]):
38447  *         if ndim == 1:
38448  *             if inc:             # <<<<<<<<<<<<<<
38449  *                 Py_INCREF((<PyObject **> data)[0])
38450  *             else:
38451  */
38452         goto __pyx_L6;
38453       }
38454 
38455       /* "View.MemoryView":1383
38456  *                 Py_INCREF((<PyObject **> data)[0])
38457  *             else:
38458  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
38459  *         else:
38460  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
38461  */
38462       /*else*/ {
38463         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
38464       }
38465       __pyx_L6:;
38466 
38467       /* "View.MemoryView":1379
38468  *
38469  *     for i in range(shape[0]):
38470  *         if ndim == 1:             # <<<<<<<<<<<<<<
38471  *             if inc:
38472  *                 Py_INCREF((<PyObject **> data)[0])
38473  */
38474       goto __pyx_L5;
38475     }
38476 
38477     /* "View.MemoryView":1385
38478  *                 Py_DECREF((<PyObject **> data)[0])
38479  *         else:
38480  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
38481  *                                       ndim - 1, inc)
38482  *
38483  */
38484     /*else*/ {
38485 
38486       /* "View.MemoryView":1386
38487  *         else:
38488  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
38489  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
38490  *
38491  *         data += strides[0]
38492  */
38493       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
38494     }
38495     __pyx_L5:;
38496 
38497     /* "View.MemoryView":1388
38498  *                                       ndim - 1, inc)
38499  *
38500  *         data += strides[0]             # <<<<<<<<<<<<<<
38501  *
38502  *
38503  */
38504     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
38505   }
38506 
38507   /* "View.MemoryView":1374
38508  *
38509  * @cname('__pyx_memoryview_refcount_objects_in_slice')
38510  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38511  *                                     Py_ssize_t *strides, int ndim, bint inc):
38512  *     cdef Py_ssize_t i
38513  */
38514 
38515   /* function exit code */
38516   __Pyx_RefNannyFinishContext();
38517 }
38518 
38519 /* "View.MemoryView":1394
38520  *
38521  * @cname('__pyx_memoryview_slice_assign_scalar')
38522  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
38523  *                               size_t itemsize, void *item,
38524  *                               bint dtype_is_object) nogil:
38525  */
38526 
__pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item,int __pyx_v_dtype_is_object)38527 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
38528 
38529   /* "View.MemoryView":1397
38530  *                               size_t itemsize, void *item,
38531  *                               bint dtype_is_object) nogil:
38532  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
38533  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
38534  *                          itemsize, item)
38535  */
38536   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
38537 
38538   /* "View.MemoryView":1398
38539  *                               bint dtype_is_object) nogil:
38540  *     refcount_copying(dst, dtype_is_object, ndim, False)
38541  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
38542  *                          itemsize, item)
38543  *     refcount_copying(dst, dtype_is_object, ndim, True)
38544  */
38545   __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
38546 
38547   /* "View.MemoryView":1400
38548  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
38549  *                          itemsize, item)
38550  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
38551  *
38552  *
38553  */
38554   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
38555 
38556   /* "View.MemoryView":1394
38557  *
38558  * @cname('__pyx_memoryview_slice_assign_scalar')
38559  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
38560  *                               size_t itemsize, void *item,
38561  *                               bint dtype_is_object) nogil:
38562  */
38563 
38564   /* function exit code */
38565 }
38566 
38567 /* "View.MemoryView":1404
38568  *
38569  * @cname('__pyx_memoryview__slice_assign_scalar')
38570  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38571  *                               Py_ssize_t *strides, int ndim,
38572  *                               size_t itemsize, void *item) nogil:
38573  */
38574 
__pyx_memoryview__slice_assign_scalar(char * __pyx_v_data,Py_ssize_t * __pyx_v_shape,Py_ssize_t * __pyx_v_strides,int __pyx_v_ndim,size_t __pyx_v_itemsize,void * __pyx_v_item)38575 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
38576   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
38577   Py_ssize_t __pyx_v_stride;
38578   Py_ssize_t __pyx_v_extent;
38579   int __pyx_t_1;
38580   Py_ssize_t __pyx_t_2;
38581   Py_ssize_t __pyx_t_3;
38582   Py_ssize_t __pyx_t_4;
38583 
38584   /* "View.MemoryView":1408
38585  *                               size_t itemsize, void *item) nogil:
38586  *     cdef Py_ssize_t i
38587  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
38588  *     cdef Py_ssize_t extent = shape[0]
38589  *
38590  */
38591   __pyx_v_stride = (__pyx_v_strides[0]);
38592 
38593   /* "View.MemoryView":1409
38594  *     cdef Py_ssize_t i
38595  *     cdef Py_ssize_t stride = strides[0]
38596  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
38597  *
38598  *     if ndim == 1:
38599  */
38600   __pyx_v_extent = (__pyx_v_shape[0]);
38601 
38602   /* "View.MemoryView":1411
38603  *     cdef Py_ssize_t extent = shape[0]
38604  *
38605  *     if ndim == 1:             # <<<<<<<<<<<<<<
38606  *         for i in range(extent):
38607  *             memcpy(data, item, itemsize)
38608  */
38609   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
38610   if (__pyx_t_1) {
38611 
38612     /* "View.MemoryView":1412
38613  *
38614  *     if ndim == 1:
38615  *         for i in range(extent):             # <<<<<<<<<<<<<<
38616  *             memcpy(data, item, itemsize)
38617  *             data += stride
38618  */
38619     __pyx_t_2 = __pyx_v_extent;
38620     __pyx_t_3 = __pyx_t_2;
38621     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
38622       __pyx_v_i = __pyx_t_4;
38623 
38624       /* "View.MemoryView":1413
38625  *     if ndim == 1:
38626  *         for i in range(extent):
38627  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
38628  *             data += stride
38629  *     else:
38630  */
38631       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
38632 
38633       /* "View.MemoryView":1414
38634  *         for i in range(extent):
38635  *             memcpy(data, item, itemsize)
38636  *             data += stride             # <<<<<<<<<<<<<<
38637  *     else:
38638  *         for i in range(extent):
38639  */
38640       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
38641     }
38642 
38643     /* "View.MemoryView":1411
38644  *     cdef Py_ssize_t extent = shape[0]
38645  *
38646  *     if ndim == 1:             # <<<<<<<<<<<<<<
38647  *         for i in range(extent):
38648  *             memcpy(data, item, itemsize)
38649  */
38650     goto __pyx_L3;
38651   }
38652 
38653   /* "View.MemoryView":1416
38654  *             data += stride
38655  *     else:
38656  *         for i in range(extent):             # <<<<<<<<<<<<<<
38657  *             _slice_assign_scalar(data, shape + 1, strides + 1,
38658  *                                 ndim - 1, itemsize, item)
38659  */
38660   /*else*/ {
38661     __pyx_t_2 = __pyx_v_extent;
38662     __pyx_t_3 = __pyx_t_2;
38663     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
38664       __pyx_v_i = __pyx_t_4;
38665 
38666       /* "View.MemoryView":1417
38667  *     else:
38668  *         for i in range(extent):
38669  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
38670  *                                 ndim - 1, itemsize, item)
38671  *             data += stride
38672  */
38673       __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
38674 
38675       /* "View.MemoryView":1419
38676  *             _slice_assign_scalar(data, shape + 1, strides + 1,
38677  *                                 ndim - 1, itemsize, item)
38678  *             data += stride             # <<<<<<<<<<<<<<
38679  *
38680  *
38681  */
38682       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
38683     }
38684   }
38685   __pyx_L3:;
38686 
38687   /* "View.MemoryView":1404
38688  *
38689  * @cname('__pyx_memoryview__slice_assign_scalar')
38690  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
38691  *                               Py_ssize_t *strides, int ndim,
38692  *                               size_t itemsize, void *item) nogil:
38693  */
38694 
38695   /* function exit code */
38696 }
38697 
38698 /* "(tree fragment)":1
38699  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
38700  *     cdef object __pyx_PickleError
38701  *     cdef object __pyx_result
38702  */
38703 
38704 /* Python wrapper */
38705 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
38706 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)38707 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
38708   PyObject *__pyx_v___pyx_type = 0;
38709   long __pyx_v___pyx_checksum;
38710   PyObject *__pyx_v___pyx_state = 0;
38711   PyObject *__pyx_r = 0;
38712   __Pyx_RefNannyDeclarations
38713   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
38714   {
38715     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
38716     PyObject* values[3] = {0,0,0};
38717     if (unlikely(__pyx_kwds)) {
38718       Py_ssize_t kw_args;
38719       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38720       switch (pos_args) {
38721         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
38722         CYTHON_FALLTHROUGH;
38723         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38724         CYTHON_FALLTHROUGH;
38725         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38726         CYTHON_FALLTHROUGH;
38727         case  0: break;
38728         default: goto __pyx_L5_argtuple_error;
38729       }
38730       kw_args = PyDict_Size(__pyx_kwds);
38731       switch (pos_args) {
38732         case  0:
38733         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
38734         else goto __pyx_L5_argtuple_error;
38735         CYTHON_FALLTHROUGH;
38736         case  1:
38737         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
38738         else {
38739           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
38740         }
38741         CYTHON_FALLTHROUGH;
38742         case  2:
38743         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
38744         else {
38745           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
38746         }
38747       }
38748       if (unlikely(kw_args > 0)) {
38749         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
38750       }
38751     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
38752       goto __pyx_L5_argtuple_error;
38753     } else {
38754       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38755       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38756       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
38757     }
38758     __pyx_v___pyx_type = values[0];
38759     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
38760     __pyx_v___pyx_state = values[2];
38761   }
38762   goto __pyx_L4_argument_unpacking_done;
38763   __pyx_L5_argtuple_error:;
38764   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
38765   __pyx_L3_error:;
38766   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
38767   __Pyx_RefNannyFinishContext();
38768   return NULL;
38769   __pyx_L4_argument_unpacking_done:;
38770   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
38771 
38772   /* function exit code */
38773   __Pyx_RefNannyFinishContext();
38774   return __pyx_r;
38775 }
38776 
__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)38777 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
38778   PyObject *__pyx_v___pyx_PickleError = 0;
38779   PyObject *__pyx_v___pyx_result = 0;
38780   PyObject *__pyx_r = NULL;
38781   __Pyx_RefNannyDeclarations
38782   int __pyx_t_1;
38783   PyObject *__pyx_t_2 = NULL;
38784   PyObject *__pyx_t_3 = NULL;
38785   PyObject *__pyx_t_4 = NULL;
38786   PyObject *__pyx_t_5 = NULL;
38787   int __pyx_t_6;
38788   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
38789 
38790   /* "(tree fragment)":4
38791  *     cdef object __pyx_PickleError
38792  *     cdef object __pyx_result
38793  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
38794  *         from pickle import PickleError as __pyx_PickleError
38795  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38796  */
38797   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
38798   if (__pyx_t_1) {
38799 
38800     /* "(tree fragment)":5
38801  *     cdef object __pyx_result
38802  *     if __pyx_checksum != 0xb068931:
38803  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
38804  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38805  *     __pyx_result = Enum.__new__(__pyx_type)
38806  */
38807     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
38808     __Pyx_GOTREF(__pyx_t_2);
38809     __Pyx_INCREF(__pyx_n_s_PickleError);
38810     __Pyx_GIVEREF(__pyx_n_s_PickleError);
38811     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
38812     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
38813     __Pyx_GOTREF(__pyx_t_3);
38814     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38815     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
38816     __Pyx_GOTREF(__pyx_t_2);
38817     __Pyx_INCREF(__pyx_t_2);
38818     __pyx_v___pyx_PickleError = __pyx_t_2;
38819     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38820     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38821 
38822     /* "(tree fragment)":6
38823  *     if __pyx_checksum != 0xb068931:
38824  *         from pickle import PickleError as __pyx_PickleError
38825  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
38826  *     __pyx_result = Enum.__new__(__pyx_type)
38827  *     if __pyx_state is not None:
38828  */
38829     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
38830     __Pyx_GOTREF(__pyx_t_2);
38831     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
38832     __Pyx_GOTREF(__pyx_t_4);
38833     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38834     __Pyx_INCREF(__pyx_v___pyx_PickleError);
38835     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
38836     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
38837       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
38838       if (likely(__pyx_t_5)) {
38839         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38840         __Pyx_INCREF(__pyx_t_5);
38841         __Pyx_INCREF(function);
38842         __Pyx_DECREF_SET(__pyx_t_2, function);
38843       }
38844     }
38845     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
38846     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
38847     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38848     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
38849     __Pyx_GOTREF(__pyx_t_3);
38850     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38851     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
38852     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38853     __PYX_ERR(1, 6, __pyx_L1_error)
38854 
38855     /* "(tree fragment)":4
38856  *     cdef object __pyx_PickleError
38857  *     cdef object __pyx_result
38858  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
38859  *         from pickle import PickleError as __pyx_PickleError
38860  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38861  */
38862   }
38863 
38864   /* "(tree fragment)":7
38865  *         from pickle import PickleError as __pyx_PickleError
38866  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38867  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
38868  *     if __pyx_state is not None:
38869  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
38870  */
38871   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
38872   __Pyx_GOTREF(__pyx_t_2);
38873   __pyx_t_4 = NULL;
38874   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
38875     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
38876     if (likely(__pyx_t_4)) {
38877       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38878       __Pyx_INCREF(__pyx_t_4);
38879       __Pyx_INCREF(function);
38880       __Pyx_DECREF_SET(__pyx_t_2, function);
38881     }
38882   }
38883   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
38884   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38885   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
38886   __Pyx_GOTREF(__pyx_t_3);
38887   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38888   __pyx_v___pyx_result = __pyx_t_3;
38889   __pyx_t_3 = 0;
38890 
38891   /* "(tree fragment)":8
38892  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38893  *     __pyx_result = Enum.__new__(__pyx_type)
38894  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
38895  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
38896  *     return __pyx_result
38897  */
38898   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
38899   __pyx_t_6 = (__pyx_t_1 != 0);
38900   if (__pyx_t_6) {
38901 
38902     /* "(tree fragment)":9
38903  *     __pyx_result = Enum.__new__(__pyx_type)
38904  *     if __pyx_state is not None:
38905  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
38906  *     return __pyx_result
38907  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
38908  */
38909     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
38910     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
38911     __Pyx_GOTREF(__pyx_t_3);
38912     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38913 
38914     /* "(tree fragment)":8
38915  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
38916  *     __pyx_result = Enum.__new__(__pyx_type)
38917  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
38918  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
38919  *     return __pyx_result
38920  */
38921   }
38922 
38923   /* "(tree fragment)":10
38924  *     if __pyx_state is not None:
38925  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
38926  *     return __pyx_result             # <<<<<<<<<<<<<<
38927  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
38928  *     __pyx_result.name = __pyx_state[0]
38929  */
38930   __Pyx_XDECREF(__pyx_r);
38931   __Pyx_INCREF(__pyx_v___pyx_result);
38932   __pyx_r = __pyx_v___pyx_result;
38933   goto __pyx_L0;
38934 
38935   /* "(tree fragment)":1
38936  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
38937  *     cdef object __pyx_PickleError
38938  *     cdef object __pyx_result
38939  */
38940 
38941   /* function exit code */
38942   __pyx_L1_error:;
38943   __Pyx_XDECREF(__pyx_t_2);
38944   __Pyx_XDECREF(__pyx_t_3);
38945   __Pyx_XDECREF(__pyx_t_4);
38946   __Pyx_XDECREF(__pyx_t_5);
38947   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
38948   __pyx_r = NULL;
38949   __pyx_L0:;
38950   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
38951   __Pyx_XDECREF(__pyx_v___pyx_result);
38952   __Pyx_XGIVEREF(__pyx_r);
38953   __Pyx_RefNannyFinishContext();
38954   return __pyx_r;
38955 }
38956 
38957 /* "(tree fragment)":11
38958  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
38959  *     return __pyx_result
38960  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
38961  *     __pyx_result.name = __pyx_state[0]
38962  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
38963  */
38964 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)38965 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
38966   PyObject *__pyx_r = NULL;
38967   __Pyx_RefNannyDeclarations
38968   PyObject *__pyx_t_1 = NULL;
38969   int __pyx_t_2;
38970   Py_ssize_t __pyx_t_3;
38971   int __pyx_t_4;
38972   int __pyx_t_5;
38973   PyObject *__pyx_t_6 = NULL;
38974   PyObject *__pyx_t_7 = NULL;
38975   PyObject *__pyx_t_8 = NULL;
38976   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
38977 
38978   /* "(tree fragment)":12
38979  *     return __pyx_result
38980  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
38981  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
38982  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
38983  *         __pyx_result.__dict__.update(__pyx_state[1])
38984  */
38985   if (unlikely(__pyx_v___pyx_state == Py_None)) {
38986     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
38987     __PYX_ERR(1, 12, __pyx_L1_error)
38988   }
38989   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
38990   __Pyx_GOTREF(__pyx_t_1);
38991   __Pyx_GIVEREF(__pyx_t_1);
38992   __Pyx_GOTREF(__pyx_v___pyx_result->name);
38993   __Pyx_DECREF(__pyx_v___pyx_result->name);
38994   __pyx_v___pyx_result->name = __pyx_t_1;
38995   __pyx_t_1 = 0;
38996 
38997   /* "(tree fragment)":13
38998  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
38999  *     __pyx_result.name = __pyx_state[0]
39000  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
39001  *         __pyx_result.__dict__.update(__pyx_state[1])
39002  */
39003   if (unlikely(__pyx_v___pyx_state == Py_None)) {
39004     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
39005     __PYX_ERR(1, 13, __pyx_L1_error)
39006   }
39007   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
39008   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
39009   if (__pyx_t_4) {
39010   } else {
39011     __pyx_t_2 = __pyx_t_4;
39012     goto __pyx_L4_bool_binop_done;
39013   }
39014   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
39015   __pyx_t_5 = (__pyx_t_4 != 0);
39016   __pyx_t_2 = __pyx_t_5;
39017   __pyx_L4_bool_binop_done:;
39018   if (__pyx_t_2) {
39019 
39020     /* "(tree fragment)":14
39021  *     __pyx_result.name = __pyx_state[0]
39022  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
39023  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
39024  */
39025     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
39026     __Pyx_GOTREF(__pyx_t_6);
39027     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
39028     __Pyx_GOTREF(__pyx_t_7);
39029     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39030     if (unlikely(__pyx_v___pyx_state == Py_None)) {
39031       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
39032       __PYX_ERR(1, 14, __pyx_L1_error)
39033     }
39034     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
39035     __Pyx_GOTREF(__pyx_t_6);
39036     __pyx_t_8 = NULL;
39037     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
39038       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
39039       if (likely(__pyx_t_8)) {
39040         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
39041         __Pyx_INCREF(__pyx_t_8);
39042         __Pyx_INCREF(function);
39043         __Pyx_DECREF_SET(__pyx_t_7, function);
39044       }
39045     }
39046     __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
39047     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
39048     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39049     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
39050     __Pyx_GOTREF(__pyx_t_1);
39051     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39052     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39053 
39054     /* "(tree fragment)":13
39055  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
39056  *     __pyx_result.name = __pyx_state[0]
39057  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
39058  *         __pyx_result.__dict__.update(__pyx_state[1])
39059  */
39060   }
39061 
39062   /* "(tree fragment)":11
39063  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
39064  *     return __pyx_result
39065  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
39066  *     __pyx_result.name = __pyx_state[0]
39067  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
39068  */
39069 
39070   /* function exit code */
39071   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39072   goto __pyx_L0;
39073   __pyx_L1_error:;
39074   __Pyx_XDECREF(__pyx_t_1);
39075   __Pyx_XDECREF(__pyx_t_6);
39076   __Pyx_XDECREF(__pyx_t_7);
39077   __Pyx_XDECREF(__pyx_t_8);
39078   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
39079   __pyx_r = 0;
39080   __pyx_L0:;
39081   __Pyx_XGIVEREF(__pyx_r);
39082   __Pyx_RefNannyFinishContext();
39083   return __pyx_r;
39084 }
39085 
39086 /* "BufferFormatFromTypeInfo":1460
39087  *
39088  * @cname('__pyx_format_from_typeinfo')
39089  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
39090  *     cdef __Pyx_StructField *field
39091  *     cdef __pyx_typeinfo_string fmt
39092  */
39093 
__pyx_format_from_typeinfo(__Pyx_TypeInfo * __pyx_v_type)39094 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
39095   __Pyx_StructField *__pyx_v_field;
39096   struct __pyx_typeinfo_string __pyx_v_fmt;
39097   PyObject *__pyx_v_part = 0;
39098   PyObject *__pyx_v_result = 0;
39099   PyObject *__pyx_v_alignment = NULL;
39100   PyObject *__pyx_v_parts = NULL;
39101   PyObject *__pyx_v_extents = NULL;
39102   int __pyx_v_i;
39103   PyObject *__pyx_r = NULL;
39104   __Pyx_RefNannyDeclarations
39105   int __pyx_t_1;
39106   int __pyx_t_2;
39107   PyObject *__pyx_t_3 = NULL;
39108   __Pyx_StructField *__pyx_t_4;
39109   PyObject *__pyx_t_5 = NULL;
39110   PyObject *__pyx_t_6 = NULL;
39111   int __pyx_t_7;
39112   int __pyx_t_8;
39113   int __pyx_t_9;
39114   int __pyx_t_10;
39115   __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
39116 
39117   /* "BufferFormatFromTypeInfo":1465
39118  *     cdef bytes part, result
39119  *
39120  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
39121  *         assert type.fields != NULL and type.fields.type != NULL
39122  *
39123  */
39124   __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
39125   if (__pyx_t_1) {
39126 
39127     /* "BufferFormatFromTypeInfo":1466
39128  *
39129  *     if type.typegroup == 'S':
39130  *         assert type.fields != NULL and type.fields.type != NULL             # <<<<<<<<<<<<<<
39131  *
39132  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
39133  */
39134     #ifndef CYTHON_WITHOUT_ASSERTIONS
39135     if (unlikely(!Py_OptimizeFlag)) {
39136       __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0);
39137       if (__pyx_t_2) {
39138       } else {
39139         __pyx_t_1 = __pyx_t_2;
39140         goto __pyx_L4_bool_binop_done;
39141       }
39142       __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0);
39143       __pyx_t_1 = __pyx_t_2;
39144       __pyx_L4_bool_binop_done:;
39145       if (unlikely(!__pyx_t_1)) {
39146         PyErr_SetNone(PyExc_AssertionError);
39147         __PYX_ERR(1, 1466, __pyx_L1_error)
39148       }
39149     }
39150     #endif
39151 
39152     /* "BufferFormatFromTypeInfo":1468
39153  *         assert type.fields != NULL and type.fields.type != NULL
39154  *
39155  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
39156  *             alignment = b'^'
39157  *         else:
39158  */
39159     __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
39160     if (__pyx_t_1) {
39161 
39162       /* "BufferFormatFromTypeInfo":1469
39163  *
39164  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
39165  *             alignment = b'^'             # <<<<<<<<<<<<<<
39166  *         else:
39167  *             alignment = b''
39168  */
39169       __Pyx_INCREF(__pyx_kp_b__42);
39170       __pyx_v_alignment = __pyx_kp_b__42;
39171 
39172       /* "BufferFormatFromTypeInfo":1468
39173  *         assert type.fields != NULL and type.fields.type != NULL
39174  *
39175  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
39176  *             alignment = b'^'
39177  *         else:
39178  */
39179       goto __pyx_L6;
39180     }
39181 
39182     /* "BufferFormatFromTypeInfo":1471
39183  *             alignment = b'^'
39184  *         else:
39185  *             alignment = b''             # <<<<<<<<<<<<<<
39186  *
39187  *         parts = [b"T{"]
39188  */
39189     /*else*/ {
39190       __Pyx_INCREF(__pyx_kp_b__43);
39191       __pyx_v_alignment = __pyx_kp_b__43;
39192     }
39193     __pyx_L6:;
39194 
39195     /* "BufferFormatFromTypeInfo":1473
39196  *             alignment = b''
39197  *
39198  *         parts = [b"T{"]             # <<<<<<<<<<<<<<
39199  *         field = type.fields
39200  *
39201  */
39202     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error)
39203     __Pyx_GOTREF(__pyx_t_3);
39204     __Pyx_INCREF(__pyx_kp_b_T);
39205     __Pyx_GIVEREF(__pyx_kp_b_T);
39206     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T);
39207     __pyx_v_parts = ((PyObject*)__pyx_t_3);
39208     __pyx_t_3 = 0;
39209 
39210     /* "BufferFormatFromTypeInfo":1474
39211  *
39212  *         parts = [b"T{"]
39213  *         field = type.fields             # <<<<<<<<<<<<<<
39214  *
39215  *         while field.type:
39216  */
39217     __pyx_t_4 = __pyx_v_type->fields;
39218     __pyx_v_field = __pyx_t_4;
39219 
39220     /* "BufferFormatFromTypeInfo":1476
39221  *         field = type.fields
39222  *
39223  *         while field.type:             # <<<<<<<<<<<<<<
39224  *             part = format_from_typeinfo(field.type)
39225  *             parts.append(part + b':' + field.name + b':')
39226  */
39227     while (1) {
39228       __pyx_t_1 = (__pyx_v_field->type != 0);
39229       if (!__pyx_t_1) break;
39230 
39231       /* "BufferFormatFromTypeInfo":1477
39232  *
39233  *         while field.type:
39234  *             part = format_from_typeinfo(field.type)             # <<<<<<<<<<<<<<
39235  *             parts.append(part + b':' + field.name + b':')
39236  *             field += 1
39237  */
39238       __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1477, __pyx_L1_error)
39239       __Pyx_GOTREF(__pyx_t_3);
39240       __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3));
39241       __pyx_t_3 = 0;
39242 
39243       /* "BufferFormatFromTypeInfo":1478
39244  *         while field.type:
39245  *             part = format_from_typeinfo(field.type)
39246  *             parts.append(part + b':' + field.name + b':')             # <<<<<<<<<<<<<<
39247  *             field += 1
39248  *
39249  */
39250       __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__44); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1478, __pyx_L1_error)
39251       __Pyx_GOTREF(__pyx_t_3);
39252       __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1478, __pyx_L1_error)
39253       __Pyx_GOTREF(__pyx_t_5);
39254       __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1478, __pyx_L1_error)
39255       __Pyx_GOTREF(__pyx_t_6);
39256       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39257       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39258       __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__44); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1478, __pyx_L1_error)
39259       __Pyx_GOTREF(__pyx_t_5);
39260       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39261       __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1478, __pyx_L1_error)
39262       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39263 
39264       /* "BufferFormatFromTypeInfo":1479
39265  *             part = format_from_typeinfo(field.type)
39266  *             parts.append(part + b':' + field.name + b':')
39267  *             field += 1             # <<<<<<<<<<<<<<
39268  *
39269  *         result = alignment.join(parts) + b'}'
39270  */
39271       __pyx_v_field = (__pyx_v_field + 1);
39272     }
39273 
39274     /* "BufferFormatFromTypeInfo":1481
39275  *             field += 1
39276  *
39277  *         result = alignment.join(parts) + b'}'             # <<<<<<<<<<<<<<
39278  *     else:
39279  *         fmt = __Pyx_TypeInfoToFormat(type)
39280  */
39281     __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1481, __pyx_L1_error)
39282     __Pyx_GOTREF(__pyx_t_5);
39283     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__45); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1481, __pyx_L1_error)
39284     __Pyx_GOTREF(__pyx_t_6);
39285     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39286     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1481, __pyx_L1_error)
39287     __pyx_v_result = ((PyObject*)__pyx_t_6);
39288     __pyx_t_6 = 0;
39289 
39290     /* "BufferFormatFromTypeInfo":1465
39291  *     cdef bytes part, result
39292  *
39293  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
39294  *         assert type.fields != NULL and type.fields.type != NULL
39295  *
39296  */
39297     goto __pyx_L3;
39298   }
39299 
39300   /* "BufferFormatFromTypeInfo":1483
39301  *         result = alignment.join(parts) + b'}'
39302  *     else:
39303  *         fmt = __Pyx_TypeInfoToFormat(type)             # <<<<<<<<<<<<<<
39304  *         if type.arraysize[0]:
39305  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
39306  */
39307   /*else*/ {
39308     __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
39309 
39310     /* "BufferFormatFromTypeInfo":1484
39311  *     else:
39312  *         fmt = __Pyx_TypeInfoToFormat(type)
39313  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
39314  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
39315  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
39316  */
39317     __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
39318     if (__pyx_t_1) {
39319 
39320       /* "BufferFormatFromTypeInfo":1485
39321  *         fmt = __Pyx_TypeInfoToFormat(type)
39322  *         if type.arraysize[0]:
39323  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]             # <<<<<<<<<<<<<<
39324  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
39325  *         else:
39326  */
39327       __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1485, __pyx_L1_error)
39328       __Pyx_GOTREF(__pyx_t_6);
39329       __pyx_t_8 = __pyx_v_type->ndim;
39330       __pyx_t_9 = __pyx_t_8;
39331       for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
39332         __pyx_v_i = __pyx_t_10;
39333         __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error)
39334         __Pyx_GOTREF(__pyx_t_5);
39335         __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1485, __pyx_L1_error)
39336         __Pyx_GOTREF(__pyx_t_3);
39337         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39338         if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 1485, __pyx_L1_error)
39339         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39340       }
39341       __pyx_v_extents = ((PyObject*)__pyx_t_6);
39342       __pyx_t_6 = 0;
39343 
39344       /* "BufferFormatFromTypeInfo":1486
39345  *         if type.arraysize[0]:
39346  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
39347  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string             # <<<<<<<<<<<<<<
39348  *         else:
39349  *             result = fmt.string
39350  */
39351       __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__46, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1486, __pyx_L1_error)
39352       __Pyx_GOTREF(__pyx_t_6);
39353       __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1486, __pyx_L1_error)
39354       __Pyx_GOTREF(__pyx_t_3);
39355       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39356       __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1486, __pyx_L1_error)
39357       __Pyx_GOTREF(__pyx_t_6);
39358       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39359       __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1486, __pyx_L1_error)
39360       __Pyx_GOTREF(__pyx_t_3);
39361       __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1486, __pyx_L1_error)
39362       __Pyx_GOTREF(__pyx_t_5);
39363       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39364       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39365       if (!(likely(PyBytes_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(1, 1486, __pyx_L1_error)
39366       __pyx_v_result = ((PyObject*)__pyx_t_5);
39367       __pyx_t_5 = 0;
39368 
39369       /* "BufferFormatFromTypeInfo":1484
39370  *     else:
39371  *         fmt = __Pyx_TypeInfoToFormat(type)
39372  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
39373  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
39374  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
39375  */
39376       goto __pyx_L9;
39377     }
39378 
39379     /* "BufferFormatFromTypeInfo":1488
39380  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
39381  *         else:
39382  *             result = fmt.string             # <<<<<<<<<<<<<<
39383  *
39384  *     return result
39385  */
39386     /*else*/ {
39387       __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
39388       __Pyx_GOTREF(__pyx_t_5);
39389       __pyx_v_result = ((PyObject*)__pyx_t_5);
39390       __pyx_t_5 = 0;
39391     }
39392     __pyx_L9:;
39393   }
39394   __pyx_L3:;
39395 
39396   /* "BufferFormatFromTypeInfo":1490
39397  *             result = fmt.string
39398  *
39399  *     return result             # <<<<<<<<<<<<<<
39400  */
39401   __Pyx_XDECREF(__pyx_r);
39402   __Pyx_INCREF(__pyx_v_result);
39403   __pyx_r = __pyx_v_result;
39404   goto __pyx_L0;
39405 
39406   /* "BufferFormatFromTypeInfo":1460
39407  *
39408  * @cname('__pyx_format_from_typeinfo')
39409  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
39410  *     cdef __Pyx_StructField *field
39411  *     cdef __pyx_typeinfo_string fmt
39412  */
39413 
39414   /* function exit code */
39415   __pyx_L1_error:;
39416   __Pyx_XDECREF(__pyx_t_3);
39417   __Pyx_XDECREF(__pyx_t_5);
39418   __Pyx_XDECREF(__pyx_t_6);
39419   __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
39420   __pyx_r = 0;
39421   __pyx_L0:;
39422   __Pyx_XDECREF(__pyx_v_part);
39423   __Pyx_XDECREF(__pyx_v_result);
39424   __Pyx_XDECREF(__pyx_v_alignment);
39425   __Pyx_XDECREF(__pyx_v_parts);
39426   __Pyx_XDECREF(__pyx_v_extents);
39427   __Pyx_XGIVEREF(__pyx_r);
39428   __Pyx_RefNannyFinishContext();
39429   return __pyx_r;
39430 }
39431 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool;
39432 
__pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool(PyTypeObject * t,PyObject * a,PyObject * k)39433 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool(PyTypeObject *t, PyObject *a, PyObject *k) {
39434   struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *p;
39435   PyObject *o = __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_new(t, a, k);
39436   if (unlikely(!o)) return 0;
39437   p = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)o);
39438   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool;
39439   if (unlikely(__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
39440   return o;
39441   bad:
39442   Py_DECREF(o); o = 0;
39443   return NULL;
39444 }
39445 
__pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool(PyObject * o)39446 static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool(PyObject *o) {
39447   #if CYTHON_USE_TP_FINALIZE
39448   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))) {
39449     if (PyObject_CallFinalizerFromDealloc(o)) return;
39450   }
39451   #endif
39452   if (likely(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool);
39453 }
39454 
39455 static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_OctObjectPool[] = {
39456   {"_con_to_array", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_3_con_to_array, METH_O, 0},
39457   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_5__reduce_cython__, METH_NOARGS, 0},
39458   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_13OctObjectPool_7__setstate_cython__, METH_O, 0},
39459   {0, 0, 0, 0}
39460 };
39461 
39462 static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_OctObjectPool = {
39463   PyVarObject_HEAD_INIT(0, 0)
39464   "yt.geometry.oct_container.OctObjectPool", /*tp_name*/
39465   sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), /*tp_basicsize*/
39466   0, /*tp_itemsize*/
39467   __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctObjectPool, /*tp_dealloc*/
39468   0, /*tp_print*/
39469   0, /*tp_getattr*/
39470   0, /*tp_setattr*/
39471   #if PY_MAJOR_VERSION < 3
39472   0, /*tp_compare*/
39473   #endif
39474   #if PY_MAJOR_VERSION >= 3
39475   0, /*tp_as_async*/
39476   #endif
39477   0, /*tp_repr*/
39478   0, /*tp_as_number*/
39479   0, /*tp_as_sequence*/
39480   0, /*tp_as_mapping*/
39481   0, /*tp_hash*/
39482   0, /*tp_call*/
39483   0, /*tp_str*/
39484   0, /*tp_getattro*/
39485   0, /*tp_setattro*/
39486   0, /*tp_as_buffer*/
39487   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
39488   0, /*tp_doc*/
39489   0, /*tp_traverse*/
39490   0, /*tp_clear*/
39491   0, /*tp_richcompare*/
39492   0, /*tp_weaklistoffset*/
39493   0, /*tp_iter*/
39494   0, /*tp_iternext*/
39495   __pyx_methods_2yt_8geometry_13oct_container_OctObjectPool, /*tp_methods*/
39496   0, /*tp_members*/
39497   0, /*tp_getset*/
39498   0, /*tp_base*/
39499   0, /*tp_dict*/
39500   0, /*tp_descr_get*/
39501   0, /*tp_descr_set*/
39502   0, /*tp_dictoffset*/
39503   0, /*tp_init*/
39504   0, /*tp_alloc*/
39505   __pyx_tp_new_2yt_8geometry_13oct_container_OctObjectPool, /*tp_new*/
39506   0, /*tp_free*/
39507   0, /*tp_is_gc*/
39508   0, /*tp_bases*/
39509   0, /*tp_mro*/
39510   0, /*tp_cache*/
39511   0, /*tp_subclasses*/
39512   0, /*tp_weaklist*/
39513   0, /*tp_del*/
39514   0, /*tp_version_tag*/
39515   #if PY_VERSION_HEX >= 0x030400a1
39516   0, /*tp_finalize*/
39517   #endif
39518   #if PY_VERSION_HEX >= 0x030800b1
39519   0, /*tp_vectorcall*/
39520   #endif
39521 };
39522 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer;
39523 
__pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)39524 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
39525   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p;
39526   PyObject *o;
39527   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
39528     o = (*t->tp_alloc)(t, 0);
39529   } else {
39530     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
39531   }
39532   if (unlikely(!o)) return 0;
39533   p = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o);
39534   p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
39535   p->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None); Py_INCREF(Py_None);
39536   p->fill_style = Py_None; Py_INCREF(Py_None);
39537   return o;
39538 }
39539 
__pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer(PyObject * o)39540 static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o) {
39541   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o;
39542   #if CYTHON_USE_TP_FINALIZE
39543   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
39544     if (PyObject_CallFinalizerFromDealloc(o)) return;
39545   }
39546   #endif
39547   PyObject_GC_UnTrack(o);
39548   {
39549     PyObject *etype, *eval, *etb;
39550     PyErr_Fetch(&etype, &eval, &etb);
39551     ++Py_REFCNT(o);
39552     __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7__dealloc__(o);
39553     --Py_REFCNT(o);
39554     PyErr_Restore(etype, eval, etb);
39555   }
39556   Py_CLEAR(p->domains);
39557   Py_CLEAR(p->fill_style);
39558   (*Py_TYPE(o)->tp_free)(o);
39559 }
39560 
__pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer(PyObject * o,visitproc v,void * a)39561 static int __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o, visitproc v, void *a) {
39562   int e;
39563   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o;
39564   if (p->domains) {
39565     e = (*v)(((PyObject *)p->domains), a); if (e) return e;
39566   }
39567   if (p->fill_style) {
39568     e = (*v)(p->fill_style, a); if (e) return e;
39569   }
39570   return 0;
39571 }
39572 
__pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer(PyObject * o)39573 static int __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer(PyObject *o) {
39574   PyObject* tmp;
39575   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *p = (struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *)o;
39576   tmp = ((PyObject*)p->domains);
39577   p->domains = ((struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *)Py_None); Py_INCREF(Py_None);
39578   Py_XDECREF(tmp);
39579   tmp = ((PyObject*)p->fill_style);
39580   p->fill_style = Py_None; Py_INCREF(Py_None);
39581   Py_XDECREF(tmp);
39582   return 0;
39583 }
39584 
__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_oct_arrays(PyObject * o,CYTHON_UNUSED void * x)39585 static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_oct_arrays(PyObject *o, CYTHON_UNUSED void *x) {
39586   return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10oct_arrays_1__get__(o);
39587 }
39588 
__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject * o,CYTHON_UNUSED void * x)39589 static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject *o, CYTHON_UNUSED void *x) {
39590   return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_1__get__(o);
39591 }
39592 
__pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)39593 static int __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_domains(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
39594   if (v) {
39595     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_3__set__(o, v);
39596   }
39597   else {
39598     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_7domains_5__del__(o);
39599   }
39600 }
39601 
__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts(PyObject * o,CYTHON_UNUSED void * x)39602 static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts(PyObject *o, CYTHON_UNUSED void *x) {
39603   return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_1__get__(o);
39604 }
39605 
__pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)39606 static int __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
39607   if (v) {
39608     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5nocts_3__set__(o, v);
39609   }
39610   else {
39611     PyErr_SetString(PyExc_NotImplementedError, "__del__");
39612     return -1;
39613   }
39614 }
39615 
__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains(PyObject * o,CYTHON_UNUSED void * x)39616 static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains(PyObject *o, CYTHON_UNUSED void *x) {
39617   return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_1__get__(o);
39618 }
39619 
__pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)39620 static int __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
39621   if (v) {
39622     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11num_domains_3__set__(o, v);
39623   }
39624   else {
39625     PyErr_SetString(PyExc_NotImplementedError, "__del__");
39626     return -1;
39627   }
39628 }
39629 
__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style(PyObject * o,CYTHON_UNUSED void * x)39630 static PyObject *__pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style(PyObject *o, CYTHON_UNUSED void *x) {
39631   return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_1__get__(o);
39632 }
39633 
__pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)39634 static int __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
39635   if (v) {
39636     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_3__set__(o, v);
39637   }
39638   else {
39639     return __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_10fill_style_5__del__(o);
39640   }
39641 }
39642 
39643 static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_OctreeContainer[] = {
39644   {"_initialize_root_mesh", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_3_initialize_root_mesh, METH_NOARGS, 0},
39645   {"load_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_5load_octree, METH_O, 0},
39646   {"locate_positions", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_9locate_positions, METH_O, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_8locate_positions},
39647   {"domain_identify", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_11domain_identify, METH_O, 0},
39648   {"mask", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_13mask, METH_VARARGS|METH_KEYWORDS, 0},
39649   {"icoords", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_15icoords, METH_VARARGS|METH_KEYWORDS, 0},
39650   {"ires", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_17ires, METH_VARARGS|METH_KEYWORDS, 0},
39651   {"fwidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_19fwidth, METH_VARARGS|METH_KEYWORDS, 0},
39652   {"fcoords", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_21fcoords, METH_VARARGS|METH_KEYWORDS, 0},
39653   {"save_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_23save_octree, METH_NOARGS, 0},
39654   {"selector_fill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_25selector_fill, METH_VARARGS|METH_KEYWORDS, 0},
39655   {"domain_ind", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_27domain_ind, METH_VARARGS|METH_KEYWORDS, 0},
39656   {"add", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_29add, METH_VARARGS|METH_KEYWORDS, 0},
39657   {"allocate_domains", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_31allocate_domains, METH_O, 0},
39658   {"file_index_octs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_33file_index_octs, METH_VARARGS|METH_KEYWORDS, 0},
39659   {"morton_index_octs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_35morton_index_octs, METH_VARARGS|METH_KEYWORDS, 0},
39660   {"domain_count", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_37domain_count, METH_O, 0},
39661   {"fill_level", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_39fill_level, METH_VARARGS|METH_KEYWORDS, 0},
39662   {"fill_index", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_41fill_index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_40fill_index},
39663   {"fill_octcellindex_neighbours", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_43fill_octcellindex_neighbours, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_42fill_octcellindex_neighbours},
39664   {"fill_level_with_domain", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_45fill_level_with_domain, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_44fill_level_with_domain},
39665   {"file_index_octs_with_ghost_zones", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_47file_index_octs_with_ghost_zones, METH_VARARGS|METH_KEYWORDS, __pyx_doc_2yt_8geometry_13oct_container_15OctreeContainer_46file_index_octs_with_ghost_zones},
39666   {"finalize", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_49finalize, METH_NOARGS, 0},
39667   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_51__reduce_cython__, METH_NOARGS, 0},
39668   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_53__setstate_cython__, METH_O, 0},
39669   {0, 0, 0, 0}
39670 };
39671 
39672 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_13oct_container_OctreeContainer[] = {
39673   {(char *)"oct_arrays", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_oct_arrays, 0, (char *)0, 0},
39674   {(char *)"domains", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_domains, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_domains, (char *)0, 0},
39675   {(char *)"nocts", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_nocts, (char *)0, 0},
39676   {(char *)"num_domains", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_num_domains, (char *)0, 0},
39677   {(char *)"fill_style", __pyx_getprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style, __pyx_setprop_2yt_8geometry_13oct_container_15OctreeContainer_fill_style, (char *)0, 0},
39678   {0, 0, 0, 0, 0}
39679 };
39680 
39681 static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_OctreeContainer = {
39682   PyVarObject_HEAD_INIT(0, 0)
39683   "yt.geometry.oct_container.OctreeContainer", /*tp_name*/
39684   sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), /*tp_basicsize*/
39685   0, /*tp_itemsize*/
39686   __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer, /*tp_dealloc*/
39687   0, /*tp_print*/
39688   0, /*tp_getattr*/
39689   0, /*tp_setattr*/
39690   #if PY_MAJOR_VERSION < 3
39691   0, /*tp_compare*/
39692   #endif
39693   #if PY_MAJOR_VERSION >= 3
39694   0, /*tp_as_async*/
39695   #endif
39696   0, /*tp_repr*/
39697   0, /*tp_as_number*/
39698   0, /*tp_as_sequence*/
39699   0, /*tp_as_mapping*/
39700   0, /*tp_hash*/
39701   0, /*tp_call*/
39702   0, /*tp_str*/
39703   0, /*tp_getattro*/
39704   0, /*tp_setattro*/
39705   0, /*tp_as_buffer*/
39706   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
39707   0, /*tp_doc*/
39708   __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer, /*tp_traverse*/
39709   __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/
39710   0, /*tp_richcompare*/
39711   0, /*tp_weaklistoffset*/
39712   0, /*tp_iter*/
39713   0, /*tp_iternext*/
39714   __pyx_methods_2yt_8geometry_13oct_container_OctreeContainer, /*tp_methods*/
39715   0, /*tp_members*/
39716   __pyx_getsets_2yt_8geometry_13oct_container_OctreeContainer, /*tp_getset*/
39717   0, /*tp_base*/
39718   0, /*tp_dict*/
39719   0, /*tp_descr_get*/
39720   0, /*tp_descr_set*/
39721   0, /*tp_dictoffset*/
39722   __pyx_pw_2yt_8geometry_13oct_container_15OctreeContainer_1__init__, /*tp_init*/
39723   0, /*tp_alloc*/
39724   __pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer, /*tp_new*/
39725   0, /*tp_free*/
39726   0, /*tp_is_gc*/
39727   0, /*tp_bases*/
39728   0, /*tp_mro*/
39729   0, /*tp_cache*/
39730   0, /*tp_subclasses*/
39731   0, /*tp_weaklist*/
39732   0, /*tp_del*/
39733   0, /*tp_version_tag*/
39734   #if PY_VERSION_HEX >= 0x030400a1
39735   0, /*tp_finalize*/
39736   #endif
39737   #if PY_VERSION_HEX >= 0x030800b1
39738   0, /*tp_vectorcall*/
39739   #endif
39740 };
39741 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer;
39742 
__pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer(PyTypeObject * t,PyObject * a,PyObject * k)39743 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
39744   struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *p;
39745   PyObject *o = __pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(t, a, k);
39746   if (unlikely(!o)) return 0;
39747   p = ((struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *)o);
39748   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
39749   return o;
39750 }
39751 
__pyx_tp_dealloc_2yt_8geometry_13oct_container_SparseOctreeContainer(PyObject * o)39752 static void __pyx_tp_dealloc_2yt_8geometry_13oct_container_SparseOctreeContainer(PyObject *o) {
39753   #if CYTHON_USE_TP_FINALIZE
39754   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
39755     if (PyObject_CallFinalizerFromDealloc(o)) return;
39756   }
39757   #endif
39758   PyObject_GC_UnTrack(o);
39759   {
39760     PyObject *etype, *eval, *etb;
39761     PyErr_Fetch(&etype, &eval, &etb);
39762     ++Py_REFCNT(o);
39763     __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_9__dealloc__(o);
39764     --Py_REFCNT(o);
39765     PyErr_Restore(etype, eval, etb);
39766   }
39767   PyObject_GC_Track(o);
39768   __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer(o);
39769 }
39770 
39771 static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_SparseOctreeContainer[] = {
39772   {"load_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_3load_octree, METH_O, 0},
39773   {"save_octree", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_5save_octree, METH_NOARGS, 0},
39774   {"allocate_domains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_7allocate_domains, METH_VARARGS|METH_KEYWORDS, 0},
39775   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_11__reduce_cython__, METH_NOARGS, 0},
39776   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_13__setstate_cython__, METH_O, 0},
39777   {0, 0, 0, 0}
39778 };
39779 
39780 static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer = {
39781   PyVarObject_HEAD_INIT(0, 0)
39782   "yt.geometry.oct_container.SparseOctreeContainer", /*tp_name*/
39783   sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), /*tp_basicsize*/
39784   0, /*tp_itemsize*/
39785   __pyx_tp_dealloc_2yt_8geometry_13oct_container_SparseOctreeContainer, /*tp_dealloc*/
39786   0, /*tp_print*/
39787   0, /*tp_getattr*/
39788   0, /*tp_setattr*/
39789   #if PY_MAJOR_VERSION < 3
39790   0, /*tp_compare*/
39791   #endif
39792   #if PY_MAJOR_VERSION >= 3
39793   0, /*tp_as_async*/
39794   #endif
39795   0, /*tp_repr*/
39796   0, /*tp_as_number*/
39797   0, /*tp_as_sequence*/
39798   0, /*tp_as_mapping*/
39799   0, /*tp_hash*/
39800   0, /*tp_call*/
39801   0, /*tp_str*/
39802   0, /*tp_getattro*/
39803   0, /*tp_setattro*/
39804   0, /*tp_as_buffer*/
39805   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
39806   0, /*tp_doc*/
39807   __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer, /*tp_traverse*/
39808   __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/
39809   0, /*tp_richcompare*/
39810   0, /*tp_weaklistoffset*/
39811   0, /*tp_iter*/
39812   0, /*tp_iternext*/
39813   __pyx_methods_2yt_8geometry_13oct_container_SparseOctreeContainer, /*tp_methods*/
39814   0, /*tp_members*/
39815   0, /*tp_getset*/
39816   0, /*tp_base*/
39817   0, /*tp_dict*/
39818   0, /*tp_descr_get*/
39819   0, /*tp_descr_set*/
39820   0, /*tp_dictoffset*/
39821   __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_1__init__, /*tp_init*/
39822   0, /*tp_alloc*/
39823   __pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer, /*tp_new*/
39824   0, /*tp_free*/
39825   0, /*tp_is_gc*/
39826   0, /*tp_bases*/
39827   0, /*tp_mro*/
39828   0, /*tp_cache*/
39829   0, /*tp_subclasses*/
39830   0, /*tp_weaklist*/
39831   0, /*tp_del*/
39832   0, /*tp_version_tag*/
39833   #if PY_VERSION_HEX >= 0x030400a1
39834   0, /*tp_finalize*/
39835   #endif
39836   #if PY_VERSION_HEX >= 0x030800b1
39837   0, /*tp_vectorcall*/
39838   #endif
39839 };
39840 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer __pyx_vtable_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
39841 
__pyx_tp_new_2yt_8geometry_13oct_container_RAMSESOctreeContainer(PyTypeObject * t,PyObject * a,PyObject * k)39842 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_RAMSESOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
39843   struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *p;
39844   PyObject *o = __pyx_tp_new_2yt_8geometry_13oct_container_SparseOctreeContainer(t, a, k);
39845   if (unlikely(!o)) return 0;
39846   p = ((struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *)o);
39847   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
39848   return o;
39849 }
39850 
39851 static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer = {
39852   PyVarObject_HEAD_INIT(0, 0)
39853   "yt.geometry.oct_container.RAMSESOctreeContainer", /*tp_name*/
39854   sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), /*tp_basicsize*/
39855   0, /*tp_itemsize*/
39856   __pyx_tp_dealloc_2yt_8geometry_13oct_container_SparseOctreeContainer, /*tp_dealloc*/
39857   0, /*tp_print*/
39858   0, /*tp_getattr*/
39859   0, /*tp_setattr*/
39860   #if PY_MAJOR_VERSION < 3
39861   0, /*tp_compare*/
39862   #endif
39863   #if PY_MAJOR_VERSION >= 3
39864   0, /*tp_as_async*/
39865   #endif
39866   0, /*tp_repr*/
39867   0, /*tp_as_number*/
39868   0, /*tp_as_sequence*/
39869   0, /*tp_as_mapping*/
39870   0, /*tp_hash*/
39871   0, /*tp_call*/
39872   0, /*tp_str*/
39873   0, /*tp_getattro*/
39874   0, /*tp_setattro*/
39875   0, /*tp_as_buffer*/
39876   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
39877   0, /*tp_doc*/
39878   __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer, /*tp_traverse*/
39879   __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/
39880   0, /*tp_richcompare*/
39881   0, /*tp_weaklistoffset*/
39882   0, /*tp_iter*/
39883   0, /*tp_iternext*/
39884   0, /*tp_methods*/
39885   0, /*tp_members*/
39886   0, /*tp_getset*/
39887   0, /*tp_base*/
39888   0, /*tp_dict*/
39889   0, /*tp_descr_get*/
39890   0, /*tp_descr_set*/
39891   0, /*tp_dictoffset*/
39892   #if CYTHON_COMPILING_IN_PYPY
39893   __pyx_pw_2yt_8geometry_13oct_container_21SparseOctreeContainer_1__init__, /*tp_init*/
39894   #else
39895   0, /*tp_init*/
39896   #endif
39897   0, /*tp_alloc*/
39898   __pyx_tp_new_2yt_8geometry_13oct_container_RAMSESOctreeContainer, /*tp_new*/
39899   0, /*tp_free*/
39900   0, /*tp_is_gc*/
39901   0, /*tp_bases*/
39902   0, /*tp_mro*/
39903   0, /*tp_cache*/
39904   0, /*tp_subclasses*/
39905   0, /*tp_weaklist*/
39906   0, /*tp_del*/
39907   0, /*tp_version_tag*/
39908   #if PY_VERSION_HEX >= 0x030400a1
39909   0, /*tp_finalize*/
39910   #endif
39911   #if PY_VERSION_HEX >= 0x030800b1
39912   0, /*tp_vectorcall*/
39913   #endif
39914 };
39915 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_ARTOctreeContainer __pyx_vtable_2yt_8geometry_13oct_container_ARTOctreeContainer;
39916 
__pyx_tp_new_2yt_8geometry_13oct_container_ARTOctreeContainer(PyTypeObject * t,PyObject * a,PyObject * k)39917 static PyObject *__pyx_tp_new_2yt_8geometry_13oct_container_ARTOctreeContainer(PyTypeObject *t, PyObject *a, PyObject *k) {
39918   struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *p;
39919   PyObject *o = __pyx_tp_new_2yt_8geometry_13oct_container_OctreeContainer(t, a, k);
39920   if (unlikely(!o)) return 0;
39921   p = ((struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer *)o);
39922   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer;
39923   return o;
39924 }
39925 
39926 static PyMethodDef __pyx_methods_2yt_8geometry_13oct_container_ARTOctreeContainer[] = {
39927   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_3__reduce_cython__, METH_NOARGS, 0},
39928   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_5__setstate_cython__, METH_O, 0},
39929   {0, 0, 0, 0}
39930 };
39931 
39932 static PyTypeObject __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer = {
39933   PyVarObject_HEAD_INIT(0, 0)
39934   "yt.geometry.oct_container.ARTOctreeContainer", /*tp_name*/
39935   sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_ARTOctreeContainer), /*tp_basicsize*/
39936   0, /*tp_itemsize*/
39937   __pyx_tp_dealloc_2yt_8geometry_13oct_container_OctreeContainer, /*tp_dealloc*/
39938   0, /*tp_print*/
39939   0, /*tp_getattr*/
39940   0, /*tp_setattr*/
39941   #if PY_MAJOR_VERSION < 3
39942   0, /*tp_compare*/
39943   #endif
39944   #if PY_MAJOR_VERSION >= 3
39945   0, /*tp_as_async*/
39946   #endif
39947   0, /*tp_repr*/
39948   0, /*tp_as_number*/
39949   0, /*tp_as_sequence*/
39950   0, /*tp_as_mapping*/
39951   0, /*tp_hash*/
39952   0, /*tp_call*/
39953   0, /*tp_str*/
39954   0, /*tp_getattro*/
39955   0, /*tp_setattro*/
39956   0, /*tp_as_buffer*/
39957   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
39958   0, /*tp_doc*/
39959   __pyx_tp_traverse_2yt_8geometry_13oct_container_OctreeContainer, /*tp_traverse*/
39960   __pyx_tp_clear_2yt_8geometry_13oct_container_OctreeContainer, /*tp_clear*/
39961   0, /*tp_richcompare*/
39962   0, /*tp_weaklistoffset*/
39963   0, /*tp_iter*/
39964   0, /*tp_iternext*/
39965   __pyx_methods_2yt_8geometry_13oct_container_ARTOctreeContainer, /*tp_methods*/
39966   0, /*tp_members*/
39967   0, /*tp_getset*/
39968   0, /*tp_base*/
39969   0, /*tp_dict*/
39970   0, /*tp_descr_get*/
39971   0, /*tp_descr_set*/
39972   0, /*tp_dictoffset*/
39973   __pyx_pw_2yt_8geometry_13oct_container_18ARTOctreeContainer_1__init__, /*tp_init*/
39974   0, /*tp_alloc*/
39975   __pyx_tp_new_2yt_8geometry_13oct_container_ARTOctreeContainer, /*tp_new*/
39976   0, /*tp_free*/
39977   0, /*tp_is_gc*/
39978   0, /*tp_bases*/
39979   0, /*tp_mro*/
39980   0, /*tp_cache*/
39981   0, /*tp_subclasses*/
39982   0, /*tp_weaklist*/
39983   0, /*tp_del*/
39984   0, /*tp_version_tag*/
39985   #if PY_VERSION_HEX >= 0x030400a1
39986   0, /*tp_finalize*/
39987   #endif
39988   #if PY_VERSION_HEX >= 0x030800b1
39989   0, /*tp_vectorcall*/
39990   #endif
39991 };
39992 static struct __pyx_vtabstruct_array __pyx_vtable_array;
39993 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)39994 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
39995   struct __pyx_array_obj *p;
39996   PyObject *o;
39997   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
39998     o = (*t->tp_alloc)(t, 0);
39999   } else {
40000     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
40001   }
40002   if (unlikely(!o)) return 0;
40003   p = ((struct __pyx_array_obj *)o);
40004   p->__pyx_vtab = __pyx_vtabptr_array;
40005   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
40006   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
40007   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
40008   return o;
40009   bad:
40010   Py_DECREF(o); o = 0;
40011   return NULL;
40012 }
40013 
__pyx_tp_dealloc_array(PyObject * o)40014 static void __pyx_tp_dealloc_array(PyObject *o) {
40015   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
40016   #if CYTHON_USE_TP_FINALIZE
40017   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))) {
40018     if (PyObject_CallFinalizerFromDealloc(o)) return;
40019   }
40020   #endif
40021   {
40022     PyObject *etype, *eval, *etb;
40023     PyErr_Fetch(&etype, &eval, &etb);
40024     ++Py_REFCNT(o);
40025     __pyx_array___dealloc__(o);
40026     --Py_REFCNT(o);
40027     PyErr_Restore(etype, eval, etb);
40028   }
40029   Py_CLEAR(p->mode);
40030   Py_CLEAR(p->_format);
40031   (*Py_TYPE(o)->tp_free)(o);
40032 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)40033 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
40034   PyObject *r;
40035   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
40036   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
40037   Py_DECREF(x);
40038   return r;
40039 }
40040 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)40041 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
40042   if (v) {
40043     return __pyx_array___setitem__(o, i, v);
40044   }
40045   else {
40046     PyErr_Format(PyExc_NotImplementedError,
40047       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
40048     return -1;
40049   }
40050 }
40051 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)40052 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
40053   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
40054   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
40055     PyErr_Clear();
40056     v = __pyx_array___getattr__(o, n);
40057   }
40058   return v;
40059 }
40060 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)40061 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
40062   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
40063 }
40064 
40065 static PyMethodDef __pyx_methods_array[] = {
40066   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
40067   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
40068   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
40069   {0, 0, 0, 0}
40070 };
40071 
40072 static struct PyGetSetDef __pyx_getsets_array[] = {
40073   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
40074   {0, 0, 0, 0, 0}
40075 };
40076 
40077 static PySequenceMethods __pyx_tp_as_sequence_array = {
40078   __pyx_array___len__, /*sq_length*/
40079   0, /*sq_concat*/
40080   0, /*sq_repeat*/
40081   __pyx_sq_item_array, /*sq_item*/
40082   0, /*sq_slice*/
40083   0, /*sq_ass_item*/
40084   0, /*sq_ass_slice*/
40085   0, /*sq_contains*/
40086   0, /*sq_inplace_concat*/
40087   0, /*sq_inplace_repeat*/
40088 };
40089 
40090 static PyMappingMethods __pyx_tp_as_mapping_array = {
40091   __pyx_array___len__, /*mp_length*/
40092   __pyx_array___getitem__, /*mp_subscript*/
40093   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
40094 };
40095 
40096 static PyBufferProcs __pyx_tp_as_buffer_array = {
40097   #if PY_MAJOR_VERSION < 3
40098   0, /*bf_getreadbuffer*/
40099   #endif
40100   #if PY_MAJOR_VERSION < 3
40101   0, /*bf_getwritebuffer*/
40102   #endif
40103   #if PY_MAJOR_VERSION < 3
40104   0, /*bf_getsegcount*/
40105   #endif
40106   #if PY_MAJOR_VERSION < 3
40107   0, /*bf_getcharbuffer*/
40108   #endif
40109   __pyx_array_getbuffer, /*bf_getbuffer*/
40110   0, /*bf_releasebuffer*/
40111 };
40112 
40113 static PyTypeObject __pyx_type___pyx_array = {
40114   PyVarObject_HEAD_INIT(0, 0)
40115   "yt.geometry.oct_container.array", /*tp_name*/
40116   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
40117   0, /*tp_itemsize*/
40118   __pyx_tp_dealloc_array, /*tp_dealloc*/
40119   0, /*tp_print*/
40120   0, /*tp_getattr*/
40121   0, /*tp_setattr*/
40122   #if PY_MAJOR_VERSION < 3
40123   0, /*tp_compare*/
40124   #endif
40125   #if PY_MAJOR_VERSION >= 3
40126   0, /*tp_as_async*/
40127   #endif
40128   0, /*tp_repr*/
40129   0, /*tp_as_number*/
40130   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
40131   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
40132   0, /*tp_hash*/
40133   0, /*tp_call*/
40134   0, /*tp_str*/
40135   __pyx_tp_getattro_array, /*tp_getattro*/
40136   0, /*tp_setattro*/
40137   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
40138   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
40139   0, /*tp_doc*/
40140   0, /*tp_traverse*/
40141   0, /*tp_clear*/
40142   0, /*tp_richcompare*/
40143   0, /*tp_weaklistoffset*/
40144   0, /*tp_iter*/
40145   0, /*tp_iternext*/
40146   __pyx_methods_array, /*tp_methods*/
40147   0, /*tp_members*/
40148   __pyx_getsets_array, /*tp_getset*/
40149   0, /*tp_base*/
40150   0, /*tp_dict*/
40151   0, /*tp_descr_get*/
40152   0, /*tp_descr_set*/
40153   0, /*tp_dictoffset*/
40154   0, /*tp_init*/
40155   0, /*tp_alloc*/
40156   __pyx_tp_new_array, /*tp_new*/
40157   0, /*tp_free*/
40158   0, /*tp_is_gc*/
40159   0, /*tp_bases*/
40160   0, /*tp_mro*/
40161   0, /*tp_cache*/
40162   0, /*tp_subclasses*/
40163   0, /*tp_weaklist*/
40164   0, /*tp_del*/
40165   0, /*tp_version_tag*/
40166   #if PY_VERSION_HEX >= 0x030400a1
40167   0, /*tp_finalize*/
40168   #endif
40169   #if PY_VERSION_HEX >= 0x030800b1
40170   0, /*tp_vectorcall*/
40171   #endif
40172 };
40173 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)40174 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
40175   struct __pyx_MemviewEnum_obj *p;
40176   PyObject *o;
40177   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
40178     o = (*t->tp_alloc)(t, 0);
40179   } else {
40180     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
40181   }
40182   if (unlikely(!o)) return 0;
40183   p = ((struct __pyx_MemviewEnum_obj *)o);
40184   p->name = Py_None; Py_INCREF(Py_None);
40185   return o;
40186 }
40187 
__pyx_tp_dealloc_Enum(PyObject * o)40188 static void __pyx_tp_dealloc_Enum(PyObject *o) {
40189   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
40190   #if CYTHON_USE_TP_FINALIZE
40191   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
40192     if (PyObject_CallFinalizerFromDealloc(o)) return;
40193   }
40194   #endif
40195   PyObject_GC_UnTrack(o);
40196   Py_CLEAR(p->name);
40197   (*Py_TYPE(o)->tp_free)(o);
40198 }
40199 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)40200 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
40201   int e;
40202   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
40203   if (p->name) {
40204     e = (*v)(p->name, a); if (e) return e;
40205   }
40206   return 0;
40207 }
40208 
__pyx_tp_clear_Enum(PyObject * o)40209 static int __pyx_tp_clear_Enum(PyObject *o) {
40210   PyObject* tmp;
40211   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
40212   tmp = ((PyObject*)p->name);
40213   p->name = Py_None; Py_INCREF(Py_None);
40214   Py_XDECREF(tmp);
40215   return 0;
40216 }
40217 
40218 static PyMethodDef __pyx_methods_Enum[] = {
40219   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
40220   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
40221   {0, 0, 0, 0}
40222 };
40223 
40224 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
40225   PyVarObject_HEAD_INIT(0, 0)
40226   "yt.geometry.oct_container.Enum", /*tp_name*/
40227   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
40228   0, /*tp_itemsize*/
40229   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
40230   0, /*tp_print*/
40231   0, /*tp_getattr*/
40232   0, /*tp_setattr*/
40233   #if PY_MAJOR_VERSION < 3
40234   0, /*tp_compare*/
40235   #endif
40236   #if PY_MAJOR_VERSION >= 3
40237   0, /*tp_as_async*/
40238   #endif
40239   __pyx_MemviewEnum___repr__, /*tp_repr*/
40240   0, /*tp_as_number*/
40241   0, /*tp_as_sequence*/
40242   0, /*tp_as_mapping*/
40243   0, /*tp_hash*/
40244   0, /*tp_call*/
40245   0, /*tp_str*/
40246   0, /*tp_getattro*/
40247   0, /*tp_setattro*/
40248   0, /*tp_as_buffer*/
40249   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
40250   0, /*tp_doc*/
40251   __pyx_tp_traverse_Enum, /*tp_traverse*/
40252   __pyx_tp_clear_Enum, /*tp_clear*/
40253   0, /*tp_richcompare*/
40254   0, /*tp_weaklistoffset*/
40255   0, /*tp_iter*/
40256   0, /*tp_iternext*/
40257   __pyx_methods_Enum, /*tp_methods*/
40258   0, /*tp_members*/
40259   0, /*tp_getset*/
40260   0, /*tp_base*/
40261   0, /*tp_dict*/
40262   0, /*tp_descr_get*/
40263   0, /*tp_descr_set*/
40264   0, /*tp_dictoffset*/
40265   __pyx_MemviewEnum___init__, /*tp_init*/
40266   0, /*tp_alloc*/
40267   __pyx_tp_new_Enum, /*tp_new*/
40268   0, /*tp_free*/
40269   0, /*tp_is_gc*/
40270   0, /*tp_bases*/
40271   0, /*tp_mro*/
40272   0, /*tp_cache*/
40273   0, /*tp_subclasses*/
40274   0, /*tp_weaklist*/
40275   0, /*tp_del*/
40276   0, /*tp_version_tag*/
40277   #if PY_VERSION_HEX >= 0x030400a1
40278   0, /*tp_finalize*/
40279   #endif
40280   #if PY_VERSION_HEX >= 0x030800b1
40281   0, /*tp_vectorcall*/
40282   #endif
40283 };
40284 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
40285 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)40286 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
40287   struct __pyx_memoryview_obj *p;
40288   PyObject *o;
40289   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
40290     o = (*t->tp_alloc)(t, 0);
40291   } else {
40292     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
40293   }
40294   if (unlikely(!o)) return 0;
40295   p = ((struct __pyx_memoryview_obj *)o);
40296   p->__pyx_vtab = __pyx_vtabptr_memoryview;
40297   p->obj = Py_None; Py_INCREF(Py_None);
40298   p->_size = Py_None; Py_INCREF(Py_None);
40299   p->_array_interface = Py_None; Py_INCREF(Py_None);
40300   p->view.obj = NULL;
40301   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
40302   return o;
40303   bad:
40304   Py_DECREF(o); o = 0;
40305   return NULL;
40306 }
40307 
__pyx_tp_dealloc_memoryview(PyObject * o)40308 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
40309   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
40310   #if CYTHON_USE_TP_FINALIZE
40311   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
40312     if (PyObject_CallFinalizerFromDealloc(o)) return;
40313   }
40314   #endif
40315   PyObject_GC_UnTrack(o);
40316   {
40317     PyObject *etype, *eval, *etb;
40318     PyErr_Fetch(&etype, &eval, &etb);
40319     ++Py_REFCNT(o);
40320     __pyx_memoryview___dealloc__(o);
40321     --Py_REFCNT(o);
40322     PyErr_Restore(etype, eval, etb);
40323   }
40324   Py_CLEAR(p->obj);
40325   Py_CLEAR(p->_size);
40326   Py_CLEAR(p->_array_interface);
40327   (*Py_TYPE(o)->tp_free)(o);
40328 }
40329 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)40330 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
40331   int e;
40332   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
40333   if (p->obj) {
40334     e = (*v)(p->obj, a); if (e) return e;
40335   }
40336   if (p->_size) {
40337     e = (*v)(p->_size, a); if (e) return e;
40338   }
40339   if (p->_array_interface) {
40340     e = (*v)(p->_array_interface, a); if (e) return e;
40341   }
40342   if (p->view.obj) {
40343     e = (*v)(p->view.obj, a); if (e) return e;
40344   }
40345   return 0;
40346 }
40347 
__pyx_tp_clear_memoryview(PyObject * o)40348 static int __pyx_tp_clear_memoryview(PyObject *o) {
40349   PyObject* tmp;
40350   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
40351   tmp = ((PyObject*)p->obj);
40352   p->obj = Py_None; Py_INCREF(Py_None);
40353   Py_XDECREF(tmp);
40354   tmp = ((PyObject*)p->_size);
40355   p->_size = Py_None; Py_INCREF(Py_None);
40356   Py_XDECREF(tmp);
40357   tmp = ((PyObject*)p->_array_interface);
40358   p->_array_interface = Py_None; Py_INCREF(Py_None);
40359   Py_XDECREF(tmp);
40360   Py_CLEAR(p->view.obj);
40361   return 0;
40362 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)40363 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
40364   PyObject *r;
40365   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
40366   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
40367   Py_DECREF(x);
40368   return r;
40369 }
40370 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)40371 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
40372   if (v) {
40373     return __pyx_memoryview___setitem__(o, i, v);
40374   }
40375   else {
40376     PyErr_Format(PyExc_NotImplementedError,
40377       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
40378     return -1;
40379   }
40380 }
40381 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)40382 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
40383   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
40384 }
40385 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)40386 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
40387   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
40388 }
40389 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)40390 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
40391   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
40392 }
40393 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)40394 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
40395   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
40396 }
40397 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)40398 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
40399   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
40400 }
40401 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)40402 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
40403   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
40404 }
40405 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)40406 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
40407   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
40408 }
40409 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)40410 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
40411   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
40412 }
40413 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)40414 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
40415   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
40416 }
40417 
40418 static PyMethodDef __pyx_methods_memoryview[] = {
40419   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
40420   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
40421   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
40422   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
40423   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
40424   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
40425   {0, 0, 0, 0}
40426 };
40427 
40428 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
40429   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
40430   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
40431   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
40432   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
40433   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
40434   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
40435   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
40436   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
40437   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
40438   {0, 0, 0, 0, 0}
40439 };
40440 
40441 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
40442   __pyx_memoryview___len__, /*sq_length*/
40443   0, /*sq_concat*/
40444   0, /*sq_repeat*/
40445   __pyx_sq_item_memoryview, /*sq_item*/
40446   0, /*sq_slice*/
40447   0, /*sq_ass_item*/
40448   0, /*sq_ass_slice*/
40449   0, /*sq_contains*/
40450   0, /*sq_inplace_concat*/
40451   0, /*sq_inplace_repeat*/
40452 };
40453 
40454 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
40455   __pyx_memoryview___len__, /*mp_length*/
40456   __pyx_memoryview___getitem__, /*mp_subscript*/
40457   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
40458 };
40459 
40460 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
40461   #if PY_MAJOR_VERSION < 3
40462   0, /*bf_getreadbuffer*/
40463   #endif
40464   #if PY_MAJOR_VERSION < 3
40465   0, /*bf_getwritebuffer*/
40466   #endif
40467   #if PY_MAJOR_VERSION < 3
40468   0, /*bf_getsegcount*/
40469   #endif
40470   #if PY_MAJOR_VERSION < 3
40471   0, /*bf_getcharbuffer*/
40472   #endif
40473   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
40474   0, /*bf_releasebuffer*/
40475 };
40476 
40477 static PyTypeObject __pyx_type___pyx_memoryview = {
40478   PyVarObject_HEAD_INIT(0, 0)
40479   "yt.geometry.oct_container.memoryview", /*tp_name*/
40480   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
40481   0, /*tp_itemsize*/
40482   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
40483   0, /*tp_print*/
40484   0, /*tp_getattr*/
40485   0, /*tp_setattr*/
40486   #if PY_MAJOR_VERSION < 3
40487   0, /*tp_compare*/
40488   #endif
40489   #if PY_MAJOR_VERSION >= 3
40490   0, /*tp_as_async*/
40491   #endif
40492   __pyx_memoryview___repr__, /*tp_repr*/
40493   0, /*tp_as_number*/
40494   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
40495   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
40496   0, /*tp_hash*/
40497   0, /*tp_call*/
40498   __pyx_memoryview___str__, /*tp_str*/
40499   0, /*tp_getattro*/
40500   0, /*tp_setattro*/
40501   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
40502   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
40503   0, /*tp_doc*/
40504   __pyx_tp_traverse_memoryview, /*tp_traverse*/
40505   __pyx_tp_clear_memoryview, /*tp_clear*/
40506   0, /*tp_richcompare*/
40507   0, /*tp_weaklistoffset*/
40508   0, /*tp_iter*/
40509   0, /*tp_iternext*/
40510   __pyx_methods_memoryview, /*tp_methods*/
40511   0, /*tp_members*/
40512   __pyx_getsets_memoryview, /*tp_getset*/
40513   0, /*tp_base*/
40514   0, /*tp_dict*/
40515   0, /*tp_descr_get*/
40516   0, /*tp_descr_set*/
40517   0, /*tp_dictoffset*/
40518   0, /*tp_init*/
40519   0, /*tp_alloc*/
40520   __pyx_tp_new_memoryview, /*tp_new*/
40521   0, /*tp_free*/
40522   0, /*tp_is_gc*/
40523   0, /*tp_bases*/
40524   0, /*tp_mro*/
40525   0, /*tp_cache*/
40526   0, /*tp_subclasses*/
40527   0, /*tp_weaklist*/
40528   0, /*tp_del*/
40529   0, /*tp_version_tag*/
40530   #if PY_VERSION_HEX >= 0x030400a1
40531   0, /*tp_finalize*/
40532   #endif
40533   #if PY_VERSION_HEX >= 0x030800b1
40534   0, /*tp_vectorcall*/
40535   #endif
40536 };
40537 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
40538 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)40539 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
40540   struct __pyx_memoryviewslice_obj *p;
40541   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
40542   if (unlikely(!o)) return 0;
40543   p = ((struct __pyx_memoryviewslice_obj *)o);
40544   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
40545   p->from_object = Py_None; Py_INCREF(Py_None);
40546   p->from_slice.memview = NULL;
40547   return o;
40548 }
40549 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)40550 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
40551   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
40552   #if CYTHON_USE_TP_FINALIZE
40553   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
40554     if (PyObject_CallFinalizerFromDealloc(o)) return;
40555   }
40556   #endif
40557   PyObject_GC_UnTrack(o);
40558   {
40559     PyObject *etype, *eval, *etb;
40560     PyErr_Fetch(&etype, &eval, &etb);
40561     ++Py_REFCNT(o);
40562     __pyx_memoryviewslice___dealloc__(o);
40563     --Py_REFCNT(o);
40564     PyErr_Restore(etype, eval, etb);
40565   }
40566   Py_CLEAR(p->from_object);
40567   PyObject_GC_Track(o);
40568   __pyx_tp_dealloc_memoryview(o);
40569 }
40570 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)40571 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
40572   int e;
40573   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
40574   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
40575   if (p->from_object) {
40576     e = (*v)(p->from_object, a); if (e) return e;
40577   }
40578   return 0;
40579 }
40580 
__pyx_tp_clear__memoryviewslice(PyObject * o)40581 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
40582   PyObject* tmp;
40583   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
40584   __pyx_tp_clear_memoryview(o);
40585   tmp = ((PyObject*)p->from_object);
40586   p->from_object = Py_None; Py_INCREF(Py_None);
40587   Py_XDECREF(tmp);
40588   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
40589   return 0;
40590 }
40591 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)40592 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
40593   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
40594 }
40595 
40596 static PyMethodDef __pyx_methods__memoryviewslice[] = {
40597   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
40598   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
40599   {0, 0, 0, 0}
40600 };
40601 
40602 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
40603   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
40604   {0, 0, 0, 0, 0}
40605 };
40606 
40607 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
40608   PyVarObject_HEAD_INIT(0, 0)
40609   "yt.geometry.oct_container._memoryviewslice", /*tp_name*/
40610   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
40611   0, /*tp_itemsize*/
40612   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
40613   0, /*tp_print*/
40614   0, /*tp_getattr*/
40615   0, /*tp_setattr*/
40616   #if PY_MAJOR_VERSION < 3
40617   0, /*tp_compare*/
40618   #endif
40619   #if PY_MAJOR_VERSION >= 3
40620   0, /*tp_as_async*/
40621   #endif
40622   #if CYTHON_COMPILING_IN_PYPY
40623   __pyx_memoryview___repr__, /*tp_repr*/
40624   #else
40625   0, /*tp_repr*/
40626   #endif
40627   0, /*tp_as_number*/
40628   0, /*tp_as_sequence*/
40629   0, /*tp_as_mapping*/
40630   0, /*tp_hash*/
40631   0, /*tp_call*/
40632   #if CYTHON_COMPILING_IN_PYPY
40633   __pyx_memoryview___str__, /*tp_str*/
40634   #else
40635   0, /*tp_str*/
40636   #endif
40637   0, /*tp_getattro*/
40638   0, /*tp_setattro*/
40639   0, /*tp_as_buffer*/
40640   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
40641   "Internal class for passing memoryview slices to Python", /*tp_doc*/
40642   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
40643   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
40644   0, /*tp_richcompare*/
40645   0, /*tp_weaklistoffset*/
40646   0, /*tp_iter*/
40647   0, /*tp_iternext*/
40648   __pyx_methods__memoryviewslice, /*tp_methods*/
40649   0, /*tp_members*/
40650   __pyx_getsets__memoryviewslice, /*tp_getset*/
40651   0, /*tp_base*/
40652   0, /*tp_dict*/
40653   0, /*tp_descr_get*/
40654   0, /*tp_descr_set*/
40655   0, /*tp_dictoffset*/
40656   0, /*tp_init*/
40657   0, /*tp_alloc*/
40658   __pyx_tp_new__memoryviewslice, /*tp_new*/
40659   0, /*tp_free*/
40660   0, /*tp_is_gc*/
40661   0, /*tp_bases*/
40662   0, /*tp_mro*/
40663   0, /*tp_cache*/
40664   0, /*tp_subclasses*/
40665   0, /*tp_weaklist*/
40666   0, /*tp_del*/
40667   0, /*tp_version_tag*/
40668   #if PY_VERSION_HEX >= 0x030400a1
40669   0, /*tp_finalize*/
40670   #endif
40671   #if PY_VERSION_HEX >= 0x030800b1
40672   0, /*tp_vectorcall*/
40673   #endif
40674 };
40675 
40676 static PyMethodDef __pyx_methods[] = {
40677   {0, 0, 0, 0}
40678 };
40679 
40680 #if PY_MAJOR_VERSION >= 3
40681 #if CYTHON_PEP489_MULTI_PHASE_INIT
40682 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
40683 static int __pyx_pymod_exec_oct_container(PyObject* module); /*proto*/
40684 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
40685   {Py_mod_create, (void*)__pyx_pymod_create},
40686   {Py_mod_exec, (void*)__pyx_pymod_exec_oct_container},
40687   {0, NULL}
40688 };
40689 #endif
40690 
40691 static struct PyModuleDef __pyx_moduledef = {
40692     PyModuleDef_HEAD_INIT,
40693     "oct_container",
40694     __pyx_k_Oct_container, /* m_doc */
40695   #if CYTHON_PEP489_MULTI_PHASE_INIT
40696     0, /* m_size */
40697   #else
40698     -1, /* m_size */
40699   #endif
40700     __pyx_methods /* m_methods */,
40701   #if CYTHON_PEP489_MULTI_PHASE_INIT
40702     __pyx_moduledef_slots, /* m_slots */
40703   #else
40704     NULL, /* m_reload */
40705   #endif
40706     NULL, /* m_traverse */
40707     NULL, /* m_clear */
40708     NULL /* m_free */
40709 };
40710 #endif
40711 #ifndef CYTHON_SMALL_CODE
40712 #if defined(__clang__)
40713     #define CYTHON_SMALL_CODE
40714 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
40715     #define CYTHON_SMALL_CODE __attribute__((cold))
40716 #else
40717     #define CYTHON_SMALL_CODE
40718 #endif
40719 #endif
40720 
40721 static __Pyx_StringTabEntry __pyx_string_tab[] = {
40722   {&__pyx_n_s_ARTOctreeContainer, __pyx_k_ARTOctreeContainer, sizeof(__pyx_k_ARTOctreeContainer), 0, 0, 1, 1},
40723   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
40724   {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
40725   {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
40726   {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
40727   {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
40728   {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
40729   {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
40730   {&__pyx_kp_s_DEST_INDEX_RAN_AHEAD, __pyx_k_DEST_INDEX_RAN_AHEAD, sizeof(__pyx_k_DEST_INDEX_RAN_AHEAD), 0, 0, 1, 0},
40731   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
40732   {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
40733   {&__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},
40734   {&__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},
40735   {&__pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD, __pyx_k_GLOBAL_INDEX_RAN_AHEAD, sizeof(__pyx_k_GLOBAL_INDEX_RAN_AHEAD), 0, 0, 1, 0},
40736   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
40737   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
40738   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
40739   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
40740   {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
40741   {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
40742   {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
40743   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
40744   {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
40745   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
40746   {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
40747   {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
40748   {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
40749   {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
40750   {&__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},
40751   {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
40752   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
40753   {&__pyx_n_s_ORDER_MAX, __pyx_k_ORDER_MAX, sizeof(__pyx_k_ORDER_MAX), 0, 0, 1, 1},
40754   {&__pyx_n_s_ORDER_MAX_2, __pyx_k_ORDER_MAX_2, sizeof(__pyx_k_ORDER_MAX_2), 0, 0, 1, 1},
40755   {&__pyx_n_s_OctObjectPool, __pyx_k_OctObjectPool, sizeof(__pyx_k_OctObjectPool), 0, 0, 1, 1},
40756   {&__pyx_n_s_OctreeContainer, __pyx_k_OctreeContainer, sizeof(__pyx_k_OctreeContainer), 0, 0, 1, 1},
40757   {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
40758   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
40759   {&__pyx_n_s_RAMSESOctreeContainer, __pyx_k_RAMSESOctreeContainer, sizeof(__pyx_k_RAMSESOctreeContainer), 0, 0, 1, 1},
40760   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
40761   {&__pyx_n_s_SparseOctreeContainer, __pyx_k_SparseOctreeContainer, sizeof(__pyx_k_SparseOctreeContainer), 0, 0, 1, 1},
40762   {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
40763   {&__pyx_kp_s_Too_many_assigned, __pyx_k_Too_many_assigned, sizeof(__pyx_k_Too_many_assigned), 0, 0, 1, 0},
40764   {&__pyx_kp_s_Too_many_roots, __pyx_k_Too_many_roots, sizeof(__pyx_k_Too_many_roots), 0, 0, 1, 0},
40765   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
40766   {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
40767   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
40768   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
40769   {&__pyx_kp_b__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 0, 0},
40770   {&__pyx_kp_b__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 0, 0},
40771   {&__pyx_kp_b__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 0, 0},
40772   {&__pyx_kp_b__45, __pyx_k__45, sizeof(__pyx_k__45), 0, 0, 0, 0},
40773   {&__pyx_kp_u__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 1, 0, 0},
40774   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
40775   {&__pyx_n_s_allocate_domains, __pyx_k_allocate_domains, sizeof(__pyx_k_allocate_domains), 0, 0, 1, 1},
40776   {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
40777   {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
40778   {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
40779   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
40780   {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
40781   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
40782   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
40783   {&__pyx_n_s_cell_inds, __pyx_k_cell_inds, sizeof(__pyx_k_cell_inds), 0, 0, 1, 1},
40784   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
40785   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
40786   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
40787   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
40788   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
40789   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
40790   {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
40791   {&__pyx_n_s_count_boundary, __pyx_k_count_boundary, sizeof(__pyx_k_count_boundary), 0, 0, 1, 1},
40792   {&__pyx_n_s_count_oct_cells, __pyx_k_count_oct_cells, sizeof(__pyx_k_count_oct_cells), 0, 0, 1, 1},
40793   {&__pyx_n_s_count_octs, __pyx_k_count_octs, sizeof(__pyx_k_count_octs), 0, 0, 1, 1},
40794   {&__pyx_n_s_curdom, __pyx_k_curdom, sizeof(__pyx_k_curdom), 0, 0, 1, 1},
40795   {&__pyx_n_s_curlevel, __pyx_k_curlevel, sizeof(__pyx_k_curlevel), 0, 0, 1, 1},
40796   {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
40797   {&__pyx_n_s_dest_fields, __pyx_k_dest_fields, sizeof(__pyx_k_dest_fields), 0, 0, 1, 1},
40798   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
40799   {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
40800   {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1},
40801   {&__pyx_n_s_domain_counts, __pyx_k_domain_counts, sizeof(__pyx_k_domain_counts), 0, 0, 1, 1},
40802   {&__pyx_n_s_domain_dimensions, __pyx_k_domain_dimensions, sizeof(__pyx_k_domain_dimensions), 0, 0, 1, 1},
40803   {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1},
40804   {&__pyx_n_s_domain_ind, __pyx_k_domain_ind, sizeof(__pyx_k_domain_ind), 0, 0, 1, 1},
40805   {&__pyx_n_s_domain_left_edge, __pyx_k_domain_left_edge, sizeof(__pyx_k_domain_left_edge), 0, 0, 1, 1},
40806   {&__pyx_n_s_domain_right_edge, __pyx_k_domain_right_edge, sizeof(__pyx_k_domain_right_edge), 0, 0, 1, 1},
40807   {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1},
40808   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
40809   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
40810   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
40811   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
40812   {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
40813   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
40814   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
40815   {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
40816   {&__pyx_n_s_file_ind, __pyx_k_file_ind, sizeof(__pyx_k_file_ind), 0, 0, 1, 1},
40817   {&__pyx_n_s_file_inds, __pyx_k_file_inds, sizeof(__pyx_k_file_inds), 0, 0, 1, 1},
40818   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
40819   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
40820   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
40821   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
40822   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
40823   {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
40824   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
40825   {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
40826   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
40827   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
40828   {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
40829   {&__pyx_n_s_initialize_root_mesh, __pyx_k_initialize_root_mesh, sizeof(__pyx_k_initialize_root_mesh), 0, 0, 1, 1},
40830   {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
40831   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
40832   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
40833   {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
40834   {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
40835   {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1},
40836   {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
40837   {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1},
40838   {&__pyx_n_s_load_octree, __pyx_k_load_octree, sizeof(__pyx_k_load_octree), 0, 0, 1, 1},
40839   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
40840   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
40841   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
40842   {&__pyx_n_s_n_ghost_zones, __pyx_k_n_ghost_zones, sizeof(__pyx_k_n_ghost_zones), 0, 0, 1, 1},
40843   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
40844   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
40845   {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
40846   {&__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},
40847   {&__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},
40848   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
40849   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
40850   {&__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},
40851   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
40852   {&__pyx_n_s_num_cells, __pyx_k_num_cells, sizeof(__pyx_k_num_cells), 0, 0, 1, 1},
40853   {&__pyx_n_s_num_octs, __pyx_k_num_octs, sizeof(__pyx_k_num_octs), 0, 0, 1, 1},
40854   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
40855   {&__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},
40856   {&__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},
40857   {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1},
40858   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
40859   {&__pyx_n_s_oct_domain_dimensions, __pyx_k_oct_domain_dimensions, sizeof(__pyx_k_oct_domain_dimensions), 0, 0, 1, 1},
40860   {&__pyx_n_s_octree, __pyx_k_octree, sizeof(__pyx_k_octree), 0, 0, 1, 1},
40861   {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
40862   {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
40863   {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
40864   {&__pyx_n_s_over_refine, __pyx_k_over_refine, sizeof(__pyx_k_over_refine), 0, 0, 1, 1},
40865   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
40866   {&__pyx_n_s_padding, __pyx_k_padding, sizeof(__pyx_k_padding), 0, 0, 1, 1},
40867   {&__pyx_n_s_partial_coverage, __pyx_k_partial_coverage, sizeof(__pyx_k_partial_coverage), 0, 0, 1, 1},
40868   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
40869   {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
40870   {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
40871   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
40872   {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
40873   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
40874   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
40875   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
40876   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
40877   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
40878   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
40879   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
40880   {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
40881   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
40882   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
40883   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
40884   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
40885   {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
40886   {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1},
40887   {&__pyx_n_s_root_nodes, __pyx_k_root_nodes, sizeof(__pyx_k_root_nodes), 0, 0, 1, 1},
40888   {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
40889   {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1},
40890   {&__pyx_kp_s_self_root_mesh_cannot_be_convert, __pyx_k_self_root_mesh_cannot_be_convert, sizeof(__pyx_k_self_root_mesh_cannot_be_convert), 0, 0, 1, 0},
40891   {&__pyx_kp_s_self_root_mesh_self_root_nodes_s, __pyx_k_self_root_mesh_self_root_nodes_s, sizeof(__pyx_k_self_root_mesh_self_root_nodes_s), 0, 0, 1, 0},
40892   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
40893   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
40894   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
40895   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
40896   {&__pyx_n_s_skip_boundary, __pyx_k_skip_boundary, sizeof(__pyx_k_skip_boundary), 0, 0, 1, 1},
40897   {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
40898   {&__pyx_n_s_source_fields, __pyx_k_source_fields, sizeof(__pyx_k_source_fields), 0, 0, 1, 1},
40899   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
40900   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
40901   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
40902   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
40903   {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
40904   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
40905   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
40906   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
40907   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
40908   {&__pyx_n_s_to_arrays, __pyx_k_to_arrays, sizeof(__pyx_k_to_arrays), 0, 0, 1, 1},
40909   {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
40910   {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
40911   {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
40912   {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
40913   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
40914   {&__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},
40915   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
40916   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
40917   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
40918   {0, 0, 0, 0, 0, 0, 0}
40919 };
__Pyx_InitCachedBuiltins(void)40920 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
40921   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 55, __pyx_L1_error)
40922   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 120, __pyx_L1_error)
40923   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 138, __pyx_L1_error)
40924   __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 538, __pyx_L1_error)
40925   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 628, __pyx_L1_error)
40926   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
40927   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
40928   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
40929   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
40930   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
40931   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
40932   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
40933   return 0;
40934   __pyx_L1_error:;
40935   return -1;
40936 }
40937 
__Pyx_InitCachedConstants(void)40938 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
40939   __Pyx_RefNannyDeclarations
40940   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
40941 
40942   /* "yt/geometry/oct_container.pyx":89
40943  *                 partial_coverage = header['partial_coverage'])
40944  *         # NOTE: We do not allow domain/file indices to be specified.
40945  *         cdef SelectorObject selector = AlwaysSelector(None)             # <<<<<<<<<<<<<<
40946  *         cdef oct_visitors.LoadOctree visitor
40947  *         visitor = oct_visitors.LoadOctree(obj, -1)
40948  */
40949   __pyx_tuple_ = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 89, __pyx_L1_error)
40950   __Pyx_GOTREF(__pyx_tuple_);
40951   __Pyx_GIVEREF(__pyx_tuple_);
40952 
40953   /* "yt/geometry/oct_container.pyx":452
40954  *         for i in range(3):
40955  *             base_dx = (self.DRE[i] - self.DLE[i])/self.nn[i]
40956  *             fwidth[:,i] *= base_dx             # <<<<<<<<<<<<<<
40957  *         return fwidth
40958  *
40959  */
40960   __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 452, __pyx_L1_error)
40961   __Pyx_GOTREF(__pyx_slice__2);
40962   __Pyx_GIVEREF(__pyx_slice__2);
40963 
40964   /* "yt/geometry/oct_container.pyx":544
40965  *         self.visit_all_octs(selector, visitor)
40966  *         if (visitor.global_index + 1) * visitor.nz * visitor.dims > source.size:
40967  *             print("GLOBAL INDEX RAN AHEAD.",)             # <<<<<<<<<<<<<<
40968  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims - source.size
40969  *             print(dest.size, source.size, num_cells)
40970  */
40971   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_GLOBAL_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 544, __pyx_L1_error)
40972   __Pyx_GOTREF(__pyx_tuple__3);
40973   __Pyx_GIVEREF(__pyx_tuple__3);
40974 
40975   /* "yt/geometry/oct_container.pyx":549
40976  *             raise RuntimeError
40977  *         if visitor.index > dest.size:
40978  *             print("DEST INDEX RAN AHEAD.",)             # <<<<<<<<<<<<<<
40979  *             print(visitor.index - dest.size)
40980  *             print (visitor.global_index + 1) * visitor.nz * visitor.dims, source.size
40981  */
40982   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_DEST_INDEX_RAN_AHEAD); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 549, __pyx_L1_error)
40983   __Pyx_GOTREF(__pyx_tuple__4);
40984   __Pyx_GIVEREF(__pyx_tuple__4);
40985 
40986   /* "(tree fragment)":2
40987  * def __reduce_cython__(self):
40988  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
40989  * def __setstate_cython__(self, __pyx_state):
40990  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
40991  */
40992   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error)
40993   __Pyx_GOTREF(__pyx_tuple__6);
40994   __Pyx_GIVEREF(__pyx_tuple__6);
40995 
40996   /* "(tree fragment)":4
40997  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
40998  * def __setstate_cython__(self, __pyx_state):
40999  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
41000  */
41001   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error)
41002   __Pyx_GOTREF(__pyx_tuple__7);
41003   __Pyx_GIVEREF(__pyx_tuple__7);
41004 
41005   /* "(tree fragment)":2
41006  * def __reduce_cython__(self):
41007  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
41008  * def __setstate_cython__(self, __pyx_state):
41009  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
41010  */
41011   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
41012   __Pyx_GOTREF(__pyx_tuple__8);
41013   __Pyx_GIVEREF(__pyx_tuple__8);
41014 
41015   /* "(tree fragment)":4
41016  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")
41017  * def __setstate_cython__(self, __pyx_state):
41018  *     raise TypeError("self.root_mesh,self.root_nodes,self.tree_root cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
41019  */
41020   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_self_root_nodes_s); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
41021   __Pyx_GOTREF(__pyx_tuple__9);
41022   __Pyx_GIVEREF(__pyx_tuple__9);
41023 
41024   /* "(tree fragment)":2
41025  * def __reduce_cython__(self):
41026  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
41027  * def __setstate_cython__(self, __pyx_state):
41028  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
41029  */
41030   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error)
41031   __Pyx_GOTREF(__pyx_tuple__10);
41032   __Pyx_GIVEREF(__pyx_tuple__10);
41033 
41034   /* "(tree fragment)":4
41035  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")
41036  * def __setstate_cython__(self, __pyx_state):
41037  *     raise TypeError("self.root_mesh cannot be converted to a Python object for pickling")             # <<<<<<<<<<<<<<
41038  */
41039   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_root_mesh_cannot_be_convert); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error)
41040   __Pyx_GOTREF(__pyx_tuple__11);
41041   __Pyx_GIVEREF(__pyx_tuple__11);
41042 
41043   /* "(tree fragment)":2
41044  * def __reduce_cython__(self):
41045  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41046  * def __setstate_cython__(self, __pyx_state):
41047  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41048  */
41049   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
41050   __Pyx_GOTREF(__pyx_tuple__12);
41051   __Pyx_GIVEREF(__pyx_tuple__12);
41052 
41053   /* "(tree fragment)":4
41054  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41055  * def __setstate_cython__(self, __pyx_state):
41056  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41057  */
41058   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
41059   __Pyx_GOTREF(__pyx_tuple__13);
41060   __Pyx_GIVEREF(__pyx_tuple__13);
41061 
41062   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
41063  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
41064  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
41065  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
41066  *
41067  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
41068  */
41069   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 272, __pyx_L1_error)
41070   __Pyx_GOTREF(__pyx_tuple__14);
41071   __Pyx_GIVEREF(__pyx_tuple__14);
41072 
41073   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
41074  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
41075  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
41076  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
41077  *
41078  *             info.buf = PyArray_DATA(self)
41079  */
41080   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 276, __pyx_L1_error)
41081   __Pyx_GOTREF(__pyx_tuple__15);
41082   __Pyx_GIVEREF(__pyx_tuple__15);
41083 
41084   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
41085  *                 if ((descr.byteorder == c'>' and little_endian) or
41086  *                     (descr.byteorder == c'<' and not little_endian)):
41087  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
41088  *                 if   t == NPY_BYTE:        f = "b"
41089  *                 elif t == NPY_UBYTE:       f = "B"
41090  */
41091   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 306, __pyx_L1_error)
41092   __Pyx_GOTREF(__pyx_tuple__16);
41093   __Pyx_GIVEREF(__pyx_tuple__16);
41094 
41095   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
41096  *
41097  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
41098  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
41099  *
41100  *         if ((child.byteorder == c'>' and little_endian) or
41101  */
41102   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 856, __pyx_L1_error)
41103   __Pyx_GOTREF(__pyx_tuple__17);
41104   __Pyx_GIVEREF(__pyx_tuple__17);
41105 
41106   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
41107  *             t = child.type_num
41108  *             if end - f < 5:
41109  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
41110  *
41111  *             # Until ticket #99 is fixed, use integers to avoid warnings
41112  */
41113   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 880, __pyx_L1_error)
41114   __Pyx_GOTREF(__pyx_tuple__18);
41115   __Pyx_GIVEREF(__pyx_tuple__18);
41116 
41117   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
41118  *         _import_array()
41119  *     except Exception:
41120  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
41121  *
41122  * cdef inline int import_umath() except -1:
41123  */
41124   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 1038, __pyx_L1_error)
41125   __Pyx_GOTREF(__pyx_tuple__19);
41126   __Pyx_GIVEREF(__pyx_tuple__19);
41127 
41128   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
41129  *         _import_umath()
41130  *     except Exception:
41131  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
41132  *
41133  * cdef inline int import_ufunc() except -1:
41134  */
41135   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(3, 1044, __pyx_L1_error)
41136   __Pyx_GOTREF(__pyx_tuple__20);
41137   __Pyx_GIVEREF(__pyx_tuple__20);
41138 
41139   /* "FromPyStructUtility":19
41140  *         value = obj['file_ind']
41141  *     except KeyError:
41142  *         raise ValueError("No value specified for struct attribute 'file_ind'")             # <<<<<<<<<<<<<<
41143  *     result.file_ind = value
41144  *     try:
41145  */
41146   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 19, __pyx_L1_error)
41147   __Pyx_GOTREF(__pyx_tuple__21);
41148   __Pyx_GIVEREF(__pyx_tuple__21);
41149 
41150   /* "FromPyStructUtility":24
41151  *         value = obj['domain_ind']
41152  *     except KeyError:
41153  *         raise ValueError("No value specified for struct attribute 'domain_ind'")             # <<<<<<<<<<<<<<
41154  *     result.domain_ind = value
41155  *     try:
41156  */
41157   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 24, __pyx_L1_error)
41158   __Pyx_GOTREF(__pyx_tuple__22);
41159   __Pyx_GIVEREF(__pyx_tuple__22);
41160 
41161   /* "FromPyStructUtility":29
41162  *         value = obj['domain']
41163  *     except KeyError:
41164  *         raise ValueError("No value specified for struct attribute 'domain'")             # <<<<<<<<<<<<<<
41165  *     result.domain = value
41166  *     try:
41167  */
41168   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 29, __pyx_L1_error)
41169   __Pyx_GOTREF(__pyx_tuple__23);
41170   __Pyx_GIVEREF(__pyx_tuple__23);
41171 
41172   /* "FromPyStructUtility":34
41173  *         value = obj['padding']
41174  *     except KeyError:
41175  *         raise ValueError("No value specified for struct attribute 'padding'")             # <<<<<<<<<<<<<<
41176  *     result.padding = value
41177  *     return result
41178  */
41179   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 34, __pyx_L1_error)
41180   __Pyx_GOTREF(__pyx_tuple__24);
41181   __Pyx_GIVEREF(__pyx_tuple__24);
41182 
41183   /* "View.MemoryView":133
41184  *
41185  *         if not self.ndim:
41186  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
41187  *
41188  *         if itemsize <= 0:
41189  */
41190   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 133, __pyx_L1_error)
41191   __Pyx_GOTREF(__pyx_tuple__25);
41192   __Pyx_GIVEREF(__pyx_tuple__25);
41193 
41194   /* "View.MemoryView":136
41195  *
41196  *         if itemsize <= 0:
41197  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
41198  *
41199  *         if not isinstance(format, bytes):
41200  */
41201   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 136, __pyx_L1_error)
41202   __Pyx_GOTREF(__pyx_tuple__26);
41203   __Pyx_GIVEREF(__pyx_tuple__26);
41204 
41205   /* "View.MemoryView":148
41206  *
41207  *         if not self._shape:
41208  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
41209  *
41210  *
41211  */
41212   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 148, __pyx_L1_error)
41213   __Pyx_GOTREF(__pyx_tuple__27);
41214   __Pyx_GIVEREF(__pyx_tuple__27);
41215 
41216   /* "View.MemoryView":176
41217  *             self.data = <char *>malloc(self.len)
41218  *             if not self.data:
41219  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
41220  *
41221  *             if self.dtype_is_object:
41222  */
41223   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 176, __pyx_L1_error)
41224   __Pyx_GOTREF(__pyx_tuple__28);
41225   __Pyx_GIVEREF(__pyx_tuple__28);
41226 
41227   /* "View.MemoryView":192
41228  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
41229  *         if not (flags & bufmode):
41230  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
41231  *         info.buf = self.data
41232  *         info.len = self.len
41233  */
41234   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 192, __pyx_L1_error)
41235   __Pyx_GOTREF(__pyx_tuple__29);
41236   __Pyx_GIVEREF(__pyx_tuple__29);
41237 
41238   /* "(tree fragment)":2
41239  * def __reduce_cython__(self):
41240  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41241  * def __setstate_cython__(self, __pyx_state):
41242  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41243  */
41244   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
41245   __Pyx_GOTREF(__pyx_tuple__30);
41246   __Pyx_GIVEREF(__pyx_tuple__30);
41247 
41248   /* "(tree fragment)":4
41249  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41250  * def __setstate_cython__(self, __pyx_state):
41251  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41252  */
41253   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
41254   __Pyx_GOTREF(__pyx_tuple__31);
41255   __Pyx_GIVEREF(__pyx_tuple__31);
41256 
41257   /* "View.MemoryView":414
41258  *     def __setitem__(memoryview self, object index, object value):
41259  *         if self.view.readonly:
41260  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
41261  *
41262  *         have_slices, index = _unellipsify(index, self.view.ndim)
41263  */
41264   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 414, __pyx_L1_error)
41265   __Pyx_GOTREF(__pyx_tuple__32);
41266   __Pyx_GIVEREF(__pyx_tuple__32);
41267 
41268   /* "View.MemoryView":491
41269  *             result = struct.unpack(self.view.format, bytesitem)
41270  *         except struct.error:
41271  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
41272  *         else:
41273  *             if len(self.view.format) == 1:
41274  */
41275   __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 491, __pyx_L1_error)
41276   __Pyx_GOTREF(__pyx_tuple__33);
41277   __Pyx_GIVEREF(__pyx_tuple__33);
41278 
41279   /* "View.MemoryView":516
41280  *     def __getbuffer__(self, Py_buffer *info, int flags):
41281  *         if flags & PyBUF_WRITABLE and self.view.readonly:
41282  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
41283  *
41284  *         if flags & PyBUF_ND:
41285  */
41286   __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 516, __pyx_L1_error)
41287   __Pyx_GOTREF(__pyx_tuple__34);
41288   __Pyx_GIVEREF(__pyx_tuple__34);
41289 
41290   /* "View.MemoryView":566
41291  *         if self.view.strides == NULL:
41292  *
41293  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
41294  *
41295  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
41296  */
41297   __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 566, __pyx_L1_error)
41298   __Pyx_GOTREF(__pyx_tuple__35);
41299   __Pyx_GIVEREF(__pyx_tuple__35);
41300 
41301   /* "View.MemoryView":573
41302  *     def suboffsets(self):
41303  *         if self.view.suboffsets == NULL:
41304  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
41305  *
41306  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
41307  */
41308   __pyx_tuple__36 = PyTuple_New(1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 573, __pyx_L1_error)
41309   __Pyx_GOTREF(__pyx_tuple__36);
41310   __Pyx_INCREF(__pyx_int_neg_1);
41311   __Pyx_GIVEREF(__pyx_int_neg_1);
41312   PyTuple_SET_ITEM(__pyx_tuple__36, 0, __pyx_int_neg_1);
41313   __Pyx_GIVEREF(__pyx_tuple__36);
41314 
41315   /* "(tree fragment)":2
41316  * def __reduce_cython__(self):
41317  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41318  * def __setstate_cython__(self, __pyx_state):
41319  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41320  */
41321   __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 2, __pyx_L1_error)
41322   __Pyx_GOTREF(__pyx_tuple__37);
41323   __Pyx_GIVEREF(__pyx_tuple__37);
41324 
41325   /* "(tree fragment)":4
41326  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41327  * def __setstate_cython__(self, __pyx_state):
41328  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41329  */
41330   __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 4, __pyx_L1_error)
41331   __Pyx_GOTREF(__pyx_tuple__38);
41332   __Pyx_GIVEREF(__pyx_tuple__38);
41333 
41334   /* "View.MemoryView":699
41335  *     for suboffset in suboffsets[:ndim]:
41336  *         if suboffset >= 0:
41337  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
41338  *
41339  *
41340  */
41341   __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 699, __pyx_L1_error)
41342   __Pyx_GOTREF(__pyx_tuple__39);
41343   __Pyx_GIVEREF(__pyx_tuple__39);
41344 
41345   /* "(tree fragment)":2
41346  * def __reduce_cython__(self):
41347  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41348  * def __setstate_cython__(self, __pyx_state):
41349  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41350  */
41351   __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 2, __pyx_L1_error)
41352   __Pyx_GOTREF(__pyx_tuple__40);
41353   __Pyx_GIVEREF(__pyx_tuple__40);
41354 
41355   /* "(tree fragment)":4
41356  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
41357  * def __setstate_cython__(self, __pyx_state):
41358  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
41359  */
41360   __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 4, __pyx_L1_error)
41361   __Pyx_GOTREF(__pyx_tuple__41);
41362   __Pyx_GIVEREF(__pyx_tuple__41);
41363 
41364   /* "View.MemoryView":286
41365  *         return self.name
41366  *
41367  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
41368  * cdef strided = Enum("<strided and direct>") # default
41369  * cdef indirect = Enum("<strided and indirect>")
41370  */
41371   __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 286, __pyx_L1_error)
41372   __Pyx_GOTREF(__pyx_tuple__47);
41373   __Pyx_GIVEREF(__pyx_tuple__47);
41374 
41375   /* "View.MemoryView":287
41376  *
41377  * cdef generic = Enum("<strided and direct or indirect>")
41378  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
41379  * cdef indirect = Enum("<strided and indirect>")
41380  *
41381  */
41382   __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 287, __pyx_L1_error)
41383   __Pyx_GOTREF(__pyx_tuple__48);
41384   __Pyx_GIVEREF(__pyx_tuple__48);
41385 
41386   /* "View.MemoryView":288
41387  * cdef generic = Enum("<strided and direct or indirect>")
41388  * cdef strided = Enum("<strided and direct>") # default
41389  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
41390  *
41391  *
41392  */
41393   __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 288, __pyx_L1_error)
41394   __Pyx_GOTREF(__pyx_tuple__49);
41395   __Pyx_GIVEREF(__pyx_tuple__49);
41396 
41397   /* "View.MemoryView":291
41398  *
41399  *
41400  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
41401  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
41402  *
41403  */
41404   __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 291, __pyx_L1_error)
41405   __Pyx_GOTREF(__pyx_tuple__50);
41406   __Pyx_GIVEREF(__pyx_tuple__50);
41407 
41408   /* "View.MemoryView":292
41409  *
41410  * cdef contiguous = Enum("<contiguous and direct>")
41411  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
41412  *
41413  *
41414  */
41415   __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 292, __pyx_L1_error)
41416   __Pyx_GOTREF(__pyx_tuple__51);
41417   __Pyx_GIVEREF(__pyx_tuple__51);
41418 
41419   /* "(tree fragment)":1
41420  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
41421  *     cdef object __pyx_PickleError
41422  *     cdef object __pyx_result
41423  */
41424   __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 1, __pyx_L1_error)
41425   __Pyx_GOTREF(__pyx_tuple__52);
41426   __Pyx_GIVEREF(__pyx_tuple__52);
41427   __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 1, __pyx_L1_error)
41428   __Pyx_RefNannyFinishContext();
41429   return 0;
41430   __pyx_L1_error:;
41431   __Pyx_RefNannyFinishContext();
41432   return -1;
41433 }
41434 
__Pyx_InitGlobals(void)41435 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
41436   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
41437   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
41438   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
41439   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
41440   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
41441   __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
41442   __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
41443   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
41444   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
41445   return 0;
41446   __pyx_L1_error:;
41447   return -1;
41448 }
41449 
41450 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
41451 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
41452 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
41453 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
41454 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
41455 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
41456 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
41457 
__Pyx_modinit_global_init_code(void)41458 static int __Pyx_modinit_global_init_code(void) {
41459   __Pyx_RefNannyDeclarations
41460   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
41461   /*--- Global init code ---*/
41462   generic = Py_None; Py_INCREF(Py_None);
41463   strided = Py_None; Py_INCREF(Py_None);
41464   indirect = Py_None; Py_INCREF(Py_None);
41465   contiguous = Py_None; Py_INCREF(Py_None);
41466   indirect_contiguous = Py_None; Py_INCREF(Py_None);
41467   __Pyx_RefNannyFinishContext();
41468   return 0;
41469 }
41470 
__Pyx_modinit_variable_export_code(void)41471 static int __Pyx_modinit_variable_export_code(void) {
41472   __Pyx_RefNannyDeclarations
41473   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
41474   /*--- Variable export code ---*/
41475   if (__Pyx_ExportVoidPtr(__pyx_n_s_ORDER_MAX, (void *)&__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41476   __Pyx_RefNannyFinishContext();
41477   return 0;
41478   __pyx_L1_error:;
41479   __Pyx_RefNannyFinishContext();
41480   return -1;
41481 }
41482 
__Pyx_modinit_function_export_code(void)41483 static int __Pyx_modinit_function_export_code(void) {
41484   __Pyx_RefNannyDeclarations
41485   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
41486   /*--- Function export code ---*/
41487   if (__Pyx_ExportFunction("OctList_append", (void (*)(void))__pyx_f_2yt_8geometry_13oct_container_OctList_append, "struct __pyx_t_2yt_8geometry_13oct_container_OctList *(struct __pyx_t_2yt_8geometry_13oct_container_OctList *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41488   if (__Pyx_ExportFunction("OctList_count", (void (*)(void))__pyx_f_2yt_8geometry_13oct_container_OctList_count, "int (struct __pyx_t_2yt_8geometry_13oct_container_OctList *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41489   if (__Pyx_ExportFunction("OctList_delete", (void (*)(void))__pyx_f_2yt_8geometry_13oct_container_OctList_delete, "void (struct __pyx_t_2yt_8geometry_13oct_container_OctList *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41490   __Pyx_RefNannyFinishContext();
41491   return 0;
41492   __pyx_L1_error:;
41493   __Pyx_RefNannyFinishContext();
41494   return -1;
41495 }
41496 
__Pyx_modinit_type_init_code(void)41497 static int __Pyx_modinit_type_init_code(void) {
41498   __Pyx_RefNannyDeclarations
41499   PyObject *__pyx_t_1 = NULL;
41500   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
41501   /*--- Type init code ---*/
41502   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.allocation_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
41503   __Pyx_GOTREF(__pyx_t_1);
41504   __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), __Pyx_ImportType_CheckSize_Warn);
41505    if (!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool) __PYX_ERR(0, 1, __pyx_L1_error)
41506   __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(0, 1, __pyx_L1_error)
41507   __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = &__pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool;
41508   __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base = *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool;
41509   __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base.setup_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_setup_objs;
41510   __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.__pyx_base.teardown_objs = (void (*)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_teardown_objs;
41511   __pyx_vtable_2yt_8geometry_13oct_container_OctObjectPool.get_cont = (struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int))__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont;
41512   __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_base = __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool;
41513   if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 1164, __pyx_L1_error)
41514   #if PY_VERSION_HEX < 0x030800B1
41515   __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_print = 0;
41516   #endif
41517   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_dictoffset && __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_getattro == PyObject_GenericGetAttr)) {
41518     __pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41519   }
41520   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_OctObjectPool.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 1164, __pyx_L1_error)
41521   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OctObjectPool, (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 1164, __pyx_L1_error)
41522   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_OctObjectPool) < 0) __PYX_ERR(0, 1164, __pyx_L1_error)
41523   __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = &__pyx_type_2yt_8geometry_13oct_container_OctObjectPool;
41524   __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer;
41525   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.get = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get;
41526   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.get_root = (int (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_root;
41527   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.neighbors = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *, __pyx_t_5numpy_int64_t *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_neighbors;
41528   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.get_domain_offset = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_get_domain_offset;
41529   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.visit_all_octs = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
41530   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.next_root = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_root;
41531   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.next_child = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_next_child;
41532   __pyx_vtable_2yt_8geometry_13oct_container_OctreeContainer.append_domain = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t))__pyx_f_2yt_8geometry_13oct_container_15OctreeContainer_append_domain;
41533   if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
41534   #if PY_VERSION_HEX < 0x030800B1
41535   __pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_print = 0;
41536   #endif
41537   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_dictoffset && __pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_getattro == PyObject_GenericGetAttr)) {
41538     __pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41539   }
41540   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_OctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
41541   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OctreeContainer, (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
41542   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_OctreeContainer) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
41543   __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_OctreeContainer;
41544   __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer;
41545   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
41546   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base.get_root = (int (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_root;
41547   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base.get_domain_offset = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_get_domain_offset;
41548   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base.visit_all_octs = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_visit_all_octs;
41549   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.__pyx_base.next_root = (struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_next_root;
41550   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.key_to_ipos = (void (*)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_key_to_ipos;
41551   __pyx_vtable_2yt_8geometry_13oct_container_SparseOctreeContainer.ipos_to_key = (__pyx_t_5numpy_int64_t (*)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *))__pyx_f_2yt_8geometry_13oct_container_21SparseOctreeContainer_ipos_to_key;
41552   __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer;
41553   if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 950, __pyx_L1_error)
41554   #if PY_VERSION_HEX < 0x030800B1
41555   __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_print = 0;
41556   #endif
41557   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_dictoffset && __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_getattro == PyObject_GenericGetAttr)) {
41558     __pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41559   }
41560   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 950, __pyx_L1_error)
41561   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SparseOctreeContainer, (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 950, __pyx_L1_error)
41562   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer) < 0) __PYX_ERR(0, 950, __pyx_L1_error)
41563   __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_SparseOctreeContainer;
41564   __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
41565   __pyx_vtable_2yt_8geometry_13oct_container_RAMSESOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
41566   __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer;
41567   if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(2, 93, __pyx_L1_error)
41568   #if PY_VERSION_HEX < 0x030800B1
41569   __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_print = 0;
41570   #endif
41571   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_dictoffset && __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_getattro == PyObject_GenericGetAttr)) {
41572     __pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41573   }
41574   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(2, 93, __pyx_L1_error)
41575   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RAMSESOctreeContainer, (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer) < 0) __PYX_ERR(2, 93, __pyx_L1_error)
41576   __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
41577   __pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer = &__pyx_vtable_2yt_8geometry_13oct_container_ARTOctreeContainer;
41578   __pyx_vtable_2yt_8geometry_13oct_container_ARTOctreeContainer.__pyx_base = *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
41579   __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_base = __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer;
41580   if (PyType_Ready(&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
41581   #if PY_VERSION_HEX < 0x030800B1
41582   __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_print = 0;
41583   #endif
41584   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_dictoffset && __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_getattro == PyObject_GenericGetAttr)) {
41585     __pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41586   }
41587   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer.tp_dict, __pyx_vtabptr_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
41588   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ARTOctreeContainer, (PyObject *)&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
41589   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
41590   __pyx_ptype_2yt_8geometry_13oct_container_ARTOctreeContainer = &__pyx_type_2yt_8geometry_13oct_container_ARTOctreeContainer;
41591   __pyx_vtabptr_array = &__pyx_vtable_array;
41592   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
41593   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
41594   #if PY_VERSION_HEX < 0x030800B1
41595   __pyx_type___pyx_array.tp_print = 0;
41596   #endif
41597   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
41598   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
41599   __pyx_array_type = &__pyx_type___pyx_array;
41600   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
41601   #if PY_VERSION_HEX < 0x030800B1
41602   __pyx_type___pyx_MemviewEnum.tp_print = 0;
41603   #endif
41604   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
41605     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41606   }
41607   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
41608   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
41609   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
41610   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
41611   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
41612   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
41613   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
41614   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
41615   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
41616   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
41617   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
41618   #if PY_VERSION_HEX < 0x030800B1
41619   __pyx_type___pyx_memoryview.tp_print = 0;
41620   #endif
41621   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
41622     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41623   }
41624   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
41625   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
41626   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
41627   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
41628   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
41629   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
41630   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
41631   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
41632   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
41633   #if PY_VERSION_HEX < 0x030800B1
41634   __pyx_type___pyx_memoryviewslice.tp_print = 0;
41635   #endif
41636   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
41637     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
41638   }
41639   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
41640   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
41641   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
41642   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41643   __Pyx_RefNannyFinishContext();
41644   return 0;
41645   __pyx_L1_error:;
41646   __Pyx_XDECREF(__pyx_t_1);
41647   __Pyx_RefNannyFinishContext();
41648   return -1;
41649 }
41650 
__Pyx_modinit_type_import_code(void)41651 static int __Pyx_modinit_type_import_code(void) {
41652   __Pyx_RefNannyDeclarations
41653   PyObject *__pyx_t_1 = NULL;
41654   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
41655   /*--- Type import code ---*/
41656   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
41657   __Pyx_GOTREF(__pyx_t_1);
41658   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
41659   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
41660   sizeof(PyTypeObject),
41661   #else
41662   sizeof(PyHeapTypeObject),
41663   #endif
41664   __Pyx_ImportType_CheckSize_Warn);
41665    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
41666   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41667   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
41668   __Pyx_GOTREF(__pyx_t_1);
41669   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
41670    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
41671   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
41672    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
41673   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
41674    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
41675   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
41676    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
41677   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
41678    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
41679   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41680   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_visitors"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 33, __pyx_L1_error)
41681   __Pyx_GOTREF(__pyx_t_1);
41682   __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), __Pyx_ImportType_CheckSize_Warn);
41683    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor) __PYX_ERR(7, 33, __pyx_L1_error)
41684   __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(7, 33, __pyx_L1_error)
41685   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), __Pyx_ImportType_CheckSize_Warn);
41686    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts) __PYX_ERR(7, 59, __pyx_L1_error)
41687   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(7, 59, __pyx_L1_error)
41688   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalCells", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells), __Pyx_ImportType_CheckSize_Warn);
41689    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells) __PYX_ERR(7, 62, __pyx_L1_error)
41690   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells)) __PYX_ERR(7, 62, __pyx_L1_error)
41691   __pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MarkOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts), __Pyx_ImportType_CheckSize_Warn);
41692    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts) __PYX_ERR(7, 65, __pyx_L1_error)
41693   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts)) __PYX_ERR(7, 65, __pyx_L1_error)
41694   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts), __Pyx_ImportType_CheckSize_Warn);
41695    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts) __PYX_ERR(7, 69, __pyx_L1_error)
41696   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts)) __PYX_ERR(7, 69, __pyx_L1_error)
41697   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts), __Pyx_ImportType_CheckSize_Warn);
41698    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts) __PYX_ERR(7, 72, __pyx_L1_error)
41699   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts)) __PYX_ERR(7, 72, __pyx_L1_error)
41700   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskedIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts), __Pyx_ImportType_CheckSize_Warn);
41701    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts) __PYX_ERR(7, 75, __pyx_L1_error)
41702   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts)) __PYX_ERR(7, 75, __pyx_L1_error)
41703   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexMaskMapOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts), __Pyx_ImportType_CheckSize_Warn);
41704    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts) __PYX_ERR(7, 79, __pyx_L1_error)
41705   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts)) __PYX_ERR(7, 79, __pyx_L1_error)
41706   __pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "ICoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts), __Pyx_ImportType_CheckSize_Warn);
41707    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts) __PYX_ERR(7, 85, __pyx_L1_error)
41708   __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts)) __PYX_ERR(7, 85, __pyx_L1_error)
41709   __pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IResOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts), __Pyx_ImportType_CheckSize_Warn);
41710    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts) __PYX_ERR(7, 88, __pyx_L1_error)
41711   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts)) __PYX_ERR(7, 88, __pyx_L1_error)
41712   __pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FCoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts), __Pyx_ImportType_CheckSize_Warn);
41713    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts) __PYX_ERR(7, 91, __pyx_L1_error)
41714   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts)) __PYX_ERR(7, 91, __pyx_L1_error)
41715   __pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FWidthOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts), __Pyx_ImportType_CheckSize_Warn);
41716    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts) __PYX_ERR(7, 94, __pyx_L1_error)
41717   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts)) __PYX_ERR(7, 94, __pyx_L1_error)
41718   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayI64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64), __Pyx_ImportType_CheckSize_Warn);
41719    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64) __PYX_ERR(7, 97, __pyx_L1_error)
41720   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64)) __PYX_ERR(7, 97, __pyx_L1_error)
41721   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayF64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64), __Pyx_ImportType_CheckSize_Warn);
41722    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64) __PYX_ERR(7, 101, __pyx_L1_error)
41723   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64)) __PYX_ERR(7, 101, __pyx_L1_error)
41724   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyFileIndArrayI8", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8), __Pyx_ImportType_CheckSize_Warn);
41725    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8) __PYX_ERR(7, 105, __pyx_L1_error)
41726   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8)) __PYX_ERR(7, 105, __pyx_L1_error)
41727   __pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IdentifyOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts), __Pyx_ImportType_CheckSize_Warn);
41728    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts) __PYX_ERR(7, 110, __pyx_L1_error)
41729   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts)) __PYX_ERR(7, 110, __pyx_L1_error)
41730   __pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "AssignDomainInd", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd), __Pyx_ImportType_CheckSize_Warn);
41731    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd) __PYX_ERR(7, 113, __pyx_L1_error)
41732   __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd)) __PYX_ERR(7, 113, __pyx_L1_error)
41733   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesO", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO), __Pyx_ImportType_CheckSize_Warn);
41734    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO) __PYX_ERR(7, 116, __pyx_L1_error)
41735   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO)) __PYX_ERR(7, 116, __pyx_L1_error)
41736   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesR", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR), __Pyx_ImportType_CheckSize_Warn);
41737    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR) __PYX_ERR(7, 121, __pyx_L1_error)
41738   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR)) __PYX_ERR(7, 121, __pyx_L1_error)
41739   __pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountByDomain", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain), __Pyx_ImportType_CheckSize_Warn);
41740    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain) __PYX_ERR(7, 126, __pyx_L1_error)
41741   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain)) __PYX_ERR(7, 126, __pyx_L1_error)
41742   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree), __Pyx_ImportType_CheckSize_Warn);
41743    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree) __PYX_ERR(7, 129, __pyx_L1_error)
41744   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(7, 129, __pyx_L1_error)
41745   __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), __Pyx_ImportType_CheckSize_Warn);
41746    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree) __PYX_ERR(7, 132, __pyx_L1_error)
41747   __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(7, 132, __pyx_L1_error)
41748   __pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MortonIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts), __Pyx_ImportType_CheckSize_Warn);
41749    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts) __PYX_ERR(7, 138, __pyx_L1_error)
41750   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts)) __PYX_ERR(7, 138, __pyx_L1_error)
41751   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreIndex", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex), __Pyx_ImportType_CheckSize_Warn);
41752    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex) __PYX_ERR(7, 149, __pyx_L1_error)
41753   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex)) __PYX_ERR(7, 149, __pyx_L1_error)
41754   __pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "BaseNeighbourVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor), __Pyx_ImportType_CheckSize_Warn);
41755    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor) __PYX_ERR(7, 153, __pyx_L1_error)
41756   __pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor)) __PYX_ERR(7, 153, __pyx_L1_error)
41757   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellIndexVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor), __Pyx_ImportType_CheckSize_Warn);
41758    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor) __PYX_ERR(7, 169, __pyx_L1_error)
41759   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor)) __PYX_ERR(7, 169, __pyx_L1_error)
41760   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor), __Pyx_ImportType_CheckSize_Warn);
41761    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor) __PYX_ERR(7, 173, __pyx_L1_error)
41762   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor)) __PYX_ERR(7, 173, __pyx_L1_error)
41763   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41764   __pyx_t_1 = PyImport_ImportModule("yt.geometry.selection_routines"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 24, __pyx_L1_error)
41765   __Pyx_GOTREF(__pyx_t_1);
41766   __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), __Pyx_ImportType_CheckSize_Warn);
41767    if (!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject) __PYX_ERR(8, 24, __pyx_L1_error)
41768   __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(8, 24, __pyx_L1_error)
41769   __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), __Pyx_ImportType_CheckSize_Warn);
41770    if (!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector) __PYX_ERR(8, 70, __pyx_L1_error)
41771   __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(8, 70, __pyx_L1_error)
41772   __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), __Pyx_ImportType_CheckSize_Warn);
41773    if (!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector) __PYX_ERR(8, 73, __pyx_L1_error)
41774   __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(8, 73, __pyx_L1_error)
41775   __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), __Pyx_ImportType_CheckSize_Warn);
41776    if (!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector) __PYX_ERR(8, 77, __pyx_L1_error)
41777   __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(8, 77, __pyx_L1_error)
41778   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41779   __Pyx_RefNannyFinishContext();
41780   return 0;
41781   __pyx_L1_error:;
41782   __Pyx_XDECREF(__pyx_t_1);
41783   __Pyx_RefNannyFinishContext();
41784   return -1;
41785 }
41786 
__Pyx_modinit_variable_import_code(void)41787 static int __Pyx_modinit_variable_import_code(void) {
41788   __Pyx_RefNannyDeclarations
41789   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
41790   /*--- Variable import code ---*/
41791   __Pyx_RefNannyFinishContext();
41792   return 0;
41793 }
41794 
__Pyx_modinit_function_import_code(void)41795 static int __Pyx_modinit_function_import_code(void) {
41796   __Pyx_RefNannyDeclarations
41797   PyObject *__pyx_t_1 = NULL;
41798   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
41799   /*--- Function import code ---*/
41800   __pyx_t_1 = PyImport_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
41801   if (__Pyx_ImportFunction(__pyx_t_1, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41802   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41803   __Pyx_RefNannyFinishContext();
41804   return 0;
41805   __pyx_L1_error:;
41806   __Pyx_XDECREF(__pyx_t_1);
41807   __Pyx_RefNannyFinishContext();
41808   return -1;
41809 }
41810 
41811 
41812 #if PY_MAJOR_VERSION < 3
41813 #ifdef CYTHON_NO_PYINIT_EXPORT
41814 #define __Pyx_PyMODINIT_FUNC void
41815 #else
41816 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
41817 #endif
41818 #else
41819 #ifdef CYTHON_NO_PYINIT_EXPORT
41820 #define __Pyx_PyMODINIT_FUNC PyObject *
41821 #else
41822 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
41823 #endif
41824 #endif
41825 
41826 
41827 #if PY_MAJOR_VERSION < 3
41828 __Pyx_PyMODINIT_FUNC initoct_container(void) CYTHON_SMALL_CODE; /*proto*/
initoct_container(void)41829 __Pyx_PyMODINIT_FUNC initoct_container(void)
41830 #else
41831 __Pyx_PyMODINIT_FUNC PyInit_oct_container(void) CYTHON_SMALL_CODE; /*proto*/
41832 __Pyx_PyMODINIT_FUNC PyInit_oct_container(void)
41833 #if CYTHON_PEP489_MULTI_PHASE_INIT
41834 {
41835   return PyModuleDef_Init(&__pyx_moduledef);
41836 }
41837 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
41838     #if PY_VERSION_HEX >= 0x030700A1
41839     static PY_INT64_T main_interpreter_id = -1;
41840     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
41841     if (main_interpreter_id == -1) {
41842         main_interpreter_id = current_id;
41843         return (unlikely(current_id == -1)) ? -1 : 0;
41844     } else if (unlikely(main_interpreter_id != current_id))
41845     #else
41846     static PyInterpreterState *main_interpreter = NULL;
41847     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
41848     if (!main_interpreter) {
41849         main_interpreter = current_interpreter;
41850     } else if (unlikely(main_interpreter != current_interpreter))
41851     #endif
41852     {
41853         PyErr_SetString(
41854             PyExc_ImportError,
41855             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
41856         return -1;
41857     }
41858     return 0;
41859 }
41860 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) {
41861     PyObject *value = PyObject_GetAttrString(spec, from_name);
41862     int result = 0;
41863     if (likely(value)) {
41864         if (allow_none || value != Py_None) {
41865             result = PyDict_SetItemString(moddict, to_name, value);
41866         }
41867         Py_DECREF(value);
41868     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
41869         PyErr_Clear();
41870     } else {
41871         result = -1;
41872     }
41873     return result;
41874 }
41875 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
41876     PyObject *module = NULL, *moddict, *modname;
41877     if (__Pyx_check_single_interpreter())
41878         return NULL;
41879     if (__pyx_m)
41880         return __Pyx_NewRef(__pyx_m);
41881     modname = PyObject_GetAttrString(spec, "name");
41882     if (unlikely(!modname)) goto bad;
41883     module = PyModule_NewObject(modname);
41884     Py_DECREF(modname);
41885     if (unlikely(!module)) goto bad;
41886     moddict = PyModule_GetDict(module);
41887     if (unlikely(!moddict)) goto bad;
41888     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
41889     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
41890     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
41891     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
41892     return module;
41893 bad:
41894     Py_XDECREF(module);
41895     return NULL;
41896 }
41897 
41898 
41899 static CYTHON_SMALL_CODE int __pyx_pymod_exec_oct_container(PyObject *__pyx_pyinit_module)
41900 #endif
41901 #endif
41902 {
41903   PyObject *__pyx_t_1 = NULL;
41904   PyObject *__pyx_t_2 = NULL;
41905   static PyThread_type_lock __pyx_t_3[8];
41906   __Pyx_RefNannyDeclarations
41907   #if CYTHON_PEP489_MULTI_PHASE_INIT
41908   if (__pyx_m) {
41909     if (__pyx_m == __pyx_pyinit_module) return 0;
41910     PyErr_SetString(PyExc_RuntimeError, "Module 'oct_container' has already been imported. Re-initialisation is not supported.");
41911     return -1;
41912   }
41913   #elif PY_MAJOR_VERSION >= 3
41914   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
41915   #endif
41916   #if CYTHON_REFNANNY
41917 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
41918 if (!__Pyx_RefNanny) {
41919   PyErr_Clear();
41920   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
41921   if (!__Pyx_RefNanny)
41922       Py_FatalError("failed to import 'refnanny' module");
41923 }
41924 #endif
41925   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_oct_container(void)", 0);
41926   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41927   #ifdef __Pxy_PyFrame_Initialize_Offsets
41928   __Pxy_PyFrame_Initialize_Offsets();
41929   #endif
41930   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
41931   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
41932   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
41933   #ifdef __Pyx_CyFunction_USED
41934   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41935   #endif
41936   #ifdef __Pyx_FusedFunction_USED
41937   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41938   #endif
41939   #ifdef __Pyx_Coroutine_USED
41940   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41941   #endif
41942   #ifdef __Pyx_Generator_USED
41943   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41944   #endif
41945   #ifdef __Pyx_AsyncGen_USED
41946   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41947   #endif
41948   #ifdef __Pyx_StopAsyncIteration_USED
41949   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41950   #endif
41951   /*--- Library function declarations ---*/
41952   /*--- Threads initialization code ---*/
41953   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
41954   #ifdef WITH_THREAD /* Python build with threading support? */
41955   PyEval_InitThreads();
41956   #endif
41957   #endif
41958   /*--- Module creation code ---*/
41959   #if CYTHON_PEP489_MULTI_PHASE_INIT
41960   __pyx_m = __pyx_pyinit_module;
41961   Py_INCREF(__pyx_m);
41962   #else
41963   #if PY_MAJOR_VERSION < 3
41964   __pyx_m = Py_InitModule4("oct_container", __pyx_methods, __pyx_k_Oct_container, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
41965   #else
41966   __pyx_m = PyModule_Create(&__pyx_moduledef);
41967   #endif
41968   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
41969   #endif
41970   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
41971   Py_INCREF(__pyx_d);
41972   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
41973   Py_INCREF(__pyx_b);
41974   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
41975   Py_INCREF(__pyx_cython_runtime);
41976   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
41977   /*--- Initialize various global constants etc. ---*/
41978   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41979   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
41980   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41981   #endif
41982   if (__pyx_module_is_main_yt__geometry__oct_container) {
41983     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
41984   }
41985   #if PY_MAJOR_VERSION >= 3
41986   {
41987     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
41988     if (!PyDict_GetItemString(modules, "yt.geometry.oct_container")) {
41989       if (unlikely(PyDict_SetItemString(modules, "yt.geometry.oct_container", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
41990     }
41991   }
41992   #endif
41993   /*--- Builtin init code ---*/
41994   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
41995   /*--- Constants init code ---*/
41996   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
41997   /*--- Global type/function init code ---*/
41998   (void)__Pyx_modinit_global_init_code();
41999   if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error;
42000   if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
42001   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
42002   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
42003   (void)__Pyx_modinit_variable_import_code();
42004   if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
42005   /*--- Execution code ---*/
42006   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
42007   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
42008   #endif
42009 
42010   /* "yt/geometry/oct_container.pyx":16
42011  * cimport numpy as np
42012  *
42013  * import numpy as np             # <<<<<<<<<<<<<<
42014  *
42015  * from libc.math cimport ceil, floor
42016  */
42017   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
42018   __Pyx_GOTREF(__pyx_t_1);
42019   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
42020   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42021 
42022   /* "yt/geometry/oct_container.pyx":28
42023  * )
42024  *
42025  * ORDER_MAX = 20             # <<<<<<<<<<<<<<
42026  * _ORDER_MAX = ORDER_MAX
42027  *
42028  */
42029   __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX = 20;
42030 
42031   /* "yt/geometry/oct_container.pyx":29
42032  *
42033  * ORDER_MAX = 20
42034  * _ORDER_MAX = ORDER_MAX             # <<<<<<<<<<<<<<
42035  *
42036  * cdef extern from "stdlib.h":
42037  */
42038   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_2yt_8geometry_13oct_container_ORDER_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
42039   __Pyx_GOTREF(__pyx_t_1);
42040   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ORDER_MAX_2, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
42041   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42042 
42043   /* "yt/geometry/oct_container.pyx":82
42044  *
42045  *     @classmethod
42046  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
42047  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
42048  *         ref_mask = header['octree']
42049  */
42050   __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
42051   __Pyx_GOTREF(__pyx_t_1);
42052 
42053   /* "yt/geometry/oct_container.pyx":81
42054  *         return self.domains.to_arrays()
42055  *
42056  *     @classmethod             # <<<<<<<<<<<<<<
42057  *     def load_octree(cls, header):
42058  *         cdef np.ndarray[np.uint8_t, ndim=1] ref_mask
42059  */
42060   __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
42061   __Pyx_GOTREF(__pyx_t_2);
42062   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42063   if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
42064   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42065   PyType_Modified(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer);
42066 
42067   /* "yt/geometry/oct_container.pyx":750
42068  *                     dest[i + offset] = source[file_inds[i], cell_inds[i]]
42069  *
42070  *     def fill_index(self, SelectorObject selector = AlwaysSelector(None)):             # <<<<<<<<<<<<<<
42071  *         """Get the on-file index of each cell"""
42072  *         cdef StoreIndex visitor
42073  */
42074   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
42075   __Pyx_GOTREF(__pyx_t_2);
42076   __pyx_k__5 = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_t_2);
42077   __Pyx_GIVEREF(__pyx_t_2);
42078   __pyx_t_2 = 0;
42079 
42080   /* "yt/geometry/oct_container.pyx":975
42081  *
42082  *     @classmethod
42083  *     def load_octree(cls, header):             # <<<<<<<<<<<<<<
42084  *         raise NotImplementedError
42085  *
42086  */
42087   __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer, __pyx_n_s_load_octree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error)
42088   __Pyx_GOTREF(__pyx_t_2);
42089 
42090   /* "yt/geometry/oct_container.pyx":974
42091  *         self.fill_style = "r"
42092  *
42093  *     @classmethod             # <<<<<<<<<<<<<<
42094  *     def load_octree(cls, header):
42095  *         raise NotImplementedError
42096  */
42097   __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
42098   __Pyx_GOTREF(__pyx_t_1);
42099   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42100   if (PyDict_SetItem((PyObject *)__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict, __pyx_n_s_load_octree, __pyx_t_1) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
42101   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42102   PyType_Modified(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer);
42103 
42104   /* "yt/geometry/oct_container.pyx":1
42105  * # distutils: sources = yt/utilities/lib/tsearch.c             # <<<<<<<<<<<<<<
42106  * # distutils: include_dirs = LIB_DIR
42107  * # distutils: libraries = STD_LIBS
42108  */
42109   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
42110   __Pyx_GOTREF(__pyx_t_1);
42111   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
42112   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42113 
42114   /* "View.MemoryView":209
42115  *         info.obj = self
42116  *
42117  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
42118  *
42119  *     def __dealloc__(array self):
42120  */
42121   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
42122   __Pyx_GOTREF(__pyx_t_1);
42123   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
42124   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42125   PyType_Modified(__pyx_array_type);
42126 
42127   /* "View.MemoryView":286
42128  *         return self.name
42129  *
42130  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
42131  * cdef strided = Enum("<strided and direct>") # default
42132  * cdef indirect = Enum("<strided and indirect>")
42133  */
42134   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
42135   __Pyx_GOTREF(__pyx_t_1);
42136   __Pyx_XGOTREF(generic);
42137   __Pyx_DECREF_SET(generic, __pyx_t_1);
42138   __Pyx_GIVEREF(__pyx_t_1);
42139   __pyx_t_1 = 0;
42140 
42141   /* "View.MemoryView":287
42142  *
42143  * cdef generic = Enum("<strided and direct or indirect>")
42144  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
42145  * cdef indirect = Enum("<strided and indirect>")
42146  *
42147  */
42148   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
42149   __Pyx_GOTREF(__pyx_t_1);
42150   __Pyx_XGOTREF(strided);
42151   __Pyx_DECREF_SET(strided, __pyx_t_1);
42152   __Pyx_GIVEREF(__pyx_t_1);
42153   __pyx_t_1 = 0;
42154 
42155   /* "View.MemoryView":288
42156  * cdef generic = Enum("<strided and direct or indirect>")
42157  * cdef strided = Enum("<strided and direct>") # default
42158  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
42159  *
42160  *
42161  */
42162   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
42163   __Pyx_GOTREF(__pyx_t_1);
42164   __Pyx_XGOTREF(indirect);
42165   __Pyx_DECREF_SET(indirect, __pyx_t_1);
42166   __Pyx_GIVEREF(__pyx_t_1);
42167   __pyx_t_1 = 0;
42168 
42169   /* "View.MemoryView":291
42170  *
42171  *
42172  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
42173  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
42174  *
42175  */
42176   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
42177   __Pyx_GOTREF(__pyx_t_1);
42178   __Pyx_XGOTREF(contiguous);
42179   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
42180   __Pyx_GIVEREF(__pyx_t_1);
42181   __pyx_t_1 = 0;
42182 
42183   /* "View.MemoryView":292
42184  *
42185  * cdef contiguous = Enum("<contiguous and direct>")
42186  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
42187  *
42188  *
42189  */
42190   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
42191   __Pyx_GOTREF(__pyx_t_1);
42192   __Pyx_XGOTREF(indirect_contiguous);
42193   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
42194   __Pyx_GIVEREF(__pyx_t_1);
42195   __pyx_t_1 = 0;
42196 
42197   /* "View.MemoryView":316
42198  *
42199  * DEF THREAD_LOCKS_PREALLOCATED = 8
42200  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
42201  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
42202  *     PyThread_allocate_lock(),
42203  */
42204   __pyx_memoryview_thread_locks_used = 0;
42205 
42206   /* "View.MemoryView":317
42207  * DEF THREAD_LOCKS_PREALLOCATED = 8
42208  * cdef int __pyx_memoryview_thread_locks_used = 0
42209  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
42210  *     PyThread_allocate_lock(),
42211  *     PyThread_allocate_lock(),
42212  */
42213   __pyx_t_3[0] = PyThread_allocate_lock();
42214   __pyx_t_3[1] = PyThread_allocate_lock();
42215   __pyx_t_3[2] = PyThread_allocate_lock();
42216   __pyx_t_3[3] = PyThread_allocate_lock();
42217   __pyx_t_3[4] = PyThread_allocate_lock();
42218   __pyx_t_3[5] = PyThread_allocate_lock();
42219   __pyx_t_3[6] = PyThread_allocate_lock();
42220   __pyx_t_3[7] = PyThread_allocate_lock();
42221   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
42222 
42223   /* "View.MemoryView":545
42224  *         info.obj = self
42225  *
42226  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
42227  *
42228  *
42229  */
42230   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
42231   __Pyx_GOTREF(__pyx_t_1);
42232   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
42233   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42234   PyType_Modified(__pyx_memoryview_type);
42235 
42236   /* "View.MemoryView":991
42237  *         return self.from_object
42238  *
42239  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
42240  *
42241  *
42242  */
42243   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
42244   __Pyx_GOTREF(__pyx_t_1);
42245   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
42246   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42247   PyType_Modified(__pyx_memoryviewslice_type);
42248 
42249   /* "(tree fragment)":1
42250  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
42251  *     cdef object __pyx_PickleError
42252  *     cdef object __pyx_result
42253  */
42254   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
42255   __Pyx_GOTREF(__pyx_t_1);
42256   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
42257   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42258 
42259   /* "BufferFormatFromTypeInfo":1460
42260  *
42261  * @cname('__pyx_format_from_typeinfo')
42262  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
42263  *     cdef __Pyx_StructField *field
42264  *     cdef __pyx_typeinfo_string fmt
42265  */
42266 
42267   /*--- Wrapped vars code ---*/
42268 
42269   goto __pyx_L0;
42270   __pyx_L1_error:;
42271   __Pyx_XDECREF(__pyx_t_1);
42272   __Pyx_XDECREF(__pyx_t_2);
42273   if (__pyx_m) {
42274     if (__pyx_d) {
42275       __Pyx_AddTraceback("init yt.geometry.oct_container", __pyx_clineno, __pyx_lineno, __pyx_filename);
42276     }
42277     Py_CLEAR(__pyx_m);
42278   } else if (!PyErr_Occurred()) {
42279     PyErr_SetString(PyExc_ImportError, "init yt.geometry.oct_container");
42280   }
42281   __pyx_L0:;
42282   __Pyx_RefNannyFinishContext();
42283   #if CYTHON_PEP489_MULTI_PHASE_INIT
42284   return (__pyx_m != NULL) ? 0 : -1;
42285   #elif PY_MAJOR_VERSION >= 3
42286   return __pyx_m;
42287   #else
42288   return;
42289   #endif
42290 }
42291 
42292 /* --- Runtime support code --- */
42293 /* Refnanny */
42294 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)42295 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
42296     PyObject *m = NULL, *p = NULL;
42297     void *r = NULL;
42298     m = PyImport_ImportModule(modname);
42299     if (!m) goto end;
42300     p = PyObject_GetAttrString(m, "RefNannyAPI");
42301     if (!p) goto end;
42302     r = PyLong_AsVoidPtr(p);
42303 end:
42304     Py_XDECREF(p);
42305     Py_XDECREF(m);
42306     return (__Pyx_RefNannyAPIStruct *)r;
42307 }
42308 #endif
42309 
42310 /* PyObjectGetAttrStr */
42311 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)42312 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
42313     PyTypeObject* tp = Py_TYPE(obj);
42314     if (likely(tp->tp_getattro))
42315         return tp->tp_getattro(obj, attr_name);
42316 #if PY_MAJOR_VERSION < 3
42317     if (likely(tp->tp_getattr))
42318         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
42319 #endif
42320     return PyObject_GetAttr(obj, attr_name);
42321 }
42322 #endif
42323 
42324 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)42325 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
42326     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
42327     if (unlikely(!result)) {
42328         PyErr_Format(PyExc_NameError,
42329 #if PY_MAJOR_VERSION >= 3
42330             "name '%U' is not defined", name);
42331 #else
42332             "name '%.200s' is not defined", PyString_AS_STRING(name));
42333 #endif
42334     }
42335     return result;
42336 }
42337 
42338 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)42339 static void __Pyx_RaiseArgtupleInvalid(
42340     const char* func_name,
42341     int exact,
42342     Py_ssize_t num_min,
42343     Py_ssize_t num_max,
42344     Py_ssize_t num_found)
42345 {
42346     Py_ssize_t num_expected;
42347     const char *more_or_less;
42348     if (num_found < num_min) {
42349         num_expected = num_min;
42350         more_or_less = "at least";
42351     } else {
42352         num_expected = num_max;
42353         more_or_less = "at most";
42354     }
42355     if (exact) {
42356         more_or_less = "exactly";
42357     }
42358     PyErr_Format(PyExc_TypeError,
42359                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
42360                  func_name, more_or_less, num_expected,
42361                  (num_expected == 1) ? "" : "s", num_found);
42362 }
42363 
42364 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)42365 static void __Pyx_RaiseDoubleKeywordsError(
42366     const char* func_name,
42367     PyObject* kw_name)
42368 {
42369     PyErr_Format(PyExc_TypeError,
42370         #if PY_MAJOR_VERSION >= 3
42371         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
42372         #else
42373         "%s() got multiple values for keyword argument '%s'", func_name,
42374         PyString_AsString(kw_name));
42375         #endif
42376 }
42377 
42378 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)42379 static int __Pyx_ParseOptionalKeywords(
42380     PyObject *kwds,
42381     PyObject **argnames[],
42382     PyObject *kwds2,
42383     PyObject *values[],
42384     Py_ssize_t num_pos_args,
42385     const char* function_name)
42386 {
42387     PyObject *key = 0, *value = 0;
42388     Py_ssize_t pos = 0;
42389     PyObject*** name;
42390     PyObject*** first_kw_arg = argnames + num_pos_args;
42391     while (PyDict_Next(kwds, &pos, &key, &value)) {
42392         name = first_kw_arg;
42393         while (*name && (**name != key)) name++;
42394         if (*name) {
42395             values[name-argnames] = value;
42396             continue;
42397         }
42398         name = first_kw_arg;
42399         #if PY_MAJOR_VERSION < 3
42400         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
42401             while (*name) {
42402                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
42403                         && _PyString_Eq(**name, key)) {
42404                     values[name-argnames] = value;
42405                     break;
42406                 }
42407                 name++;
42408             }
42409             if (*name) continue;
42410             else {
42411                 PyObject*** argname = argnames;
42412                 while (argname != first_kw_arg) {
42413                     if ((**argname == key) || (
42414                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
42415                              && _PyString_Eq(**argname, key))) {
42416                         goto arg_passed_twice;
42417                     }
42418                     argname++;
42419                 }
42420             }
42421         } else
42422         #endif
42423         if (likely(PyUnicode_Check(key))) {
42424             while (*name) {
42425                 int cmp = (**name == key) ? 0 :
42426                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
42427                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
42428                 #endif
42429                     PyUnicode_Compare(**name, key);
42430                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
42431                 if (cmp == 0) {
42432                     values[name-argnames] = value;
42433                     break;
42434                 }
42435                 name++;
42436             }
42437             if (*name) continue;
42438             else {
42439                 PyObject*** argname = argnames;
42440                 while (argname != first_kw_arg) {
42441                     int cmp = (**argname == key) ? 0 :
42442                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
42443                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
42444                     #endif
42445                         PyUnicode_Compare(**argname, key);
42446                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
42447                     if (cmp == 0) goto arg_passed_twice;
42448                     argname++;
42449                 }
42450             }
42451         } else
42452             goto invalid_keyword_type;
42453         if (kwds2) {
42454             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
42455         } else {
42456             goto invalid_keyword;
42457         }
42458     }
42459     return 0;
42460 arg_passed_twice:
42461     __Pyx_RaiseDoubleKeywordsError(function_name, key);
42462     goto bad;
42463 invalid_keyword_type:
42464     PyErr_Format(PyExc_TypeError,
42465         "%.200s() keywords must be strings", function_name);
42466     goto bad;
42467 invalid_keyword:
42468     PyErr_Format(PyExc_TypeError,
42469     #if PY_MAJOR_VERSION < 3
42470         "%.200s() got an unexpected keyword argument '%.200s'",
42471         function_name, PyString_AsString(key));
42472     #else
42473         "%s() got an unexpected keyword argument '%U'",
42474         function_name, key);
42475     #endif
42476 bad:
42477     return -1;
42478 }
42479 
42480 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)42481 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
42482     PyObject *r;
42483     if (!j) return NULL;
42484     r = PyObject_GetItem(o, j);
42485     Py_DECREF(j);
42486     return r;
42487 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)42488 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
42489                                                               CYTHON_NCP_UNUSED int wraparound,
42490                                                               CYTHON_NCP_UNUSED int boundscheck) {
42491 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42492     Py_ssize_t wrapped_i = i;
42493     if (wraparound & unlikely(i < 0)) {
42494         wrapped_i += PyList_GET_SIZE(o);
42495     }
42496     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
42497         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
42498         Py_INCREF(r);
42499         return r;
42500     }
42501     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
42502 #else
42503     return PySequence_GetItem(o, i);
42504 #endif
42505 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)42506 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
42507                                                               CYTHON_NCP_UNUSED int wraparound,
42508                                                               CYTHON_NCP_UNUSED int boundscheck) {
42509 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42510     Py_ssize_t wrapped_i = i;
42511     if (wraparound & unlikely(i < 0)) {
42512         wrapped_i += PyTuple_GET_SIZE(o);
42513     }
42514     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
42515         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
42516         Py_INCREF(r);
42517         return r;
42518     }
42519     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
42520 #else
42521     return PySequence_GetItem(o, i);
42522 #endif
42523 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)42524 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
42525                                                      CYTHON_NCP_UNUSED int wraparound,
42526                                                      CYTHON_NCP_UNUSED int boundscheck) {
42527 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
42528     if (is_list || PyList_CheckExact(o)) {
42529         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
42530         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
42531             PyObject *r = PyList_GET_ITEM(o, n);
42532             Py_INCREF(r);
42533             return r;
42534         }
42535     }
42536     else if (PyTuple_CheckExact(o)) {
42537         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
42538         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
42539             PyObject *r = PyTuple_GET_ITEM(o, n);
42540             Py_INCREF(r);
42541             return r;
42542         }
42543     } else {
42544         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
42545         if (likely(m && m->sq_item)) {
42546             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
42547                 Py_ssize_t l = m->sq_length(o);
42548                 if (likely(l >= 0)) {
42549                     i += l;
42550                 } else {
42551                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
42552                         return NULL;
42553                     PyErr_Clear();
42554                 }
42555             }
42556             return m->sq_item(o, i);
42557         }
42558     }
42559 #else
42560     if (is_list || PySequence_Check(o)) {
42561         return PySequence_GetItem(o, i);
42562     }
42563 #endif
42564     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
42565 }
42566 
42567 /* PyFunctionFastCall */
42568 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)42569 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
42570                                                PyObject *globals) {
42571     PyFrameObject *f;
42572     PyThreadState *tstate = __Pyx_PyThreadState_Current;
42573     PyObject **fastlocals;
42574     Py_ssize_t i;
42575     PyObject *result;
42576     assert(globals != NULL);
42577     /* XXX Perhaps we should create a specialized
42578        PyFrame_New() that doesn't take locals, but does
42579        take builtins without sanity checking them.
42580        */
42581     assert(tstate != NULL);
42582     f = PyFrame_New(tstate, co, globals, NULL);
42583     if (f == NULL) {
42584         return NULL;
42585     }
42586     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
42587     for (i = 0; i < na; i++) {
42588         Py_INCREF(*args);
42589         fastlocals[i] = *args++;
42590     }
42591     result = PyEval_EvalFrameEx(f,0);
42592     ++tstate->recursion_depth;
42593     Py_DECREF(f);
42594     --tstate->recursion_depth;
42595     return result;
42596 }
42597 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)42598 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
42599     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
42600     PyObject *globals = PyFunction_GET_GLOBALS(func);
42601     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
42602     PyObject *closure;
42603 #if PY_MAJOR_VERSION >= 3
42604     PyObject *kwdefs;
42605 #endif
42606     PyObject *kwtuple, **k;
42607     PyObject **d;
42608     Py_ssize_t nd;
42609     Py_ssize_t nk;
42610     PyObject *result;
42611     assert(kwargs == NULL || PyDict_Check(kwargs));
42612     nk = kwargs ? PyDict_Size(kwargs) : 0;
42613     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
42614         return NULL;
42615     }
42616     if (
42617 #if PY_MAJOR_VERSION >= 3
42618             co->co_kwonlyargcount == 0 &&
42619 #endif
42620             likely(kwargs == NULL || nk == 0) &&
42621             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
42622         if (argdefs == NULL && co->co_argcount == nargs) {
42623             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
42624             goto done;
42625         }
42626         else if (nargs == 0 && argdefs != NULL
42627                  && co->co_argcount == Py_SIZE(argdefs)) {
42628             /* function called with no arguments, but all parameters have
42629                a default value: use default values as arguments .*/
42630             args = &PyTuple_GET_ITEM(argdefs, 0);
42631             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
42632             goto done;
42633         }
42634     }
42635     if (kwargs != NULL) {
42636         Py_ssize_t pos, i;
42637         kwtuple = PyTuple_New(2 * nk);
42638         if (kwtuple == NULL) {
42639             result = NULL;
42640             goto done;
42641         }
42642         k = &PyTuple_GET_ITEM(kwtuple, 0);
42643         pos = i = 0;
42644         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
42645             Py_INCREF(k[i]);
42646             Py_INCREF(k[i+1]);
42647             i += 2;
42648         }
42649         nk = i / 2;
42650     }
42651     else {
42652         kwtuple = NULL;
42653         k = NULL;
42654     }
42655     closure = PyFunction_GET_CLOSURE(func);
42656 #if PY_MAJOR_VERSION >= 3
42657     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
42658 #endif
42659     if (argdefs != NULL) {
42660         d = &PyTuple_GET_ITEM(argdefs, 0);
42661         nd = Py_SIZE(argdefs);
42662     }
42663     else {
42664         d = NULL;
42665         nd = 0;
42666     }
42667 #if PY_MAJOR_VERSION >= 3
42668     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
42669                                args, (int)nargs,
42670                                k, (int)nk,
42671                                d, (int)nd, kwdefs, closure);
42672 #else
42673     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
42674                                args, (int)nargs,
42675                                k, (int)nk,
42676                                d, (int)nd, closure);
42677 #endif
42678     Py_XDECREF(kwtuple);
42679 done:
42680     Py_LeaveRecursiveCall();
42681     return result;
42682 }
42683 #endif
42684 #endif
42685 
42686 /* PyObjectCall */
42687 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)42688 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
42689     PyObject *result;
42690     ternaryfunc call = func->ob_type->tp_call;
42691     if (unlikely(!call))
42692         return PyObject_Call(func, arg, kw);
42693     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
42694         return NULL;
42695     result = (*call)(func, arg, kw);
42696     Py_LeaveRecursiveCall();
42697     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
42698         PyErr_SetString(
42699             PyExc_SystemError,
42700             "NULL result without error in PyObject_Call");
42701     }
42702     return result;
42703 }
42704 #endif
42705 
42706 /* PyObjectCallMethO */
42707 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)42708 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
42709     PyObject *self, *result;
42710     PyCFunction cfunc;
42711     cfunc = PyCFunction_GET_FUNCTION(func);
42712     self = PyCFunction_GET_SELF(func);
42713     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
42714         return NULL;
42715     result = cfunc(self, arg);
42716     Py_LeaveRecursiveCall();
42717     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
42718         PyErr_SetString(
42719             PyExc_SystemError,
42720             "NULL result without error in PyObject_Call");
42721     }
42722     return result;
42723 }
42724 #endif
42725 
42726 /* PyObjectCallNoArg */
42727 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)42728 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
42729 #if CYTHON_FAST_PYCALL
42730     if (PyFunction_Check(func)) {
42731         return __Pyx_PyFunction_FastCall(func, NULL, 0);
42732     }
42733 #endif
42734 #ifdef __Pyx_CyFunction_USED
42735     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
42736 #else
42737     if (likely(PyCFunction_Check(func)))
42738 #endif
42739     {
42740         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
42741             return __Pyx_PyObject_CallMethO(func, NULL);
42742         }
42743     }
42744     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
42745 }
42746 #endif
42747 
42748 /* PyCFunctionFastCall */
42749 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)42750 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
42751     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
42752     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
42753     PyObject *self = PyCFunction_GET_SELF(func);
42754     int flags = PyCFunction_GET_FLAGS(func);
42755     assert(PyCFunction_Check(func));
42756     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
42757     assert(nargs >= 0);
42758     assert(nargs == 0 || args != NULL);
42759     /* _PyCFunction_FastCallDict() must not be called with an exception set,
42760        because it may clear it (directly or indirectly) and so the
42761        caller loses its exception */
42762     assert(!PyErr_Occurred());
42763     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
42764         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
42765     } else {
42766         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
42767     }
42768 }
42769 #endif
42770 
42771 /* PyObjectCallOneArg */
42772 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)42773 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
42774     PyObject *result;
42775     PyObject *args = PyTuple_New(1);
42776     if (unlikely(!args)) return NULL;
42777     Py_INCREF(arg);
42778     PyTuple_SET_ITEM(args, 0, arg);
42779     result = __Pyx_PyObject_Call(func, args, NULL);
42780     Py_DECREF(args);
42781     return result;
42782 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)42783 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
42784 #if CYTHON_FAST_PYCALL
42785     if (PyFunction_Check(func)) {
42786         return __Pyx_PyFunction_FastCall(func, &arg, 1);
42787     }
42788 #endif
42789     if (likely(PyCFunction_Check(func))) {
42790         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
42791             return __Pyx_PyObject_CallMethO(func, arg);
42792 #if CYTHON_FAST_PYCCALL
42793         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
42794             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
42795 #endif
42796         }
42797     }
42798     return __Pyx__PyObject_CallOneArg(func, arg);
42799 }
42800 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)42801 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
42802     PyObject *result;
42803     PyObject *args = PyTuple_Pack(1, arg);
42804     if (unlikely(!args)) return NULL;
42805     result = __Pyx_PyObject_Call(func, args, NULL);
42806     Py_DECREF(args);
42807     return result;
42808 }
42809 #endif
42810 
42811 /* DictGetItem */
42812 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)42813 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
42814     PyObject *value;
42815     value = PyDict_GetItemWithError(d, key);
42816     if (unlikely(!value)) {
42817         if (!PyErr_Occurred()) {
42818             if (unlikely(PyTuple_Check(key))) {
42819                 PyObject* args = PyTuple_Pack(1, key);
42820                 if (likely(args)) {
42821                     PyErr_SetObject(PyExc_KeyError, args);
42822                     Py_DECREF(args);
42823                 }
42824             } else {
42825                 PyErr_SetObject(PyExc_KeyError, key);
42826             }
42827         }
42828         return NULL;
42829     }
42830     Py_INCREF(value);
42831     return value;
42832 }
42833 #endif
42834 
42835 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)42836 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
42837     if (unlikely(!type)) {
42838         PyErr_SetString(PyExc_SystemError, "Missing type object");
42839         return 0;
42840     }
42841     if (likely(__Pyx_TypeCheck(obj, type)))
42842         return 1;
42843     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
42844                  Py_TYPE(obj)->tp_name, type->tp_name);
42845     return 0;
42846 }
42847 
42848 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)42849 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
42850 {
42851   union {
42852     uint32_t u32;
42853     uint8_t u8[4];
42854   } S;
42855   S.u32 = 0x01020304;
42856   return S.u8[0] == 4;
42857 }
42858 
42859 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)42860 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
42861                               __Pyx_BufFmt_StackElem* stack,
42862                               __Pyx_TypeInfo* type) {
42863   stack[0].field = &ctx->root;
42864   stack[0].parent_offset = 0;
42865   ctx->root.type = type;
42866   ctx->root.name = "buffer dtype";
42867   ctx->root.offset = 0;
42868   ctx->head = stack;
42869   ctx->head->field = &ctx->root;
42870   ctx->fmt_offset = 0;
42871   ctx->head->parent_offset = 0;
42872   ctx->new_packmode = '@';
42873   ctx->enc_packmode = '@';
42874   ctx->new_count = 1;
42875   ctx->enc_count = 0;
42876   ctx->enc_type = 0;
42877   ctx->is_complex = 0;
42878   ctx->is_valid_array = 0;
42879   ctx->struct_alignment = 0;
42880   while (type->typegroup == 'S') {
42881     ++ctx->head;
42882     ctx->head->field = type->fields;
42883     ctx->head->parent_offset = 0;
42884     type = type->fields->type;
42885   }
42886 }
__Pyx_BufFmt_ParseNumber(const char ** ts)42887 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
42888     int count;
42889     const char* t = *ts;
42890     if (*t < '0' || *t > '9') {
42891       return -1;
42892     } else {
42893         count = *t++ - '0';
42894         while (*t >= '0' && *t <= '9') {
42895             count *= 10;
42896             count += *t++ - '0';
42897         }
42898     }
42899     *ts = t;
42900     return count;
42901 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)42902 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
42903     int number = __Pyx_BufFmt_ParseNumber(ts);
42904     if (number == -1)
42905         PyErr_Format(PyExc_ValueError,\
42906                      "Does not understand character buffer dtype format string ('%c')", **ts);
42907     return number;
42908 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)42909 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
42910   PyErr_Format(PyExc_ValueError,
42911                "Unexpected format string character: '%c'", ch);
42912 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)42913 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
42914   switch (ch) {
42915     case 'c': return "'char'";
42916     case 'b': return "'signed char'";
42917     case 'B': return "'unsigned char'";
42918     case 'h': return "'short'";
42919     case 'H': return "'unsigned short'";
42920     case 'i': return "'int'";
42921     case 'I': return "'unsigned int'";
42922     case 'l': return "'long'";
42923     case 'L': return "'unsigned long'";
42924     case 'q': return "'long long'";
42925     case 'Q': return "'unsigned long long'";
42926     case 'f': return (is_complex ? "'complex float'" : "'float'");
42927     case 'd': return (is_complex ? "'complex double'" : "'double'");
42928     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
42929     case 'T': return "a struct";
42930     case 'O': return "Python object";
42931     case 'P': return "a pointer";
42932     case 's': case 'p': return "a string";
42933     case 0: return "end";
42934     default: return "unparseable format string";
42935   }
42936 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)42937 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
42938   switch (ch) {
42939     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
42940     case 'h': case 'H': return 2;
42941     case 'i': case 'I': case 'l': case 'L': return 4;
42942     case 'q': case 'Q': return 8;
42943     case 'f': return (is_complex ? 8 : 4);
42944     case 'd': return (is_complex ? 16 : 8);
42945     case 'g': {
42946       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
42947       return 0;
42948     }
42949     case 'O': case 'P': return sizeof(void*);
42950     default:
42951       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
42952       return 0;
42953     }
42954 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)42955 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
42956   switch (ch) {
42957     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
42958     case 'h': case 'H': return sizeof(short);
42959     case 'i': case 'I': return sizeof(int);
42960     case 'l': case 'L': return sizeof(long);
42961     #ifdef HAVE_LONG_LONG
42962     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
42963     #endif
42964     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
42965     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
42966     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
42967     case 'O': case 'P': return sizeof(void*);
42968     default: {
42969       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
42970       return 0;
42971     }
42972   }
42973 }
42974 typedef struct { char c; short x; } __Pyx_st_short;
42975 typedef struct { char c; int x; } __Pyx_st_int;
42976 typedef struct { char c; long x; } __Pyx_st_long;
42977 typedef struct { char c; float x; } __Pyx_st_float;
42978 typedef struct { char c; double x; } __Pyx_st_double;
42979 typedef struct { char c; long double x; } __Pyx_st_longdouble;
42980 typedef struct { char c; void *x; } __Pyx_st_void_p;
42981 #ifdef HAVE_LONG_LONG
42982 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
42983 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)42984 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
42985   switch (ch) {
42986     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
42987     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
42988     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
42989     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
42990 #ifdef HAVE_LONG_LONG
42991     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
42992 #endif
42993     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
42994     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
42995     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
42996     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
42997     default:
42998       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
42999       return 0;
43000     }
43001 }
43002 /* These are for computing the padding at the end of the struct to align
43003    on the first member of the struct. This will probably the same as above,
43004    but we don't have any guarantees.
43005  */
43006 typedef struct { short x; char c; } __Pyx_pad_short;
43007 typedef struct { int x; char c; } __Pyx_pad_int;
43008 typedef struct { long x; char c; } __Pyx_pad_long;
43009 typedef struct { float x; char c; } __Pyx_pad_float;
43010 typedef struct { double x; char c; } __Pyx_pad_double;
43011 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
43012 typedef struct { void *x; char c; } __Pyx_pad_void_p;
43013 #ifdef HAVE_LONG_LONG
43014 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
43015 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)43016 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
43017   switch (ch) {
43018     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
43019     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
43020     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
43021     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
43022 #ifdef HAVE_LONG_LONG
43023     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
43024 #endif
43025     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
43026     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
43027     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
43028     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
43029     default:
43030       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
43031       return 0;
43032     }
43033 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)43034 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
43035   switch (ch) {
43036     case 'c':
43037         return 'H';
43038     case 'b': case 'h': case 'i':
43039     case 'l': case 'q': case 's': case 'p':
43040         return 'I';
43041     case 'B': case 'H': case 'I': case 'L': case 'Q':
43042         return 'U';
43043     case 'f': case 'd': case 'g':
43044         return (is_complex ? 'C' : 'R');
43045     case 'O':
43046         return 'O';
43047     case 'P':
43048         return 'P';
43049     default: {
43050       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
43051       return 0;
43052     }
43053   }
43054 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)43055 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
43056   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
43057     const char* expected;
43058     const char* quote;
43059     if (ctx->head == NULL) {
43060       expected = "end";
43061       quote = "";
43062     } else {
43063       expected = ctx->head->field->type->name;
43064       quote = "'";
43065     }
43066     PyErr_Format(PyExc_ValueError,
43067                  "Buffer dtype mismatch, expected %s%s%s but got %s",
43068                  quote, expected, quote,
43069                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
43070   } else {
43071     __Pyx_StructField* field = ctx->head->field;
43072     __Pyx_StructField* parent = (ctx->head - 1)->field;
43073     PyErr_Format(PyExc_ValueError,
43074                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
43075                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
43076                  parent->type->name, field->name);
43077   }
43078 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)43079 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
43080   char group;
43081   size_t size, offset, arraysize = 1;
43082   if (ctx->enc_type == 0) return 0;
43083   if (ctx->head->field->type->arraysize[0]) {
43084     int i, ndim = 0;
43085     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
43086         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
43087         ndim = 1;
43088         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
43089             PyErr_Format(PyExc_ValueError,
43090                          "Expected a dimension of size %zu, got %zu",
43091                          ctx->head->field->type->arraysize[0], ctx->enc_count);
43092             return -1;
43093         }
43094     }
43095     if (!ctx->is_valid_array) {
43096       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
43097                    ctx->head->field->type->ndim, ndim);
43098       return -1;
43099     }
43100     for (i = 0; i < ctx->head->field->type->ndim; i++) {
43101       arraysize *= ctx->head->field->type->arraysize[i];
43102     }
43103     ctx->is_valid_array = 0;
43104     ctx->enc_count = 1;
43105   }
43106   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
43107   do {
43108     __Pyx_StructField* field = ctx->head->field;
43109     __Pyx_TypeInfo* type = field->type;
43110     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
43111       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
43112     } else {
43113       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
43114     }
43115     if (ctx->enc_packmode == '@') {
43116       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
43117       size_t align_mod_offset;
43118       if (align_at == 0) return -1;
43119       align_mod_offset = ctx->fmt_offset % align_at;
43120       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
43121       if (ctx->struct_alignment == 0)
43122           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
43123                                                                  ctx->is_complex);
43124     }
43125     if (type->size != size || type->typegroup != group) {
43126       if (type->typegroup == 'C' && type->fields != NULL) {
43127         size_t parent_offset = ctx->head->parent_offset + field->offset;
43128         ++ctx->head;
43129         ctx->head->field = type->fields;
43130         ctx->head->parent_offset = parent_offset;
43131         continue;
43132       }
43133       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
43134       } else {
43135           __Pyx_BufFmt_RaiseExpected(ctx);
43136           return -1;
43137       }
43138     }
43139     offset = ctx->head->parent_offset + field->offset;
43140     if (ctx->fmt_offset != offset) {
43141       PyErr_Format(PyExc_ValueError,
43142                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
43143                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
43144       return -1;
43145     }
43146     ctx->fmt_offset += size;
43147     if (arraysize)
43148       ctx->fmt_offset += (arraysize - 1) * size;
43149     --ctx->enc_count;
43150     while (1) {
43151       if (field == &ctx->root) {
43152         ctx->head = NULL;
43153         if (ctx->enc_count != 0) {
43154           __Pyx_BufFmt_RaiseExpected(ctx);
43155           return -1;
43156         }
43157         break;
43158       }
43159       ctx->head->field = ++field;
43160       if (field->type == NULL) {
43161         --ctx->head;
43162         field = ctx->head->field;
43163         continue;
43164       } else if (field->type->typegroup == 'S') {
43165         size_t parent_offset = ctx->head->parent_offset + field->offset;
43166         if (field->type->fields->type == NULL) continue;
43167         field = field->type->fields;
43168         ++ctx->head;
43169         ctx->head->field = field;
43170         ctx->head->parent_offset = parent_offset;
43171         break;
43172       } else {
43173         break;
43174       }
43175     }
43176   } while (ctx->enc_count);
43177   ctx->enc_type = 0;
43178   ctx->is_complex = 0;
43179   return 0;
43180 }
43181 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)43182 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
43183 {
43184     const char *ts = *tsp;
43185     int i = 0, number;
43186     int ndim = ctx->head->field->type->ndim;
43187 ;
43188     ++ts;
43189     if (ctx->new_count != 1) {
43190         PyErr_SetString(PyExc_ValueError,
43191                         "Cannot handle repeated arrays in format string");
43192         return NULL;
43193     }
43194     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43195     while (*ts && *ts != ')') {
43196         switch (*ts) {
43197             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
43198             default:  break;
43199         }
43200         number = __Pyx_BufFmt_ExpectNumber(&ts);
43201         if (number == -1) return NULL;
43202         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
43203             return PyErr_Format(PyExc_ValueError,
43204                         "Expected a dimension of size %zu, got %d",
43205                         ctx->head->field->type->arraysize[i], number);
43206         if (*ts != ',' && *ts != ')')
43207             return PyErr_Format(PyExc_ValueError,
43208                                 "Expected a comma in format string, got '%c'", *ts);
43209         if (*ts == ',') ts++;
43210         i++;
43211     }
43212     if (i != ndim)
43213         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
43214                             ctx->head->field->type->ndim, i);
43215     if (!*ts) {
43216         PyErr_SetString(PyExc_ValueError,
43217                         "Unexpected end of format string, expected ')'");
43218         return NULL;
43219     }
43220     ctx->is_valid_array = 1;
43221     ctx->new_count = 1;
43222     *tsp = ++ts;
43223     return Py_None;
43224 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)43225 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
43226   int got_Z = 0;
43227   while (1) {
43228     switch(*ts) {
43229       case 0:
43230         if (ctx->enc_type != 0 && ctx->head == NULL) {
43231           __Pyx_BufFmt_RaiseExpected(ctx);
43232           return NULL;
43233         }
43234         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43235         if (ctx->head != NULL) {
43236           __Pyx_BufFmt_RaiseExpected(ctx);
43237           return NULL;
43238         }
43239         return ts;
43240       case ' ':
43241       case '\r':
43242       case '\n':
43243         ++ts;
43244         break;
43245       case '<':
43246         if (!__Pyx_Is_Little_Endian()) {
43247           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
43248           return NULL;
43249         }
43250         ctx->new_packmode = '=';
43251         ++ts;
43252         break;
43253       case '>':
43254       case '!':
43255         if (__Pyx_Is_Little_Endian()) {
43256           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
43257           return NULL;
43258         }
43259         ctx->new_packmode = '=';
43260         ++ts;
43261         break;
43262       case '=':
43263       case '@':
43264       case '^':
43265         ctx->new_packmode = *ts++;
43266         break;
43267       case 'T':
43268         {
43269           const char* ts_after_sub;
43270           size_t i, struct_count = ctx->new_count;
43271           size_t struct_alignment = ctx->struct_alignment;
43272           ctx->new_count = 1;
43273           ++ts;
43274           if (*ts != '{') {
43275             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
43276             return NULL;
43277           }
43278           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43279           ctx->enc_type = 0;
43280           ctx->enc_count = 0;
43281           ctx->struct_alignment = 0;
43282           ++ts;
43283           ts_after_sub = ts;
43284           for (i = 0; i != struct_count; ++i) {
43285             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
43286             if (!ts_after_sub) return NULL;
43287           }
43288           ts = ts_after_sub;
43289           if (struct_alignment) ctx->struct_alignment = struct_alignment;
43290         }
43291         break;
43292       case '}':
43293         {
43294           size_t alignment = ctx->struct_alignment;
43295           ++ts;
43296           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43297           ctx->enc_type = 0;
43298           if (alignment && ctx->fmt_offset % alignment) {
43299             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
43300           }
43301         }
43302         return ts;
43303       case 'x':
43304         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43305         ctx->fmt_offset += ctx->new_count;
43306         ctx->new_count = 1;
43307         ctx->enc_count = 0;
43308         ctx->enc_type = 0;
43309         ctx->enc_packmode = ctx->new_packmode;
43310         ++ts;
43311         break;
43312       case 'Z':
43313         got_Z = 1;
43314         ++ts;
43315         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
43316           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
43317           return NULL;
43318         }
43319         CYTHON_FALLTHROUGH;
43320       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
43321       case 'l': case 'L': case 'q': case 'Q':
43322       case 'f': case 'd': case 'g':
43323       case 'O': case 'p':
43324         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
43325             ctx->enc_packmode == ctx->new_packmode) {
43326           ctx->enc_count += ctx->new_count;
43327           ctx->new_count = 1;
43328           got_Z = 0;
43329           ++ts;
43330           break;
43331         }
43332         CYTHON_FALLTHROUGH;
43333       case 's':
43334         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
43335         ctx->enc_count = ctx->new_count;
43336         ctx->enc_packmode = ctx->new_packmode;
43337         ctx->enc_type = *ts;
43338         ctx->is_complex = got_Z;
43339         ++ts;
43340         ctx->new_count = 1;
43341         got_Z = 0;
43342         break;
43343       case ':':
43344         ++ts;
43345         while(*ts != ':') ++ts;
43346         ++ts;
43347         break;
43348       case '(':
43349         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
43350         break;
43351       default:
43352         {
43353           int number = __Pyx_BufFmt_ExpectNumber(&ts);
43354           if (number == -1) return NULL;
43355           ctx->new_count = (size_t)number;
43356         }
43357     }
43358   }
43359 }
43360 
43361 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)43362   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
43363   if (unlikely(info->buf == NULL)) return;
43364   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
43365   __Pyx_ReleaseBuffer(info);
43366 }
__Pyx_ZeroBuffer(Py_buffer * buf)43367 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
43368   buf->buf = NULL;
43369   buf->obj = NULL;
43370   buf->strides = __Pyx_zeros;
43371   buf->shape = __Pyx_zeros;
43372   buf->suboffsets = __Pyx_minusones;
43373 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)43374 static int __Pyx__GetBufferAndValidate(
43375         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
43376         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
43377 {
43378   buf->buf = NULL;
43379   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
43380     __Pyx_ZeroBuffer(buf);
43381     return -1;
43382   }
43383   if (unlikely(buf->ndim != nd)) {
43384     PyErr_Format(PyExc_ValueError,
43385                  "Buffer has wrong number of dimensions (expected %d, got %d)",
43386                  nd, buf->ndim);
43387     goto fail;
43388   }
43389   if (!cast) {
43390     __Pyx_BufFmt_Context ctx;
43391     __Pyx_BufFmt_Init(&ctx, stack, dtype);
43392     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
43393   }
43394   if (unlikely((size_t)buf->itemsize != dtype->size)) {
43395     PyErr_Format(PyExc_ValueError,
43396       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
43397       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
43398       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
43399     goto fail;
43400   }
43401   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
43402   return 0;
43403 fail:;
43404   __Pyx_SafeReleaseBuffer(buf);
43405   return -1;
43406 }
43407 
43408 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)43409   static void __Pyx_RaiseBufferFallbackError(void) {
43410   PyErr_SetString(PyExc_ValueError,
43411      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
43412 }
43413 
43414 /* None */
__Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t a,__pyx_t_5numpy_int32_t b)43415   static CYTHON_INLINE __pyx_t_5numpy_int32_t __Pyx_div___pyx_t_5numpy_int32_t(__pyx_t_5numpy_int32_t a, __pyx_t_5numpy_int32_t b) {
43416     __pyx_t_5numpy_int32_t q = a / b;
43417     __pyx_t_5numpy_int32_t r = a - q*b;
43418     q -= ((r != 0) & ((r ^ b) < 0));
43419     return q;
43420 }
43421 
43422 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)43423   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
43424     PyObject *args, *result = NULL;
43425     #if CYTHON_FAST_PYCALL
43426     if (PyFunction_Check(function)) {
43427         PyObject *args[2] = {arg1, arg2};
43428         return __Pyx_PyFunction_FastCall(function, args, 2);
43429     }
43430     #endif
43431     #if CYTHON_FAST_PYCCALL
43432     if (__Pyx_PyFastCFunction_Check(function)) {
43433         PyObject *args[2] = {arg1, arg2};
43434         return __Pyx_PyCFunction_FastCall(function, args, 2);
43435     }
43436     #endif
43437     args = PyTuple_New(2);
43438     if (unlikely(!args)) goto done;
43439     Py_INCREF(arg1);
43440     PyTuple_SET_ITEM(args, 0, arg1);
43441     Py_INCREF(arg2);
43442     PyTuple_SET_ITEM(args, 1, arg2);
43443     Py_INCREF(function);
43444     result = __Pyx_PyObject_Call(function, args, NULL);
43445     Py_DECREF(args);
43446     Py_DECREF(function);
43447 done:
43448     return result;
43449 }
43450 
43451 /* MemviewSliceInit */
43452   static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)43453 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
43454                         int ndim,
43455                         __Pyx_memviewslice *memviewslice,
43456                         int memview_is_new_reference)
43457 {
43458     __Pyx_RefNannyDeclarations
43459     int i, retval=-1;
43460     Py_buffer *buf = &memview->view;
43461     __Pyx_RefNannySetupContext("init_memviewslice", 0);
43462     if (memviewslice->memview || memviewslice->data) {
43463         PyErr_SetString(PyExc_ValueError,
43464             "memviewslice is already initialized!");
43465         goto fail;
43466     }
43467     if (buf->strides) {
43468         for (i = 0; i < ndim; i++) {
43469             memviewslice->strides[i] = buf->strides[i];
43470         }
43471     } else {
43472         Py_ssize_t stride = buf->itemsize;
43473         for (i = ndim - 1; i >= 0; i--) {
43474             memviewslice->strides[i] = stride;
43475             stride *= buf->shape[i];
43476         }
43477     }
43478     for (i = 0; i < ndim; i++) {
43479         memviewslice->shape[i]   = buf->shape[i];
43480         if (buf->suboffsets) {
43481             memviewslice->suboffsets[i] = buf->suboffsets[i];
43482         } else {
43483             memviewslice->suboffsets[i] = -1;
43484         }
43485     }
43486     memviewslice->memview = memview;
43487     memviewslice->data = (char *)buf->buf;
43488     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
43489         Py_INCREF(memview);
43490     }
43491     retval = 0;
43492     goto no_fail;
43493 fail:
43494     memviewslice->memview = 0;
43495     memviewslice->data = 0;
43496     retval = -1;
43497 no_fail:
43498     __Pyx_RefNannyFinishContext();
43499     return retval;
43500 }
43501 #ifndef Py_NO_RETURN
43502 #define Py_NO_RETURN
43503 #endif
__pyx_fatalerror(const char * fmt,...)43504 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
43505     va_list vargs;
43506     char msg[200];
43507 #ifdef HAVE_STDARG_PROTOTYPES
43508     va_start(vargs, fmt);
43509 #else
43510     va_start(vargs);
43511 #endif
43512     vsnprintf(msg, 200, fmt, vargs);
43513     va_end(vargs);
43514     Py_FatalError(msg);
43515 }
43516 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)43517 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
43518                                    PyThread_type_lock lock)
43519 {
43520     int result;
43521     PyThread_acquire_lock(lock, 1);
43522     result = (*acquisition_count)++;
43523     PyThread_release_lock(lock);
43524     return result;
43525 }
43526 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)43527 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
43528                                    PyThread_type_lock lock)
43529 {
43530     int result;
43531     PyThread_acquire_lock(lock, 1);
43532     result = (*acquisition_count)--;
43533     PyThread_release_lock(lock);
43534     return result;
43535 }
43536 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)43537 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
43538 {
43539     int first_time;
43540     struct __pyx_memoryview_obj *memview = memslice->memview;
43541     if (!memview || (PyObject *) memview == Py_None)
43542         return;
43543     if (__pyx_get_slice_count(memview) < 0)
43544         __pyx_fatalerror("Acquisition count is %d (line %d)",
43545                          __pyx_get_slice_count(memview), lineno);
43546     first_time = __pyx_add_acquisition_count(memview) == 0;
43547     if (first_time) {
43548         if (have_gil) {
43549             Py_INCREF((PyObject *) memview);
43550         } else {
43551             PyGILState_STATE _gilstate = PyGILState_Ensure();
43552             Py_INCREF((PyObject *) memview);
43553             PyGILState_Release(_gilstate);
43554         }
43555     }
43556 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)43557 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
43558                                              int have_gil, int lineno) {
43559     int last_time;
43560     struct __pyx_memoryview_obj *memview = memslice->memview;
43561     if (!memview ) {
43562         return;
43563     } else if ((PyObject *) memview == Py_None) {
43564         memslice->memview = NULL;
43565         return;
43566     }
43567     if (__pyx_get_slice_count(memview) <= 0)
43568         __pyx_fatalerror("Acquisition count is %d (line %d)",
43569                          __pyx_get_slice_count(memview), lineno);
43570     last_time = __pyx_sub_acquisition_count(memview) == 1;
43571     memslice->data = NULL;
43572     if (last_time) {
43573         if (have_gil) {
43574             Py_CLEAR(memslice->memview);
43575         } else {
43576             PyGILState_STATE _gilstate = PyGILState_Ensure();
43577             Py_CLEAR(memslice->memview);
43578             PyGILState_Release(_gilstate);
43579         }
43580     } else {
43581         memslice->memview = NULL;
43582     }
43583 }
43584 
43585 /* PyErrFetchRestore */
43586   #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)43587 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
43588     PyObject *tmp_type, *tmp_value, *tmp_tb;
43589     tmp_type = tstate->curexc_type;
43590     tmp_value = tstate->curexc_value;
43591     tmp_tb = tstate->curexc_traceback;
43592     tstate->curexc_type = type;
43593     tstate->curexc_value = value;
43594     tstate->curexc_traceback = tb;
43595     Py_XDECREF(tmp_type);
43596     Py_XDECREF(tmp_value);
43597     Py_XDECREF(tmp_tb);
43598 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)43599 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
43600     *type = tstate->curexc_type;
43601     *value = tstate->curexc_value;
43602     *tb = tstate->curexc_traceback;
43603     tstate->curexc_type = 0;
43604     tstate->curexc_value = 0;
43605     tstate->curexc_traceback = 0;
43606 }
43607 #endif
43608 
43609 /* RaiseException */
43610   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)43611 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
43612                         CYTHON_UNUSED PyObject *cause) {
43613     __Pyx_PyThreadState_declare
43614     Py_XINCREF(type);
43615     if (!value || value == Py_None)
43616         value = NULL;
43617     else
43618         Py_INCREF(value);
43619     if (!tb || tb == Py_None)
43620         tb = NULL;
43621     else {
43622         Py_INCREF(tb);
43623         if (!PyTraceBack_Check(tb)) {
43624             PyErr_SetString(PyExc_TypeError,
43625                 "raise: arg 3 must be a traceback or None");
43626             goto raise_error;
43627         }
43628     }
43629     if (PyType_Check(type)) {
43630 #if CYTHON_COMPILING_IN_PYPY
43631         if (!value) {
43632             Py_INCREF(Py_None);
43633             value = Py_None;
43634         }
43635 #endif
43636         PyErr_NormalizeException(&type, &value, &tb);
43637     } else {
43638         if (value) {
43639             PyErr_SetString(PyExc_TypeError,
43640                 "instance exception may not have a separate value");
43641             goto raise_error;
43642         }
43643         value = type;
43644         type = (PyObject*) Py_TYPE(type);
43645         Py_INCREF(type);
43646         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
43647             PyErr_SetString(PyExc_TypeError,
43648                 "raise: exception class must be a subclass of BaseException");
43649             goto raise_error;
43650         }
43651     }
43652     __Pyx_PyThreadState_assign
43653     __Pyx_ErrRestore(type, value, tb);
43654     return;
43655 raise_error:
43656     Py_XDECREF(value);
43657     Py_XDECREF(type);
43658     Py_XDECREF(tb);
43659     return;
43660 }
43661 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)43662 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
43663     PyObject* owned_instance = NULL;
43664     if (tb == Py_None) {
43665         tb = 0;
43666     } else if (tb && !PyTraceBack_Check(tb)) {
43667         PyErr_SetString(PyExc_TypeError,
43668             "raise: arg 3 must be a traceback or None");
43669         goto bad;
43670     }
43671     if (value == Py_None)
43672         value = 0;
43673     if (PyExceptionInstance_Check(type)) {
43674         if (value) {
43675             PyErr_SetString(PyExc_TypeError,
43676                 "instance exception may not have a separate value");
43677             goto bad;
43678         }
43679         value = type;
43680         type = (PyObject*) Py_TYPE(value);
43681     } else if (PyExceptionClass_Check(type)) {
43682         PyObject *instance_class = NULL;
43683         if (value && PyExceptionInstance_Check(value)) {
43684             instance_class = (PyObject*) Py_TYPE(value);
43685             if (instance_class != type) {
43686                 int is_subclass = PyObject_IsSubclass(instance_class, type);
43687                 if (!is_subclass) {
43688                     instance_class = NULL;
43689                 } else if (unlikely(is_subclass == -1)) {
43690                     goto bad;
43691                 } else {
43692                     type = instance_class;
43693                 }
43694             }
43695         }
43696         if (!instance_class) {
43697             PyObject *args;
43698             if (!value)
43699                 args = PyTuple_New(0);
43700             else if (PyTuple_Check(value)) {
43701                 Py_INCREF(value);
43702                 args = value;
43703             } else
43704                 args = PyTuple_Pack(1, value);
43705             if (!args)
43706                 goto bad;
43707             owned_instance = PyObject_Call(type, args, NULL);
43708             Py_DECREF(args);
43709             if (!owned_instance)
43710                 goto bad;
43711             value = owned_instance;
43712             if (!PyExceptionInstance_Check(value)) {
43713                 PyErr_Format(PyExc_TypeError,
43714                              "calling %R should have returned an instance of "
43715                              "BaseException, not %R",
43716                              type, Py_TYPE(value));
43717                 goto bad;
43718             }
43719         }
43720     } else {
43721         PyErr_SetString(PyExc_TypeError,
43722             "raise: exception class must be a subclass of BaseException");
43723         goto bad;
43724     }
43725     if (cause) {
43726         PyObject *fixed_cause;
43727         if (cause == Py_None) {
43728             fixed_cause = NULL;
43729         } else if (PyExceptionClass_Check(cause)) {
43730             fixed_cause = PyObject_CallObject(cause, NULL);
43731             if (fixed_cause == NULL)
43732                 goto bad;
43733         } else if (PyExceptionInstance_Check(cause)) {
43734             fixed_cause = cause;
43735             Py_INCREF(fixed_cause);
43736         } else {
43737             PyErr_SetString(PyExc_TypeError,
43738                             "exception causes must derive from "
43739                             "BaseException");
43740             goto bad;
43741         }
43742         PyException_SetCause(value, fixed_cause);
43743     }
43744     PyErr_SetObject(type, value);
43745     if (tb) {
43746 #if CYTHON_COMPILING_IN_PYPY
43747         PyObject *tmp_type, *tmp_value, *tmp_tb;
43748         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
43749         Py_INCREF(tb);
43750         PyErr_Restore(tmp_type, tmp_value, tb);
43751         Py_XDECREF(tmp_tb);
43752 #else
43753         PyThreadState *tstate = __Pyx_PyThreadState_Current;
43754         PyObject* tmp_tb = tstate->curexc_traceback;
43755         if (tb != tmp_tb) {
43756             Py_INCREF(tb);
43757             tstate->curexc_traceback = tb;
43758             Py_XDECREF(tmp_tb);
43759         }
43760 #endif
43761     }
43762 bad:
43763     Py_XDECREF(owned_instance);
43764     return;
43765 }
43766 #endif
43767 
43768 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)43769   static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
43770                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
43771                                   int full_traceback, CYTHON_UNUSED int nogil) {
43772     PyObject *old_exc, *old_val, *old_tb;
43773     PyObject *ctx;
43774     __Pyx_PyThreadState_declare
43775 #ifdef WITH_THREAD
43776     PyGILState_STATE state;
43777     if (nogil)
43778         state = PyGILState_Ensure();
43779 #ifdef _MSC_VER
43780     else state = (PyGILState_STATE)-1;
43781 #endif
43782 #endif
43783     __Pyx_PyThreadState_assign
43784     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
43785     if (full_traceback) {
43786         Py_XINCREF(old_exc);
43787         Py_XINCREF(old_val);
43788         Py_XINCREF(old_tb);
43789         __Pyx_ErrRestore(old_exc, old_val, old_tb);
43790         PyErr_PrintEx(1);
43791     }
43792     #if PY_MAJOR_VERSION < 3
43793     ctx = PyString_FromString(name);
43794     #else
43795     ctx = PyUnicode_FromString(name);
43796     #endif
43797     __Pyx_ErrRestore(old_exc, old_val, old_tb);
43798     if (!ctx) {
43799         PyErr_WriteUnraisable(Py_None);
43800     } else {
43801         PyErr_WriteUnraisable(ctx);
43802         Py_DECREF(ctx);
43803     }
43804 #ifdef WITH_THREAD
43805     if (nogil)
43806         PyGILState_Release(state);
43807 #endif
43808 }
43809 
43810 /* PyDictVersioning */
43811   #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)43812 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
43813     PyObject *dict = Py_TYPE(obj)->tp_dict;
43814     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
43815 }
__Pyx_get_object_dict_version(PyObject * obj)43816 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
43817     PyObject **dictptr = NULL;
43818     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
43819     if (offset) {
43820 #if CYTHON_COMPILING_IN_CPYTHON
43821         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
43822 #else
43823         dictptr = _PyObject_GetDictPtr(obj);
43824 #endif
43825     }
43826     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
43827 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)43828 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
43829     PyObject *dict = Py_TYPE(obj)->tp_dict;
43830     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
43831         return 0;
43832     return obj_dict_version == __Pyx_get_object_dict_version(obj);
43833 }
43834 #endif
43835 
43836 /* GetModuleGlobalName */
43837   #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)43838 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
43839 #else
43840 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
43841 #endif
43842 {
43843     PyObject *result;
43844 #if !CYTHON_AVOID_BORROWED_REFS
43845 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
43846     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
43847     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
43848     if (likely(result)) {
43849         return __Pyx_NewRef(result);
43850     } else if (unlikely(PyErr_Occurred())) {
43851         return NULL;
43852     }
43853 #else
43854     result = PyDict_GetItem(__pyx_d, name);
43855     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
43856     if (likely(result)) {
43857         return __Pyx_NewRef(result);
43858     }
43859 #endif
43860 #else
43861     result = PyObject_GetItem(__pyx_d, name);
43862     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
43863     if (likely(result)) {
43864         return __Pyx_NewRef(result);
43865     }
43866     PyErr_Clear();
43867 #endif
43868     return __Pyx_GetBuiltinName(name);
43869 }
43870 
43871 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)43872   static void __Pyx_RaiseBufferIndexError(int axis) {
43873   PyErr_Format(PyExc_IndexError,
43874      "Out of bounds on buffer access (axis %d)", axis);
43875 }
43876 
43877 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)43878   static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
43879 {
43880     if (unlikely(!type)) {
43881         PyErr_SetString(PyExc_SystemError, "Missing type object");
43882         return 0;
43883     }
43884     else if (exact) {
43885         #if PY_MAJOR_VERSION == 2
43886         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
43887         #endif
43888     }
43889     else {
43890         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
43891     }
43892     PyErr_Format(PyExc_TypeError,
43893         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
43894         name, type->tp_name, Py_TYPE(obj)->tp_name);
43895     return 0;
43896 }
43897 
43898 /* ObjectGetItem */
43899   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)43900 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
43901     PyObject *runerr;
43902     Py_ssize_t key_value;
43903     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
43904     if (unlikely(!(m && m->sq_item))) {
43905         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
43906         return NULL;
43907     }
43908     key_value = __Pyx_PyIndex_AsSsize_t(index);
43909     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
43910         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
43911     }
43912     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
43913         PyErr_Clear();
43914         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
43915     }
43916     return NULL;
43917 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)43918 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
43919     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
43920     if (likely(m && m->mp_subscript)) {
43921         return m->mp_subscript(obj, key);
43922     }
43923     return __Pyx_PyObject_GetIndex(obj, key);
43924 }
43925 #endif
43926 
43927 /* PyIntBinop */
43928   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)43929 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
43930     (void)inplace;
43931     (void)zerodivision_check;
43932     #if PY_MAJOR_VERSION < 3
43933     if (likely(PyInt_CheckExact(op1))) {
43934         const long b = intval;
43935         long x;
43936         long a = PyInt_AS_LONG(op1);
43937             x = (long)((unsigned long)a - b);
43938             if (likely((x^a) >= 0 || (x^~b) >= 0))
43939                 return PyInt_FromLong(x);
43940             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
43941     }
43942     #endif
43943     #if CYTHON_USE_PYLONG_INTERNALS
43944     if (likely(PyLong_CheckExact(op1))) {
43945         const long b = intval;
43946         long a, x;
43947 #ifdef HAVE_LONG_LONG
43948         const PY_LONG_LONG llb = intval;
43949         PY_LONG_LONG lla, llx;
43950 #endif
43951         const digit* digits = ((PyLongObject*)op1)->ob_digit;
43952         const Py_ssize_t size = Py_SIZE(op1);
43953         if (likely(__Pyx_sst_abs(size) <= 1)) {
43954             a = likely(size) ? digits[0] : 0;
43955             if (size == -1) a = -a;
43956         } else {
43957             switch (size) {
43958                 case -2:
43959                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
43960                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
43961                         break;
43962 #ifdef HAVE_LONG_LONG
43963                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
43964                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
43965                         goto long_long;
43966 #endif
43967                     }
43968                     CYTHON_FALLTHROUGH;
43969                 case 2:
43970                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
43971                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
43972                         break;
43973 #ifdef HAVE_LONG_LONG
43974                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
43975                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
43976                         goto long_long;
43977 #endif
43978                     }
43979                     CYTHON_FALLTHROUGH;
43980                 case -3:
43981                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
43982                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
43983                         break;
43984 #ifdef HAVE_LONG_LONG
43985                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
43986                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
43987                         goto long_long;
43988 #endif
43989                     }
43990                     CYTHON_FALLTHROUGH;
43991                 case 3:
43992                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
43993                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
43994                         break;
43995 #ifdef HAVE_LONG_LONG
43996                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
43997                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
43998                         goto long_long;
43999 #endif
44000                     }
44001                     CYTHON_FALLTHROUGH;
44002                 case -4:
44003                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
44004                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44005                         break;
44006 #ifdef HAVE_LONG_LONG
44007                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
44008                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
44009                         goto long_long;
44010 #endif
44011                     }
44012                     CYTHON_FALLTHROUGH;
44013                 case 4:
44014                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
44015                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44016                         break;
44017 #ifdef HAVE_LONG_LONG
44018                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
44019                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
44020                         goto long_long;
44021 #endif
44022                     }
44023                     CYTHON_FALLTHROUGH;
44024                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
44025             }
44026         }
44027                 x = a - b;
44028             return PyLong_FromLong(x);
44029 #ifdef HAVE_LONG_LONG
44030         long_long:
44031                 llx = lla - llb;
44032             return PyLong_FromLongLong(llx);
44033 #endif
44034 
44035 
44036     }
44037     #endif
44038     if (PyFloat_CheckExact(op1)) {
44039         const long b = intval;
44040         double a = PyFloat_AS_DOUBLE(op1);
44041             double result;
44042             PyFPE_START_PROTECT("subtract", return NULL)
44043             result = ((double)a) - (double)b;
44044             PyFPE_END_PROTECT(result)
44045             return PyFloat_FromDouble(result);
44046     }
44047     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
44048 }
44049 #endif
44050 
44051 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)44052   static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
44053     PyObject *attr;
44054 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
44055     PyTypeObject *tp = Py_TYPE(obj);
44056     PyObject *descr;
44057     descrgetfunc f = NULL;
44058     PyObject **dictptr, *dict;
44059     int meth_found = 0;
44060     assert (*method == NULL);
44061     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
44062         attr = __Pyx_PyObject_GetAttrStr(obj, name);
44063         goto try_unpack;
44064     }
44065     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
44066         return 0;
44067     }
44068     descr = _PyType_Lookup(tp, name);
44069     if (likely(descr != NULL)) {
44070         Py_INCREF(descr);
44071 #if PY_MAJOR_VERSION >= 3
44072         #ifdef __Pyx_CyFunction_USED
44073         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
44074         #else
44075         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
44076         #endif
44077 #else
44078         #ifdef __Pyx_CyFunction_USED
44079         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
44080         #else
44081         if (likely(PyFunction_Check(descr)))
44082         #endif
44083 #endif
44084         {
44085             meth_found = 1;
44086         } else {
44087             f = Py_TYPE(descr)->tp_descr_get;
44088             if (f != NULL && PyDescr_IsData(descr)) {
44089                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
44090                 Py_DECREF(descr);
44091                 goto try_unpack;
44092             }
44093         }
44094     }
44095     dictptr = _PyObject_GetDictPtr(obj);
44096     if (dictptr != NULL && (dict = *dictptr) != NULL) {
44097         Py_INCREF(dict);
44098         attr = __Pyx_PyDict_GetItemStr(dict, name);
44099         if (attr != NULL) {
44100             Py_INCREF(attr);
44101             Py_DECREF(dict);
44102             Py_XDECREF(descr);
44103             goto try_unpack;
44104         }
44105         Py_DECREF(dict);
44106     }
44107     if (meth_found) {
44108         *method = descr;
44109         return 1;
44110     }
44111     if (f != NULL) {
44112         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
44113         Py_DECREF(descr);
44114         goto try_unpack;
44115     }
44116     if (descr != NULL) {
44117         *method = descr;
44118         return 0;
44119     }
44120     PyErr_Format(PyExc_AttributeError,
44121 #if PY_MAJOR_VERSION >= 3
44122                  "'%.50s' object has no attribute '%U'",
44123                  tp->tp_name, name);
44124 #else
44125                  "'%.50s' object has no attribute '%.400s'",
44126                  tp->tp_name, PyString_AS_STRING(name));
44127 #endif
44128     return 0;
44129 #else
44130     attr = __Pyx_PyObject_GetAttrStr(obj, name);
44131     goto try_unpack;
44132 #endif
44133 try_unpack:
44134 #if CYTHON_UNPACK_METHODS
44135     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
44136         PyObject *function = PyMethod_GET_FUNCTION(attr);
44137         Py_INCREF(function);
44138         Py_DECREF(attr);
44139         *method = function;
44140         return 1;
44141     }
44142 #endif
44143     *method = attr;
44144     return 0;
44145 }
44146 
44147 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)44148   static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
44149     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
44150     Py_DECREF(method);
44151     return result;
44152 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)44153 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
44154     PyObject *method = NULL, *result;
44155     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
44156     if (likely(is_method)) {
44157         result = __Pyx_PyObject_Call2Args(method, obj, arg);
44158         Py_DECREF(method);
44159         return result;
44160     }
44161     if (unlikely(!method)) return NULL;
44162     return __Pyx__PyObject_CallMethod1(method, arg);
44163 }
44164 
44165 /* append */
__Pyx_PyObject_Append(PyObject * L,PyObject * x)44166   static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
44167     if (likely(PyList_CheckExact(L))) {
44168         if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
44169     } else {
44170         PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
44171         if (unlikely(!retval))
44172             return -1;
44173         Py_DECREF(retval);
44174     }
44175     return 0;
44176 }
44177 
44178 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)44179   static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
44180 #if CYTHON_COMPILING_IN_PYPY
44181     return PyObject_RichCompareBool(s1, s2, equals);
44182 #else
44183     if (s1 == s2) {
44184         return (equals == Py_EQ);
44185     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
44186         const char *ps1, *ps2;
44187         Py_ssize_t length = PyBytes_GET_SIZE(s1);
44188         if (length != PyBytes_GET_SIZE(s2))
44189             return (equals == Py_NE);
44190         ps1 = PyBytes_AS_STRING(s1);
44191         ps2 = PyBytes_AS_STRING(s2);
44192         if (ps1[0] != ps2[0]) {
44193             return (equals == Py_NE);
44194         } else if (length == 1) {
44195             return (equals == Py_EQ);
44196         } else {
44197             int result;
44198 #if CYTHON_USE_UNICODE_INTERNALS
44199             Py_hash_t hash1, hash2;
44200             hash1 = ((PyBytesObject*)s1)->ob_shash;
44201             hash2 = ((PyBytesObject*)s2)->ob_shash;
44202             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
44203                 return (equals == Py_NE);
44204             }
44205 #endif
44206             result = memcmp(ps1, ps2, (size_t)length);
44207             return (equals == Py_EQ) ? (result == 0) : (result != 0);
44208         }
44209     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
44210         return (equals == Py_NE);
44211     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
44212         return (equals == Py_NE);
44213     } else {
44214         int result;
44215         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
44216         if (!py_result)
44217             return -1;
44218         result = __Pyx_PyObject_IsTrue(py_result);
44219         Py_DECREF(py_result);
44220         return result;
44221     }
44222 #endif
44223 }
44224 
44225 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)44226   static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
44227 #if CYTHON_COMPILING_IN_PYPY
44228     return PyObject_RichCompareBool(s1, s2, equals);
44229 #else
44230 #if PY_MAJOR_VERSION < 3
44231     PyObject* owned_ref = NULL;
44232 #endif
44233     int s1_is_unicode, s2_is_unicode;
44234     if (s1 == s2) {
44235         goto return_eq;
44236     }
44237     s1_is_unicode = PyUnicode_CheckExact(s1);
44238     s2_is_unicode = PyUnicode_CheckExact(s2);
44239 #if PY_MAJOR_VERSION < 3
44240     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
44241         owned_ref = PyUnicode_FromObject(s2);
44242         if (unlikely(!owned_ref))
44243             return -1;
44244         s2 = owned_ref;
44245         s2_is_unicode = 1;
44246     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
44247         owned_ref = PyUnicode_FromObject(s1);
44248         if (unlikely(!owned_ref))
44249             return -1;
44250         s1 = owned_ref;
44251         s1_is_unicode = 1;
44252     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
44253         return __Pyx_PyBytes_Equals(s1, s2, equals);
44254     }
44255 #endif
44256     if (s1_is_unicode & s2_is_unicode) {
44257         Py_ssize_t length;
44258         int kind;
44259         void *data1, *data2;
44260         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
44261             return -1;
44262         length = __Pyx_PyUnicode_GET_LENGTH(s1);
44263         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
44264             goto return_ne;
44265         }
44266 #if CYTHON_USE_UNICODE_INTERNALS
44267         {
44268             Py_hash_t hash1, hash2;
44269         #if CYTHON_PEP393_ENABLED
44270             hash1 = ((PyASCIIObject*)s1)->hash;
44271             hash2 = ((PyASCIIObject*)s2)->hash;
44272         #else
44273             hash1 = ((PyUnicodeObject*)s1)->hash;
44274             hash2 = ((PyUnicodeObject*)s2)->hash;
44275         #endif
44276             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
44277                 goto return_ne;
44278             }
44279         }
44280 #endif
44281         kind = __Pyx_PyUnicode_KIND(s1);
44282         if (kind != __Pyx_PyUnicode_KIND(s2)) {
44283             goto return_ne;
44284         }
44285         data1 = __Pyx_PyUnicode_DATA(s1);
44286         data2 = __Pyx_PyUnicode_DATA(s2);
44287         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
44288             goto return_ne;
44289         } else if (length == 1) {
44290             goto return_eq;
44291         } else {
44292             int result = memcmp(data1, data2, (size_t)(length * kind));
44293             #if PY_MAJOR_VERSION < 3
44294             Py_XDECREF(owned_ref);
44295             #endif
44296             return (equals == Py_EQ) ? (result == 0) : (result != 0);
44297         }
44298     } else if ((s1 == Py_None) & s2_is_unicode) {
44299         goto return_ne;
44300     } else if ((s2 == Py_None) & s1_is_unicode) {
44301         goto return_ne;
44302     } else {
44303         int result;
44304         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
44305         #if PY_MAJOR_VERSION < 3
44306         Py_XDECREF(owned_ref);
44307         #endif
44308         if (!py_result)
44309             return -1;
44310         result = __Pyx_PyObject_IsTrue(py_result);
44311         Py_DECREF(py_result);
44312         return result;
44313     }
44314 return_eq:
44315     #if PY_MAJOR_VERSION < 3
44316     Py_XDECREF(owned_ref);
44317     #endif
44318     return (equals == Py_EQ);
44319 return_ne:
44320     #if PY_MAJOR_VERSION < 3
44321     Py_XDECREF(owned_ref);
44322     #endif
44323     return (equals == Py_NE);
44324 #endif
44325 }
44326 
44327 /* IterFinish */
__Pyx_IterFinish(void)44328   static CYTHON_INLINE int __Pyx_IterFinish(void) {
44329 #if CYTHON_FAST_THREAD_STATE
44330     PyThreadState *tstate = __Pyx_PyThreadState_Current;
44331     PyObject* exc_type = tstate->curexc_type;
44332     if (unlikely(exc_type)) {
44333         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
44334             PyObject *exc_value, *exc_tb;
44335             exc_value = tstate->curexc_value;
44336             exc_tb = tstate->curexc_traceback;
44337             tstate->curexc_type = 0;
44338             tstate->curexc_value = 0;
44339             tstate->curexc_traceback = 0;
44340             Py_DECREF(exc_type);
44341             Py_XDECREF(exc_value);
44342             Py_XDECREF(exc_tb);
44343             return 0;
44344         } else {
44345             return -1;
44346         }
44347     }
44348     return 0;
44349 #else
44350     if (unlikely(PyErr_Occurred())) {
44351         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
44352             PyErr_Clear();
44353             return 0;
44354         } else {
44355             return -1;
44356         }
44357     }
44358     return 0;
44359 #endif
44360 }
44361 
44362 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)44363   static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
44364     PyObject *method = NULL, *result = NULL;
44365     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
44366     if (likely(is_method)) {
44367         result = __Pyx_PyObject_CallOneArg(method, obj);
44368         Py_DECREF(method);
44369         return result;
44370     }
44371     if (unlikely(!method)) goto bad;
44372     result = __Pyx_PyObject_CallNoArg(method);
44373     Py_DECREF(method);
44374 bad:
44375     return result;
44376 }
44377 
44378 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)44379   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
44380     PyErr_Format(PyExc_ValueError,
44381                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
44382                  index, (index == 1) ? "" : "s");
44383 }
44384 
44385 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)44386   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
44387     PyErr_Format(PyExc_ValueError,
44388                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
44389 }
44390 
44391 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)44392   static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
44393     if (unlikely(retval)) {
44394         Py_DECREF(retval);
44395         __Pyx_RaiseTooManyValuesError(expected);
44396         return -1;
44397     } else {
44398         return __Pyx_IterFinish();
44399     }
44400     return 0;
44401 }
44402 
44403 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)44404   static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
44405     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
44406 }
44407 
44408 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)44409   static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
44410     if (t == Py_None) {
44411       __Pyx_RaiseNoneNotIterableError();
44412     } else if (PyTuple_GET_SIZE(t) < index) {
44413       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
44414     } else {
44415       __Pyx_RaiseTooManyValuesError(index);
44416     }
44417 }
44418 
44419 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)44420   static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
44421         PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
44422     PyObject *value1 = NULL, *value2 = NULL;
44423 #if CYTHON_COMPILING_IN_PYPY
44424     value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
44425     value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
44426 #else
44427     value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
44428     value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
44429 #endif
44430     if (decref_tuple) {
44431         Py_DECREF(tuple);
44432     }
44433     *pvalue1 = value1;
44434     *pvalue2 = value2;
44435     return 0;
44436 #if CYTHON_COMPILING_IN_PYPY
44437 bad:
44438     Py_XDECREF(value1);
44439     Py_XDECREF(value2);
44440     if (decref_tuple) { Py_XDECREF(tuple); }
44441     return -1;
44442 #endif
44443 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)44444 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
44445                                        int has_known_size, int decref_tuple) {
44446     Py_ssize_t index;
44447     PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
44448     iternextfunc iternext;
44449     iter = PyObject_GetIter(tuple);
44450     if (unlikely(!iter)) goto bad;
44451     if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
44452     iternext = Py_TYPE(iter)->tp_iternext;
44453     value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
44454     value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
44455     if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
44456     Py_DECREF(iter);
44457     *pvalue1 = value1;
44458     *pvalue2 = value2;
44459     return 0;
44460 unpacking_failed:
44461     if (!has_known_size && __Pyx_IterFinish() == 0)
44462         __Pyx_RaiseNeedMoreValuesError(index);
44463 bad:
44464     Py_XDECREF(iter);
44465     Py_XDECREF(value1);
44466     Py_XDECREF(value2);
44467     if (decref_tuple) { Py_XDECREF(tuple); }
44468     return -1;
44469 }
44470 
44471 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)44472   static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
44473                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
44474     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
44475     *p_source_is_dict = is_dict;
44476     if (is_dict) {
44477 #if !CYTHON_COMPILING_IN_PYPY
44478         *p_orig_length = PyDict_Size(iterable);
44479         Py_INCREF(iterable);
44480         return iterable;
44481 #elif PY_MAJOR_VERSION >= 3
44482         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
44483         PyObject **pp = NULL;
44484         if (method_name) {
44485             const char *name = PyUnicode_AsUTF8(method_name);
44486             if (strcmp(name, "iteritems") == 0) pp = &py_items;
44487             else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
44488             else if (strcmp(name, "itervalues") == 0) pp = &py_values;
44489             if (pp) {
44490                 if (!*pp) {
44491                     *pp = PyUnicode_FromString(name + 4);
44492                     if (!*pp)
44493                         return NULL;
44494                 }
44495                 method_name = *pp;
44496             }
44497         }
44498 #endif
44499     }
44500     *p_orig_length = 0;
44501     if (method_name) {
44502         PyObject* iter;
44503         iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
44504         if (!iterable)
44505             return NULL;
44506 #if !CYTHON_COMPILING_IN_PYPY
44507         if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
44508             return iterable;
44509 #endif
44510         iter = PyObject_GetIter(iterable);
44511         Py_DECREF(iterable);
44512         return iter;
44513     }
44514     return PyObject_GetIter(iterable);
44515 }
__Pyx_dict_iter_next(PyObject * iter_obj,CYTHON_NCP_UNUSED Py_ssize_t orig_length,CYTHON_NCP_UNUSED Py_ssize_t * ppos,PyObject ** pkey,PyObject ** pvalue,PyObject ** pitem,int source_is_dict)44516 static CYTHON_INLINE int __Pyx_dict_iter_next(
44517         PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
44518         PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
44519     PyObject* next_item;
44520 #if !CYTHON_COMPILING_IN_PYPY
44521     if (source_is_dict) {
44522         PyObject *key, *value;
44523         if (unlikely(orig_length != PyDict_Size(iter_obj))) {
44524             PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
44525             return -1;
44526         }
44527         if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
44528             return 0;
44529         }
44530         if (pitem) {
44531             PyObject* tuple = PyTuple_New(2);
44532             if (unlikely(!tuple)) {
44533                 return -1;
44534             }
44535             Py_INCREF(key);
44536             Py_INCREF(value);
44537             PyTuple_SET_ITEM(tuple, 0, key);
44538             PyTuple_SET_ITEM(tuple, 1, value);
44539             *pitem = tuple;
44540         } else {
44541             if (pkey) {
44542                 Py_INCREF(key);
44543                 *pkey = key;
44544             }
44545             if (pvalue) {
44546                 Py_INCREF(value);
44547                 *pvalue = value;
44548             }
44549         }
44550         return 1;
44551     } else if (PyTuple_CheckExact(iter_obj)) {
44552         Py_ssize_t pos = *ppos;
44553         if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
44554         *ppos = pos + 1;
44555         next_item = PyTuple_GET_ITEM(iter_obj, pos);
44556         Py_INCREF(next_item);
44557     } else if (PyList_CheckExact(iter_obj)) {
44558         Py_ssize_t pos = *ppos;
44559         if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
44560         *ppos = pos + 1;
44561         next_item = PyList_GET_ITEM(iter_obj, pos);
44562         Py_INCREF(next_item);
44563     } else
44564 #endif
44565     {
44566         next_item = PyIter_Next(iter_obj);
44567         if (unlikely(!next_item)) {
44568             return __Pyx_IterFinish();
44569         }
44570     }
44571     if (pitem) {
44572         *pitem = next_item;
44573     } else if (pkey && pvalue) {
44574         if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
44575             return -1;
44576     } else if (pkey) {
44577         *pkey = next_item;
44578     } else {
44579         *pvalue = next_item;
44580     }
44581     return 1;
44582 }
44583 
44584 /* KeywordStringCheck */
__Pyx_CheckKeywordStrings(PyObject * kwdict,const char * function_name,int kw_allowed)44585   static int __Pyx_CheckKeywordStrings(
44586     PyObject *kwdict,
44587     const char* function_name,
44588     int kw_allowed)
44589 {
44590     PyObject* key = 0;
44591     Py_ssize_t pos = 0;
44592 #if CYTHON_COMPILING_IN_PYPY
44593     if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
44594         goto invalid_keyword;
44595     return 1;
44596 #else
44597     while (PyDict_Next(kwdict, &pos, &key, 0)) {
44598         #if PY_MAJOR_VERSION < 3
44599         if (unlikely(!PyString_Check(key)))
44600         #endif
44601             if (unlikely(!PyUnicode_Check(key)))
44602                 goto invalid_keyword_type;
44603     }
44604     if ((!kw_allowed) && unlikely(key))
44605         goto invalid_keyword;
44606     return 1;
44607 invalid_keyword_type:
44608     PyErr_Format(PyExc_TypeError,
44609         "%.200s() keywords must be strings", function_name);
44610     return 0;
44611 #endif
44612 invalid_keyword:
44613     PyErr_Format(PyExc_TypeError,
44614     #if PY_MAJOR_VERSION < 3
44615         "%.200s() got an unexpected keyword argument '%.200s'",
44616         function_name, PyString_AsString(key));
44617     #else
44618         "%s() got an unexpected keyword argument '%U'",
44619         function_name, key);
44620     #endif
44621     return 0;
44622 }
44623 
44624 /* GetTopmostException */
44625   #if CYTHON_USE_EXC_INFO_STACK
44626 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)44627 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
44628 {
44629     _PyErr_StackItem *exc_info = tstate->exc_info;
44630     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
44631            exc_info->previous_item != NULL)
44632     {
44633         exc_info = exc_info->previous_item;
44634     }
44635     return exc_info;
44636 }
44637 #endif
44638 
44639 /* SaveResetException */
44640   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)44641 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
44642     #if CYTHON_USE_EXC_INFO_STACK
44643     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
44644     *type = exc_info->exc_type;
44645     *value = exc_info->exc_value;
44646     *tb = exc_info->exc_traceback;
44647     #else
44648     *type = tstate->exc_type;
44649     *value = tstate->exc_value;
44650     *tb = tstate->exc_traceback;
44651     #endif
44652     Py_XINCREF(*type);
44653     Py_XINCREF(*value);
44654     Py_XINCREF(*tb);
44655 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)44656 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
44657     PyObject *tmp_type, *tmp_value, *tmp_tb;
44658     #if CYTHON_USE_EXC_INFO_STACK
44659     _PyErr_StackItem *exc_info = tstate->exc_info;
44660     tmp_type = exc_info->exc_type;
44661     tmp_value = exc_info->exc_value;
44662     tmp_tb = exc_info->exc_traceback;
44663     exc_info->exc_type = type;
44664     exc_info->exc_value = value;
44665     exc_info->exc_traceback = tb;
44666     #else
44667     tmp_type = tstate->exc_type;
44668     tmp_value = tstate->exc_value;
44669     tmp_tb = tstate->exc_traceback;
44670     tstate->exc_type = type;
44671     tstate->exc_value = value;
44672     tstate->exc_traceback = tb;
44673     #endif
44674     Py_XDECREF(tmp_type);
44675     Py_XDECREF(tmp_value);
44676     Py_XDECREF(tmp_tb);
44677 }
44678 #endif
44679 
44680 /* PyErrExceptionMatches */
44681   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)44682 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
44683     Py_ssize_t i, n;
44684     n = PyTuple_GET_SIZE(tuple);
44685 #if PY_MAJOR_VERSION >= 3
44686     for (i=0; i<n; i++) {
44687         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
44688     }
44689 #endif
44690     for (i=0; i<n; i++) {
44691         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
44692     }
44693     return 0;
44694 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)44695 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
44696     PyObject *exc_type = tstate->curexc_type;
44697     if (exc_type == err) return 1;
44698     if (unlikely(!exc_type)) return 0;
44699     if (unlikely(PyTuple_Check(err)))
44700         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
44701     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
44702 }
44703 #endif
44704 
44705 /* GetException */
44706   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)44707 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
44708 #else
44709 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
44710 #endif
44711 {
44712     PyObject *local_type, *local_value, *local_tb;
44713 #if CYTHON_FAST_THREAD_STATE
44714     PyObject *tmp_type, *tmp_value, *tmp_tb;
44715     local_type = tstate->curexc_type;
44716     local_value = tstate->curexc_value;
44717     local_tb = tstate->curexc_traceback;
44718     tstate->curexc_type = 0;
44719     tstate->curexc_value = 0;
44720     tstate->curexc_traceback = 0;
44721 #else
44722     PyErr_Fetch(&local_type, &local_value, &local_tb);
44723 #endif
44724     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
44725 #if CYTHON_FAST_THREAD_STATE
44726     if (unlikely(tstate->curexc_type))
44727 #else
44728     if (unlikely(PyErr_Occurred()))
44729 #endif
44730         goto bad;
44731     #if PY_MAJOR_VERSION >= 3
44732     if (local_tb) {
44733         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
44734             goto bad;
44735     }
44736     #endif
44737     Py_XINCREF(local_tb);
44738     Py_XINCREF(local_type);
44739     Py_XINCREF(local_value);
44740     *type = local_type;
44741     *value = local_value;
44742     *tb = local_tb;
44743 #if CYTHON_FAST_THREAD_STATE
44744     #if CYTHON_USE_EXC_INFO_STACK
44745     {
44746         _PyErr_StackItem *exc_info = tstate->exc_info;
44747         tmp_type = exc_info->exc_type;
44748         tmp_value = exc_info->exc_value;
44749         tmp_tb = exc_info->exc_traceback;
44750         exc_info->exc_type = local_type;
44751         exc_info->exc_value = local_value;
44752         exc_info->exc_traceback = local_tb;
44753     }
44754     #else
44755     tmp_type = tstate->exc_type;
44756     tmp_value = tstate->exc_value;
44757     tmp_tb = tstate->exc_traceback;
44758     tstate->exc_type = local_type;
44759     tstate->exc_value = local_value;
44760     tstate->exc_traceback = local_tb;
44761     #endif
44762     Py_XDECREF(tmp_type);
44763     Py_XDECREF(tmp_value);
44764     Py_XDECREF(tmp_tb);
44765 #else
44766     PyErr_SetExcInfo(local_type, local_value, local_tb);
44767 #endif
44768     return 0;
44769 bad:
44770     *type = 0;
44771     *value = 0;
44772     *tb = 0;
44773     Py_XDECREF(local_type);
44774     Py_XDECREF(local_value);
44775     Py_XDECREF(local_tb);
44776     return -1;
44777 }
44778 
44779 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)44780   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
44781 #if CYTHON_USE_TYPE_SLOTS
44782 #if PY_MAJOR_VERSION >= 3
44783     if (likely(PyUnicode_Check(n)))
44784 #else
44785     if (likely(PyString_Check(n)))
44786 #endif
44787         return __Pyx_PyObject_GetAttrStr(o, n);
44788 #endif
44789     return PyObject_GetAttr(o, n);
44790 }
44791 
44792 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)44793   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
44794     PyObject *r;
44795     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
44796         PyErr_SetString(PyExc_TypeError,
44797                         "hasattr(): attribute name must be string");
44798         return -1;
44799     }
44800     r = __Pyx_GetAttr(o, n);
44801     if (unlikely(!r)) {
44802         PyErr_Clear();
44803         return 0;
44804     } else {
44805         Py_DECREF(r);
44806         return 1;
44807     }
44808 }
44809 
44810 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)44811   static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
44812     Py_ssize_t q = a / b;
44813     Py_ssize_t r = a - q*b;
44814     q -= ((r != 0) & ((r ^ b) < 0));
44815     return q;
44816 }
44817 
44818 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))44819   static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
44820          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
44821          const char* encoding, const char* errors,
44822          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
44823     Py_ssize_t length;
44824     if (unlikely((start < 0) | (stop < 0))) {
44825         size_t slen = strlen(cstring);
44826         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
44827             PyErr_SetString(PyExc_OverflowError,
44828                             "c-string too long to convert to Python");
44829             return NULL;
44830         }
44831         length = (Py_ssize_t) slen;
44832         if (start < 0) {
44833             start += length;
44834             if (start < 0)
44835                 start = 0;
44836         }
44837         if (stop < 0)
44838             stop += length;
44839     }
44840     length = stop - start;
44841     if (unlikely(length <= 0))
44842         return PyUnicode_FromUnicode(NULL, 0);
44843     cstring += start;
44844     if (decode_func) {
44845         return decode_func(cstring, length, errors);
44846     } else {
44847         return PyUnicode_Decode(cstring, length, encoding, errors);
44848     }
44849 }
44850 
44851 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)44852   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
44853     __Pyx_PyThreadState_declare
44854     __Pyx_PyThreadState_assign
44855     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
44856         return NULL;
44857     __Pyx_PyErr_Clear();
44858     Py_INCREF(d);
44859     return d;
44860 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)44861 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
44862     PyObject *r = __Pyx_GetAttr(o, n);
44863     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
44864 }
44865 
44866 /* SwapException */
44867   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)44868 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
44869     PyObject *tmp_type, *tmp_value, *tmp_tb;
44870     #if CYTHON_USE_EXC_INFO_STACK
44871     _PyErr_StackItem *exc_info = tstate->exc_info;
44872     tmp_type = exc_info->exc_type;
44873     tmp_value = exc_info->exc_value;
44874     tmp_tb = exc_info->exc_traceback;
44875     exc_info->exc_type = *type;
44876     exc_info->exc_value = *value;
44877     exc_info->exc_traceback = *tb;
44878     #else
44879     tmp_type = tstate->exc_type;
44880     tmp_value = tstate->exc_value;
44881     tmp_tb = tstate->exc_traceback;
44882     tstate->exc_type = *type;
44883     tstate->exc_value = *value;
44884     tstate->exc_traceback = *tb;
44885     #endif
44886     *type = tmp_type;
44887     *value = tmp_value;
44888     *tb = tmp_tb;
44889 }
44890 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)44891 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
44892     PyObject *tmp_type, *tmp_value, *tmp_tb;
44893     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
44894     PyErr_SetExcInfo(*type, *value, *tb);
44895     *type = tmp_type;
44896     *value = tmp_value;
44897     *tb = tmp_tb;
44898 }
44899 #endif
44900 
44901 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)44902   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
44903     PyObject *empty_list = 0;
44904     PyObject *module = 0;
44905     PyObject *global_dict = 0;
44906     PyObject *empty_dict = 0;
44907     PyObject *list;
44908     #if PY_MAJOR_VERSION < 3
44909     PyObject *py_import;
44910     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
44911     if (!py_import)
44912         goto bad;
44913     #endif
44914     if (from_list)
44915         list = from_list;
44916     else {
44917         empty_list = PyList_New(0);
44918         if (!empty_list)
44919             goto bad;
44920         list = empty_list;
44921     }
44922     global_dict = PyModule_GetDict(__pyx_m);
44923     if (!global_dict)
44924         goto bad;
44925     empty_dict = PyDict_New();
44926     if (!empty_dict)
44927         goto bad;
44928     {
44929         #if PY_MAJOR_VERSION >= 3
44930         if (level == -1) {
44931             if (strchr(__Pyx_MODULE_NAME, '.')) {
44932                 module = PyImport_ImportModuleLevelObject(
44933                     name, global_dict, empty_dict, list, 1);
44934                 if (!module) {
44935                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
44936                         goto bad;
44937                     PyErr_Clear();
44938                 }
44939             }
44940             level = 0;
44941         }
44942         #endif
44943         if (!module) {
44944             #if PY_MAJOR_VERSION < 3
44945             PyObject *py_level = PyInt_FromLong(level);
44946             if (!py_level)
44947                 goto bad;
44948             module = PyObject_CallFunctionObjArgs(py_import,
44949                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
44950             Py_DECREF(py_level);
44951             #else
44952             module = PyImport_ImportModuleLevelObject(
44953                 name, global_dict, empty_dict, list, level);
44954             #endif
44955         }
44956     }
44957 bad:
44958     #if PY_MAJOR_VERSION < 3
44959     Py_XDECREF(py_import);
44960     #endif
44961     Py_XDECREF(empty_list);
44962     Py_XDECREF(empty_dict);
44963     return module;
44964 }
44965 
44966 /* FastTypeChecks */
44967   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)44968 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
44969     while (a) {
44970         a = a->tp_base;
44971         if (a == b)
44972             return 1;
44973     }
44974     return b == &PyBaseObject_Type;
44975 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)44976 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
44977     PyObject *mro;
44978     if (a == b) return 1;
44979     mro = a->tp_mro;
44980     if (likely(mro)) {
44981         Py_ssize_t i, n;
44982         n = PyTuple_GET_SIZE(mro);
44983         for (i = 0; i < n; i++) {
44984             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
44985                 return 1;
44986         }
44987         return 0;
44988     }
44989     return __Pyx_InBases(a, b);
44990 }
44991 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)44992 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
44993     PyObject *exception, *value, *tb;
44994     int res;
44995     __Pyx_PyThreadState_declare
44996     __Pyx_PyThreadState_assign
44997     __Pyx_ErrFetch(&exception, &value, &tb);
44998     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
44999     if (unlikely(res == -1)) {
45000         PyErr_WriteUnraisable(err);
45001         res = 0;
45002     }
45003     if (!res) {
45004         res = PyObject_IsSubclass(err, exc_type2);
45005         if (unlikely(res == -1)) {
45006             PyErr_WriteUnraisable(err);
45007             res = 0;
45008         }
45009     }
45010     __Pyx_ErrRestore(exception, value, tb);
45011     return res;
45012 }
45013 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)45014 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
45015     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
45016     if (!res) {
45017         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
45018     }
45019     return res;
45020 }
45021 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)45022 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
45023     Py_ssize_t i, n;
45024     assert(PyExceptionClass_Check(exc_type));
45025     n = PyTuple_GET_SIZE(tuple);
45026 #if PY_MAJOR_VERSION >= 3
45027     for (i=0; i<n; i++) {
45028         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
45029     }
45030 #endif
45031     for (i=0; i<n; i++) {
45032         PyObject *t = PyTuple_GET_ITEM(tuple, i);
45033         #if PY_MAJOR_VERSION < 3
45034         if (likely(exc_type == t)) return 1;
45035         #endif
45036         if (likely(PyExceptionClass_Check(t))) {
45037             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
45038         } else {
45039         }
45040     }
45041     return 0;
45042 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)45043 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
45044     if (likely(err == exc_type)) return 1;
45045     if (likely(PyExceptionClass_Check(err))) {
45046         if (likely(PyExceptionClass_Check(exc_type))) {
45047             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
45048         } else if (likely(PyTuple_Check(exc_type))) {
45049             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
45050         } else {
45051         }
45052     }
45053     return PyErr_GivenExceptionMatches(err, exc_type);
45054 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)45055 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
45056     assert(PyExceptionClass_Check(exc_type1));
45057     assert(PyExceptionClass_Check(exc_type2));
45058     if (likely(err == exc_type1 || err == exc_type2)) return 1;
45059     if (likely(PyExceptionClass_Check(err))) {
45060         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
45061     }
45062     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
45063 }
45064 #endif
45065 
45066 /* PyIntBinop */
45067   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)45068 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
45069     (void)inplace;
45070     (void)zerodivision_check;
45071     #if PY_MAJOR_VERSION < 3
45072     if (likely(PyInt_CheckExact(op1))) {
45073         const long b = intval;
45074         long x;
45075         long a = PyInt_AS_LONG(op1);
45076             x = (long)((unsigned long)a + b);
45077             if (likely((x^a) >= 0 || (x^b) >= 0))
45078                 return PyInt_FromLong(x);
45079             return PyLong_Type.tp_as_number->nb_add(op1, op2);
45080     }
45081     #endif
45082     #if CYTHON_USE_PYLONG_INTERNALS
45083     if (likely(PyLong_CheckExact(op1))) {
45084         const long b = intval;
45085         long a, x;
45086 #ifdef HAVE_LONG_LONG
45087         const PY_LONG_LONG llb = intval;
45088         PY_LONG_LONG lla, llx;
45089 #endif
45090         const digit* digits = ((PyLongObject*)op1)->ob_digit;
45091         const Py_ssize_t size = Py_SIZE(op1);
45092         if (likely(__Pyx_sst_abs(size) <= 1)) {
45093             a = likely(size) ? digits[0] : 0;
45094             if (size == -1) a = -a;
45095         } else {
45096             switch (size) {
45097                 case -2:
45098                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
45099                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45100                         break;
45101 #ifdef HAVE_LONG_LONG
45102                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
45103                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45104                         goto long_long;
45105 #endif
45106                     }
45107                     CYTHON_FALLTHROUGH;
45108                 case 2:
45109                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
45110                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45111                         break;
45112 #ifdef HAVE_LONG_LONG
45113                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
45114                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45115                         goto long_long;
45116 #endif
45117                     }
45118                     CYTHON_FALLTHROUGH;
45119                 case -3:
45120                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
45121                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45122                         break;
45123 #ifdef HAVE_LONG_LONG
45124                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
45125                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45126                         goto long_long;
45127 #endif
45128                     }
45129                     CYTHON_FALLTHROUGH;
45130                 case 3:
45131                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
45132                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45133                         break;
45134 #ifdef HAVE_LONG_LONG
45135                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
45136                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45137                         goto long_long;
45138 #endif
45139                     }
45140                     CYTHON_FALLTHROUGH;
45141                 case -4:
45142                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
45143                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45144                         break;
45145 #ifdef HAVE_LONG_LONG
45146                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
45147                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45148                         goto long_long;
45149 #endif
45150                     }
45151                     CYTHON_FALLTHROUGH;
45152                 case 4:
45153                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
45154                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
45155                         break;
45156 #ifdef HAVE_LONG_LONG
45157                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
45158                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
45159                         goto long_long;
45160 #endif
45161                     }
45162                     CYTHON_FALLTHROUGH;
45163                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
45164             }
45165         }
45166                 x = a + b;
45167             return PyLong_FromLong(x);
45168 #ifdef HAVE_LONG_LONG
45169         long_long:
45170                 llx = lla + llb;
45171             return PyLong_FromLongLong(llx);
45172 #endif
45173 
45174 
45175     }
45176     #endif
45177     if (PyFloat_CheckExact(op1)) {
45178         const long b = intval;
45179         double a = PyFloat_AS_DOUBLE(op1);
45180             double result;
45181             PyFPE_START_PROTECT("add", return NULL)
45182             result = ((double)a) + (double)b;
45183             PyFPE_END_PROTECT(result)
45184             return PyFloat_FromDouble(result);
45185     }
45186     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
45187 }
45188 #endif
45189 
45190 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)45191   static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
45192     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
45193 }
45194 
45195 /* None */
__Pyx_div_long(long a,long b)45196   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
45197     long q = a / b;
45198     long r = a - q*b;
45199     q -= ((r != 0) & ((r ^ b) < 0));
45200     return q;
45201 }
45202 
45203 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)45204   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
45205     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
45206     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
45207         PyErr_Format(PyExc_ImportError,
45208         #if PY_MAJOR_VERSION < 3
45209             "cannot import name %.230s", PyString_AS_STRING(name));
45210         #else
45211             "cannot import name %S", name);
45212         #endif
45213     }
45214     return value;
45215 }
45216 
45217 /* StringJoin */
45218   #if !CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyBytes_Join(PyObject * sep,PyObject * values)45219 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
45220     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
45221 }
45222 #endif
45223 
45224 /* CallNextTpDealloc */
__Pyx_call_next_tp_dealloc(PyObject * obj,destructor current_tp_dealloc)45225   static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
45226     PyTypeObject* type = Py_TYPE(obj);
45227     while (type && type->tp_dealloc != current_tp_dealloc)
45228         type = type->tp_base;
45229     while (type && type->tp_dealloc == current_tp_dealloc)
45230         type = type->tp_base;
45231     if (type)
45232         type->tp_dealloc(obj);
45233 }
45234 
45235 /* PyObject_GenericGetAttrNoDict */
45236   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)45237 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
45238     PyErr_Format(PyExc_AttributeError,
45239 #if PY_MAJOR_VERSION >= 3
45240                  "'%.50s' object has no attribute '%U'",
45241                  tp->tp_name, attr_name);
45242 #else
45243                  "'%.50s' object has no attribute '%.400s'",
45244                  tp->tp_name, PyString_AS_STRING(attr_name));
45245 #endif
45246     return NULL;
45247 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)45248 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
45249     PyObject *descr;
45250     PyTypeObject *tp = Py_TYPE(obj);
45251     if (unlikely(!PyString_Check(attr_name))) {
45252         return PyObject_GenericGetAttr(obj, attr_name);
45253     }
45254     assert(!tp->tp_dictoffset);
45255     descr = _PyType_Lookup(tp, attr_name);
45256     if (unlikely(!descr)) {
45257         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
45258     }
45259     Py_INCREF(descr);
45260     #if PY_MAJOR_VERSION < 3
45261     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
45262     #endif
45263     {
45264         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
45265         if (unlikely(f)) {
45266             PyObject *res = f(descr, obj, (PyObject *)tp);
45267             Py_DECREF(descr);
45268             return res;
45269         }
45270     }
45271     return descr;
45272 }
45273 #endif
45274 
45275 /* PyObject_GenericGetAttr */
45276   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)45277 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
45278     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
45279         return PyObject_GenericGetAttr(obj, attr_name);
45280     }
45281     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
45282 }
45283 #endif
45284 
45285 /* TypeImport */
45286   #ifndef __PYX_HAVE_RT_ImportType
45287 #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)45288 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
45289     size_t size, enum __Pyx_ImportType_CheckSize check_size)
45290 {
45291     PyObject *result = 0;
45292     char warning[200];
45293     Py_ssize_t basicsize;
45294 #ifdef Py_LIMITED_API
45295     PyObject *py_basicsize;
45296 #endif
45297     result = PyObject_GetAttrString(module, class_name);
45298     if (!result)
45299         goto bad;
45300     if (!PyType_Check(result)) {
45301         PyErr_Format(PyExc_TypeError,
45302             "%.200s.%.200s is not a type object",
45303             module_name, class_name);
45304         goto bad;
45305     }
45306 #ifndef Py_LIMITED_API
45307     basicsize = ((PyTypeObject *)result)->tp_basicsize;
45308 #else
45309     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
45310     if (!py_basicsize)
45311         goto bad;
45312     basicsize = PyLong_AsSsize_t(py_basicsize);
45313     Py_DECREF(py_basicsize);
45314     py_basicsize = 0;
45315     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
45316         goto bad;
45317 #endif
45318     if ((size_t)basicsize < size) {
45319         PyErr_Format(PyExc_ValueError,
45320             "%.200s.%.200s size changed, may indicate binary incompatibility. "
45321             "Expected %zd from C header, got %zd from PyObject",
45322             module_name, class_name, size, basicsize);
45323         goto bad;
45324     }
45325     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
45326         PyErr_Format(PyExc_ValueError,
45327             "%.200s.%.200s size changed, may indicate binary incompatibility. "
45328             "Expected %zd from C header, got %zd from PyObject",
45329             module_name, class_name, size, basicsize);
45330         goto bad;
45331     }
45332     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
45333         PyOS_snprintf(warning, sizeof(warning),
45334             "%s.%s size changed, may indicate binary incompatibility. "
45335             "Expected %zd from C header, got %zd from PyObject",
45336             module_name, class_name, size, basicsize);
45337         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
45338     }
45339     return (PyTypeObject *)result;
45340 bad:
45341     Py_XDECREF(result);
45342     return NULL;
45343 }
45344 #endif
45345 
45346 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)45347   static void* __Pyx_GetVtable(PyObject *dict) {
45348     void* ptr;
45349     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
45350     if (!ob)
45351         goto bad;
45352 #if PY_VERSION_HEX >= 0x02070000
45353     ptr = PyCapsule_GetPointer(ob, 0);
45354 #else
45355     ptr = PyCObject_AsVoidPtr(ob);
45356 #endif
45357     if (!ptr && !PyErr_Occurred())
45358         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
45359     Py_DECREF(ob);
45360     return ptr;
45361 bad:
45362     Py_XDECREF(ob);
45363     return NULL;
45364 }
45365 
45366 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)45367   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
45368 #if PY_VERSION_HEX >= 0x02070000
45369     PyObject *ob = PyCapsule_New(vtable, 0, 0);
45370 #else
45371     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
45372 #endif
45373     if (!ob)
45374         goto bad;
45375     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
45376         goto bad;
45377     Py_DECREF(ob);
45378     return 0;
45379 bad:
45380     Py_XDECREF(ob);
45381     return -1;
45382 }
45383 
45384 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)45385   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
45386   int ret;
45387   PyObject *name_attr;
45388   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
45389   if (likely(name_attr)) {
45390       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
45391   } else {
45392       ret = -1;
45393   }
45394   if (unlikely(ret < 0)) {
45395       PyErr_Clear();
45396       ret = 0;
45397   }
45398   Py_XDECREF(name_attr);
45399   return ret;
45400 }
__Pyx_setup_reduce(PyObject * type_obj)45401 static int __Pyx_setup_reduce(PyObject* type_obj) {
45402     int ret = 0;
45403     PyObject *object_reduce = NULL;
45404     PyObject *object_reduce_ex = NULL;
45405     PyObject *reduce = NULL;
45406     PyObject *reduce_ex = NULL;
45407     PyObject *reduce_cython = NULL;
45408     PyObject *setstate = NULL;
45409     PyObject *setstate_cython = NULL;
45410 #if CYTHON_USE_PYTYPE_LOOKUP
45411     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
45412 #else
45413     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
45414 #endif
45415 #if CYTHON_USE_PYTYPE_LOOKUP
45416     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
45417 #else
45418     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
45419 #endif
45420     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
45421     if (reduce_ex == object_reduce_ex) {
45422 #if CYTHON_USE_PYTYPE_LOOKUP
45423         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
45424 #else
45425         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
45426 #endif
45427         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
45428         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
45429             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
45430             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
45431             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
45432             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
45433             if (!setstate) PyErr_Clear();
45434             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
45435                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
45436                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
45437                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
45438             }
45439             PyType_Modified((PyTypeObject*)type_obj);
45440         }
45441     }
45442     goto GOOD;
45443 BAD:
45444     if (!PyErr_Occurred())
45445         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
45446     ret = -1;
45447 GOOD:
45448 #if !CYTHON_USE_PYTYPE_LOOKUP
45449     Py_XDECREF(object_reduce);
45450     Py_XDECREF(object_reduce_ex);
45451 #endif
45452     Py_XDECREF(reduce);
45453     Py_XDECREF(reduce_ex);
45454     Py_XDECREF(reduce_cython);
45455     Py_XDECREF(setstate);
45456     Py_XDECREF(setstate_cython);
45457     return ret;
45458 }
45459 
45460 /* ClassMethod */
__Pyx_Method_ClassMethod(PyObject * method)45461   static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
45462 #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
45463     if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
45464         return PyClassMethod_New(method);
45465     }
45466 #else
45467 #if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
45468     if (PyMethodDescr_Check(method))
45469 #else
45470     static PyTypeObject *methoddescr_type = NULL;
45471     if (methoddescr_type == NULL) {
45472        PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
45473        if (!meth) return NULL;
45474        methoddescr_type = Py_TYPE(meth);
45475        Py_DECREF(meth);
45476     }
45477     if (__Pyx_TypeCheck(method, methoddescr_type))
45478 #endif
45479     {
45480         PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
45481         #if PY_VERSION_HEX < 0x03020000
45482         PyTypeObject *d_type = descr->d_type;
45483         #else
45484         PyTypeObject *d_type = descr->d_common.d_type;
45485         #endif
45486         return PyDescr_NewClassMethod(d_type, descr->d_method);
45487     }
45488 #endif
45489     else if (PyMethod_Check(method)) {
45490         return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
45491     }
45492     else if (PyCFunction_Check(method)) {
45493         return PyClassMethod_New(method);
45494     }
45495 #ifdef __Pyx_CyFunction_USED
45496     else if (__Pyx_CyFunction_Check(method)) {
45497         return PyClassMethod_New(method);
45498     }
45499 #endif
45500     PyErr_SetString(PyExc_TypeError,
45501                    "Class-level classmethod() can only be called on "
45502                    "a method_descriptor or instance method.");
45503     return NULL;
45504 }
45505 
45506 /* GetNameInClass */
__Pyx_GetGlobalNameAfterAttributeLookup(PyObject * name)45507   static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
45508     PyObject *result;
45509     __Pyx_PyThreadState_declare
45510     __Pyx_PyThreadState_assign
45511     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
45512         return NULL;
45513     __Pyx_PyErr_Clear();
45514     __Pyx_GetModuleGlobalNameUncached(result, name);
45515     return result;
45516 }
__Pyx__GetNameInClass(PyObject * nmspace,PyObject * name)45517 static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
45518     PyObject *result;
45519     result = __Pyx_PyObject_GetAttrStr(nmspace, name);
45520     if (!result) {
45521         result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
45522     }
45523     return result;
45524 }
45525 
45526 /* CLineInTraceback */
45527   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)45528 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
45529     PyObject *use_cline;
45530     PyObject *ptype, *pvalue, *ptraceback;
45531 #if CYTHON_COMPILING_IN_CPYTHON
45532     PyObject **cython_runtime_dict;
45533 #endif
45534     if (unlikely(!__pyx_cython_runtime)) {
45535         return c_line;
45536     }
45537     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
45538 #if CYTHON_COMPILING_IN_CPYTHON
45539     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
45540     if (likely(cython_runtime_dict)) {
45541         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
45542             use_cline, *cython_runtime_dict,
45543             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
45544     } else
45545 #endif
45546     {
45547       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
45548       if (use_cline_obj) {
45549         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
45550         Py_DECREF(use_cline_obj);
45551       } else {
45552         PyErr_Clear();
45553         use_cline = NULL;
45554       }
45555     }
45556     if (!use_cline) {
45557         c_line = 0;
45558         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
45559     }
45560     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
45561         c_line = 0;
45562     }
45563     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
45564     return c_line;
45565 }
45566 #endif
45567 
45568 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)45569   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
45570     int start = 0, mid = 0, end = count - 1;
45571     if (end >= 0 && code_line > entries[end].code_line) {
45572         return count;
45573     }
45574     while (start < end) {
45575         mid = start + (end - start) / 2;
45576         if (code_line < entries[mid].code_line) {
45577             end = mid;
45578         } else if (code_line > entries[mid].code_line) {
45579              start = mid + 1;
45580         } else {
45581             return mid;
45582         }
45583     }
45584     if (code_line <= entries[mid].code_line) {
45585         return mid;
45586     } else {
45587         return mid + 1;
45588     }
45589 }
__pyx_find_code_object(int code_line)45590 static PyCodeObject *__pyx_find_code_object(int code_line) {
45591     PyCodeObject* code_object;
45592     int pos;
45593     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
45594         return NULL;
45595     }
45596     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
45597     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
45598         return NULL;
45599     }
45600     code_object = __pyx_code_cache.entries[pos].code_object;
45601     Py_INCREF(code_object);
45602     return code_object;
45603 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)45604 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
45605     int pos, i;
45606     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
45607     if (unlikely(!code_line)) {
45608         return;
45609     }
45610     if (unlikely(!entries)) {
45611         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
45612         if (likely(entries)) {
45613             __pyx_code_cache.entries = entries;
45614             __pyx_code_cache.max_count = 64;
45615             __pyx_code_cache.count = 1;
45616             entries[0].code_line = code_line;
45617             entries[0].code_object = code_object;
45618             Py_INCREF(code_object);
45619         }
45620         return;
45621     }
45622     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
45623     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
45624         PyCodeObject* tmp = entries[pos].code_object;
45625         entries[pos].code_object = code_object;
45626         Py_DECREF(tmp);
45627         return;
45628     }
45629     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
45630         int new_max = __pyx_code_cache.max_count + 64;
45631         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
45632             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
45633         if (unlikely(!entries)) {
45634             return;
45635         }
45636         __pyx_code_cache.entries = entries;
45637         __pyx_code_cache.max_count = new_max;
45638     }
45639     for (i=__pyx_code_cache.count; i>pos; i--) {
45640         entries[i] = entries[i-1];
45641     }
45642     entries[pos].code_line = code_line;
45643     entries[pos].code_object = code_object;
45644     __pyx_code_cache.count++;
45645     Py_INCREF(code_object);
45646 }
45647 
45648 /* AddTraceback */
45649   #include "compile.h"
45650 #include "frameobject.h"
45651 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)45652 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
45653             const char *funcname, int c_line,
45654             int py_line, const char *filename) {
45655     PyCodeObject *py_code = 0;
45656     PyObject *py_srcfile = 0;
45657     PyObject *py_funcname = 0;
45658     #if PY_MAJOR_VERSION < 3
45659     py_srcfile = PyString_FromString(filename);
45660     #else
45661     py_srcfile = PyUnicode_FromString(filename);
45662     #endif
45663     if (!py_srcfile) goto bad;
45664     if (c_line) {
45665         #if PY_MAJOR_VERSION < 3
45666         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
45667         #else
45668         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
45669         #endif
45670     }
45671     else {
45672         #if PY_MAJOR_VERSION < 3
45673         py_funcname = PyString_FromString(funcname);
45674         #else
45675         py_funcname = PyUnicode_FromString(funcname);
45676         #endif
45677     }
45678     if (!py_funcname) goto bad;
45679     py_code = __Pyx_PyCode_New(
45680         0,
45681         0,
45682         0,
45683         0,
45684         0,
45685         __pyx_empty_bytes, /*PyObject *code,*/
45686         __pyx_empty_tuple, /*PyObject *consts,*/
45687         __pyx_empty_tuple, /*PyObject *names,*/
45688         __pyx_empty_tuple, /*PyObject *varnames,*/
45689         __pyx_empty_tuple, /*PyObject *freevars,*/
45690         __pyx_empty_tuple, /*PyObject *cellvars,*/
45691         py_srcfile,   /*PyObject *filename,*/
45692         py_funcname,  /*PyObject *name,*/
45693         py_line,
45694         __pyx_empty_bytes  /*PyObject *lnotab*/
45695     );
45696     Py_DECREF(py_srcfile);
45697     Py_DECREF(py_funcname);
45698     return py_code;
45699 bad:
45700     Py_XDECREF(py_srcfile);
45701     Py_XDECREF(py_funcname);
45702     return NULL;
45703 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)45704 static void __Pyx_AddTraceback(const char *funcname, int c_line,
45705                                int py_line, const char *filename) {
45706     PyCodeObject *py_code = 0;
45707     PyFrameObject *py_frame = 0;
45708     PyThreadState *tstate = __Pyx_PyThreadState_Current;
45709     if (c_line) {
45710         c_line = __Pyx_CLineForTraceback(tstate, c_line);
45711     }
45712     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
45713     if (!py_code) {
45714         py_code = __Pyx_CreateCodeObjectForTraceback(
45715             funcname, c_line, py_line, filename);
45716         if (!py_code) goto bad;
45717         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
45718     }
45719     py_frame = PyFrame_New(
45720         tstate,            /*PyThreadState *tstate,*/
45721         py_code,           /*PyCodeObject *code,*/
45722         __pyx_d,    /*PyObject *globals,*/
45723         0                  /*PyObject *locals*/
45724     );
45725     if (!py_frame) goto bad;
45726     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
45727     PyTraceBack_Here(py_frame);
45728 bad:
45729     Py_XDECREF(py_code);
45730     Py_XDECREF(py_frame);
45731 }
45732 
45733 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)45734 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
45735     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
45736         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
45737         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
45738         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
45739     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
45740     return -1;
45741 }
__Pyx_ReleaseBuffer(Py_buffer * view)45742 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
45743     PyObject *obj = view->obj;
45744     if (!obj) return;
45745     if (PyObject_CheckBuffer(obj)) {
45746         PyBuffer_Release(view);
45747         return;
45748     }
45749     if ((0)) {}
45750         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
45751     view->obj = NULL;
45752     Py_DECREF(obj);
45753 }
45754 #endif
45755 
45756 
45757   /* MemviewSliceIsContig */
45758   static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)45759 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
45760 {
45761     int i, index, step, start;
45762     Py_ssize_t itemsize = mvs.memview->view.itemsize;
45763     if (order == 'F') {
45764         step = 1;
45765         start = 0;
45766     } else {
45767         step = -1;
45768         start = ndim - 1;
45769     }
45770     for (i = 0; i < ndim; i++) {
45771         index = start + step * i;
45772         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
45773             return 0;
45774         itemsize *= mvs.shape[index];
45775     }
45776     return 1;
45777 }
45778 
45779 /* OverlappingSlices */
45780   static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)45781 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
45782                                void **out_start, void **out_end,
45783                                int ndim, size_t itemsize)
45784 {
45785     char *start, *end;
45786     int i;
45787     start = end = slice->data;
45788     for (i = 0; i < ndim; i++) {
45789         Py_ssize_t stride = slice->strides[i];
45790         Py_ssize_t extent = slice->shape[i];
45791         if (extent == 0) {
45792             *out_start = *out_end = start;
45793             return;
45794         } else {
45795             if (stride > 0)
45796                 end += stride * (extent - 1);
45797             else
45798                 start += stride * (extent - 1);
45799         }
45800     }
45801     *out_start = start;
45802     *out_end = end + itemsize;
45803 }
45804 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)45805 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
45806                      __Pyx_memviewslice *slice2,
45807                      int ndim, size_t itemsize)
45808 {
45809     void *start1, *end1, *start2, *end2;
45810     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
45811     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
45812     return (start1 < end2) && (start2 < end1);
45813 }
45814 
45815 /* Capsule */
45816   static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)45817 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
45818 {
45819     PyObject *cobj;
45820 #if PY_VERSION_HEX >= 0x02070000
45821     cobj = PyCapsule_New(p, sig, NULL);
45822 #else
45823     cobj = PyCObject_FromVoidPtr(p, NULL);
45824 #endif
45825     return cobj;
45826 }
45827 
45828 /* CIntToPy */
__Pyx_PyInt_From_int(int value)45829   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
45830     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
45831     const int is_unsigned = neg_one > const_zero;
45832     if (is_unsigned) {
45833         if (sizeof(int) < sizeof(long)) {
45834             return PyInt_FromLong((long) value);
45835         } else if (sizeof(int) <= sizeof(unsigned long)) {
45836             return PyLong_FromUnsignedLong((unsigned long) value);
45837 #ifdef HAVE_LONG_LONG
45838         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
45839             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
45840 #endif
45841         }
45842     } else {
45843         if (sizeof(int) <= sizeof(long)) {
45844             return PyInt_FromLong((long) value);
45845 #ifdef HAVE_LONG_LONG
45846         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
45847             return PyLong_FromLongLong((PY_LONG_LONG) value);
45848 #endif
45849         }
45850     }
45851     {
45852         int one = 1; int little = (int)*(unsigned char *)&one;
45853         unsigned char *bytes = (unsigned char *)&value;
45854         return _PyLong_FromByteArray(bytes, sizeof(int),
45855                                      little, !is_unsigned);
45856     }
45857 }
45858 
45859 /* TypeInfoCompare */
45860   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)45861 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
45862 {
45863     int i;
45864     if (!a || !b)
45865         return 0;
45866     if (a == b)
45867         return 1;
45868     if (a->size != b->size || a->typegroup != b->typegroup ||
45869             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
45870         if (a->typegroup == 'H' || b->typegroup == 'H') {
45871             return a->size == b->size;
45872         } else {
45873             return 0;
45874         }
45875     }
45876     if (a->ndim) {
45877         for (i = 0; i < a->ndim; i++)
45878             if (a->arraysize[i] != b->arraysize[i])
45879                 return 0;
45880     }
45881     if (a->typegroup == 'S') {
45882         if (a->flags != b->flags)
45883             return 0;
45884         if (a->fields || b->fields) {
45885             if (!(a->fields && b->fields))
45886                 return 0;
45887             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
45888                 __Pyx_StructField *field_a = a->fields + i;
45889                 __Pyx_StructField *field_b = b->fields + i;
45890                 if (field_a->offset != field_b->offset ||
45891                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
45892                     return 0;
45893             }
45894             return !a->fields[i].type && !b->fields[i].type;
45895         }
45896     }
45897     return 1;
45898 }
45899 
45900 /* MemviewSliceValidateAndInit */
45901   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)45902 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
45903 {
45904     if (buf->shape[dim] <= 1)
45905         return 1;
45906     if (buf->strides) {
45907         if (spec & __Pyx_MEMVIEW_CONTIG) {
45908             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
45909                 if (buf->strides[dim] != sizeof(void *)) {
45910                     PyErr_Format(PyExc_ValueError,
45911                                  "Buffer is not indirectly contiguous "
45912                                  "in dimension %d.", dim);
45913                     goto fail;
45914                 }
45915             } else if (buf->strides[dim] != buf->itemsize) {
45916                 PyErr_SetString(PyExc_ValueError,
45917                                 "Buffer and memoryview are not contiguous "
45918                                 "in the same dimension.");
45919                 goto fail;
45920             }
45921         }
45922         if (spec & __Pyx_MEMVIEW_FOLLOW) {
45923             Py_ssize_t stride = buf->strides[dim];
45924             if (stride < 0)
45925                 stride = -stride;
45926             if (stride < buf->itemsize) {
45927                 PyErr_SetString(PyExc_ValueError,
45928                                 "Buffer and memoryview are not contiguous "
45929                                 "in the same dimension.");
45930                 goto fail;
45931             }
45932         }
45933     } else {
45934         if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
45935             PyErr_Format(PyExc_ValueError,
45936                          "C-contiguous buffer is not contiguous in "
45937                          "dimension %d", dim);
45938             goto fail;
45939         } else if (spec & (__Pyx_MEMVIEW_PTR)) {
45940             PyErr_Format(PyExc_ValueError,
45941                          "C-contiguous buffer is not indirect in "
45942                          "dimension %d", dim);
45943             goto fail;
45944         } else if (buf->suboffsets) {
45945             PyErr_SetString(PyExc_ValueError,
45946                             "Buffer exposes suboffsets but no strides");
45947             goto fail;
45948         }
45949     }
45950     return 1;
45951 fail:
45952     return 0;
45953 }
45954 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)45955 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
45956 {
45957     if (spec & __Pyx_MEMVIEW_DIRECT) {
45958         if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
45959             PyErr_Format(PyExc_ValueError,
45960                          "Buffer not compatible with direct access "
45961                          "in dimension %d.", dim);
45962             goto fail;
45963         }
45964     }
45965     if (spec & __Pyx_MEMVIEW_PTR) {
45966         if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
45967             PyErr_Format(PyExc_ValueError,
45968                          "Buffer is not indirectly accessible "
45969                          "in dimension %d.", dim);
45970             goto fail;
45971         }
45972     }
45973     return 1;
45974 fail:
45975     return 0;
45976 }
45977 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)45978 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
45979 {
45980     int i;
45981     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
45982         Py_ssize_t stride = 1;
45983         for (i = 0; i < ndim; i++) {
45984             if (stride * buf->itemsize != buf->strides[i] &&
45985                     buf->shape[i] > 1)
45986             {
45987                 PyErr_SetString(PyExc_ValueError,
45988                     "Buffer not fortran contiguous.");
45989                 goto fail;
45990             }
45991             stride = stride * buf->shape[i];
45992         }
45993     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
45994         Py_ssize_t stride = 1;
45995         for (i = ndim - 1; i >- 1; i--) {
45996             if (stride * buf->itemsize != buf->strides[i] &&
45997                     buf->shape[i] > 1) {
45998                 PyErr_SetString(PyExc_ValueError,
45999                     "Buffer not C contiguous.");
46000                 goto fail;
46001             }
46002             stride = stride * buf->shape[i];
46003         }
46004     }
46005     return 1;
46006 fail:
46007     return 0;
46008 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)46009 static int __Pyx_ValidateAndInit_memviewslice(
46010                 int *axes_specs,
46011                 int c_or_f_flag,
46012                 int buf_flags,
46013                 int ndim,
46014                 __Pyx_TypeInfo *dtype,
46015                 __Pyx_BufFmt_StackElem stack[],
46016                 __Pyx_memviewslice *memviewslice,
46017                 PyObject *original_obj)
46018 {
46019     struct __pyx_memoryview_obj *memview, *new_memview;
46020     __Pyx_RefNannyDeclarations
46021     Py_buffer *buf;
46022     int i, spec = 0, retval = -1;
46023     __Pyx_BufFmt_Context ctx;
46024     int from_memoryview = __pyx_memoryview_check(original_obj);
46025     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
46026     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
46027                                                             original_obj)->typeinfo)) {
46028         memview = (struct __pyx_memoryview_obj *) original_obj;
46029         new_memview = NULL;
46030     } else {
46031         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
46032                                             original_obj, buf_flags, 0, dtype);
46033         new_memview = memview;
46034         if (unlikely(!memview))
46035             goto fail;
46036     }
46037     buf = &memview->view;
46038     if (buf->ndim != ndim) {
46039         PyErr_Format(PyExc_ValueError,
46040                 "Buffer has wrong number of dimensions (expected %d, got %d)",
46041                 ndim, buf->ndim);
46042         goto fail;
46043     }
46044     if (new_memview) {
46045         __Pyx_BufFmt_Init(&ctx, stack, dtype);
46046         if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
46047     }
46048     if ((unsigned) buf->itemsize != dtype->size) {
46049         PyErr_Format(PyExc_ValueError,
46050                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
46051                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
46052                      buf->itemsize,
46053                      (buf->itemsize > 1) ? "s" : "",
46054                      dtype->name,
46055                      dtype->size,
46056                      (dtype->size > 1) ? "s" : "");
46057         goto fail;
46058     }
46059     for (i = 0; i < ndim; i++) {
46060         spec = axes_specs[i];
46061         if (!__pyx_check_strides(buf, i, ndim, spec))
46062             goto fail;
46063         if (!__pyx_check_suboffsets(buf, i, ndim, spec))
46064             goto fail;
46065     }
46066     if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
46067         goto fail;
46068     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
46069                                          new_memview != NULL) == -1)) {
46070         goto fail;
46071     }
46072     retval = 0;
46073     goto no_fail;
46074 fail:
46075     Py_XDECREF(new_memview);
46076     retval = -1;
46077 no_fail:
46078     __Pyx_RefNannyFinishContext();
46079     return retval;
46080 }
46081 
46082 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject * obj,int writable_flag)46083   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
46084     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
46085     __Pyx_BufFmt_StackElem stack[1];
46086     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
46087     int retcode;
46088     if (obj == Py_None) {
46089         result.memview = (struct __pyx_memoryview_obj *) Py_None;
46090         return result;
46091     }
46092     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
46093                                                  PyBUF_RECORDS_RO | writable_flag, 2,
46094                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
46095                                                  &result, obj);
46096     if (unlikely(retcode == -1))
46097         goto __pyx_fail;
46098     return result;
46099 __pyx_fail:
46100     result.memview = NULL;
46101     result.data = NULL;
46102     return result;
46103 }
46104 
46105 /* CIntFromPyVerify */
46106   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
46107     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
46108 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
46109     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
46110 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
46111     {\
46112         func_type value = func_value;\
46113         if (sizeof(target_type) < sizeof(func_type)) {\
46114             if (unlikely(value != (func_type) (target_type) value)) {\
46115                 func_type zero = 0;\
46116                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
46117                     return (target_type) -1;\
46118                 if (is_unsigned && unlikely(value < zero))\
46119                     goto raise_neg_overflow;\
46120                 else\
46121                     goto raise_overflow;\
46122             }\
46123         }\
46124         return (target_type) value;\
46125     }
46126 
46127 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject * obj,int writable_flag)46128   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint8_t(PyObject *obj, int writable_flag) {
46129     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
46130     __Pyx_BufFmt_StackElem stack[1];
46131     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
46132     int retcode;
46133     if (obj == Py_None) {
46134         result.memview = (struct __pyx_memoryview_obj *) Py_None;
46135         return result;
46136     }
46137     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
46138                                                  PyBUF_RECORDS_RO | writable_flag, 1,
46139                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
46140                                                  &result, obj);
46141     if (unlikely(retcode == -1))
46142         goto __pyx_fail;
46143     return result;
46144 __pyx_fail:
46145     result.memview = NULL;
46146     result.data = NULL;
46147     return result;
46148 }
46149 
46150 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)46151   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
46152     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
46153     __Pyx_BufFmt_StackElem stack[1];
46154     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
46155     int retcode;
46156     if (obj == Py_None) {
46157         result.memview = (struct __pyx_memoryview_obj *) Py_None;
46158         return result;
46159     }
46160     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
46161                                                  PyBUF_RECORDS_RO | writable_flag, 1,
46162                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
46163                                                  &result, obj);
46164     if (unlikely(retcode == -1))
46165         goto __pyx_fail;
46166     return result;
46167 __pyx_fail:
46168     result.memview = NULL;
46169     result.data = NULL;
46170     return result;
46171 }
46172 
46173 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject * obj,int writable_flag)46174   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
46175     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
46176     __Pyx_BufFmt_StackElem stack[1];
46177     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
46178     int retcode;
46179     if (obj == Py_None) {
46180         result.memview = (struct __pyx_memoryview_obj *) Py_None;
46181         return result;
46182     }
46183     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
46184                                                  PyBUF_RECORDS_RO | writable_flag, 1,
46185                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
46186                                                  &result, obj);
46187     if (unlikely(retcode == -1))
46188         goto __pyx_fail;
46189     return result;
46190 __pyx_fail:
46191     result.memview = NULL;
46192     result.data = NULL;
46193     return result;
46194 }
46195 
46196 /* CIntToPy */
__Pyx_PyInt_From_npy_int32(npy_int32 value)46197   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
46198     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
46199     const int is_unsigned = neg_one > const_zero;
46200     if (is_unsigned) {
46201         if (sizeof(npy_int32) < sizeof(long)) {
46202             return PyInt_FromLong((long) value);
46203         } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
46204             return PyLong_FromUnsignedLong((unsigned long) value);
46205 #ifdef HAVE_LONG_LONG
46206         } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
46207             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46208 #endif
46209         }
46210     } else {
46211         if (sizeof(npy_int32) <= sizeof(long)) {
46212             return PyInt_FromLong((long) value);
46213 #ifdef HAVE_LONG_LONG
46214         } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
46215             return PyLong_FromLongLong((PY_LONG_LONG) value);
46216 #endif
46217         }
46218     }
46219     {
46220         int one = 1; int little = (int)*(unsigned char *)&one;
46221         unsigned char *bytes = (unsigned char *)&value;
46222         return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
46223                                      little, !is_unsigned);
46224     }
46225 }
46226 
46227 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)46228   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
46229     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
46230     const int is_unsigned = neg_one > const_zero;
46231     if (is_unsigned) {
46232         if (sizeof(npy_int64) < sizeof(long)) {
46233             return PyInt_FromLong((long) value);
46234         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
46235             return PyLong_FromUnsignedLong((unsigned long) value);
46236 #ifdef HAVE_LONG_LONG
46237         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
46238             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46239 #endif
46240         }
46241     } else {
46242         if (sizeof(npy_int64) <= sizeof(long)) {
46243             return PyInt_FromLong((long) value);
46244 #ifdef HAVE_LONG_LONG
46245         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
46246             return PyLong_FromLongLong((PY_LONG_LONG) value);
46247 #endif
46248         }
46249     }
46250     {
46251         int one = 1; int little = (int)*(unsigned char *)&one;
46252         unsigned char *bytes = (unsigned char *)&value;
46253         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
46254                                      little, !is_unsigned);
46255     }
46256 }
46257 
46258 /* CIntToPy */
__Pyx_PyInt_From_npy_uint8(npy_uint8 value)46259   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) {
46260     const npy_uint8 neg_one = (npy_uint8) ((npy_uint8) 0 - (npy_uint8) 1), const_zero = (npy_uint8) 0;
46261     const int is_unsigned = neg_one > const_zero;
46262     if (is_unsigned) {
46263         if (sizeof(npy_uint8) < sizeof(long)) {
46264             return PyInt_FromLong((long) value);
46265         } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
46266             return PyLong_FromUnsignedLong((unsigned long) value);
46267 #ifdef HAVE_LONG_LONG
46268         } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
46269             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46270 #endif
46271         }
46272     } else {
46273         if (sizeof(npy_uint8) <= sizeof(long)) {
46274             return PyInt_FromLong((long) value);
46275 #ifdef HAVE_LONG_LONG
46276         } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
46277             return PyLong_FromLongLong((PY_LONG_LONG) value);
46278 #endif
46279         }
46280     }
46281     {
46282         int one = 1; int little = (int)*(unsigned char *)&one;
46283         unsigned char *bytes = (unsigned char *)&value;
46284         return _PyLong_FromByteArray(bytes, sizeof(npy_uint8),
46285                                      little, !is_unsigned);
46286     }
46287 }
46288 
46289 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char * itemp)46290   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) {
46291     return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp);
46292 }
__pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char * itemp,PyObject * obj)46293 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) {
46294     __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj);
46295     if ((value == ((npy_float64)-1)) && PyErr_Occurred())
46296         return 0;
46297     *(__pyx_t_5numpy_float64_t *) itemp = value;
46298     return 1;
46299 }
46300 
46301 /* CIntToPy */
__Pyx_PyInt_From_long(long value)46302   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
46303     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
46304     const int is_unsigned = neg_one > const_zero;
46305     if (is_unsigned) {
46306         if (sizeof(long) < sizeof(long)) {
46307             return PyInt_FromLong((long) value);
46308         } else if (sizeof(long) <= sizeof(unsigned long)) {
46309             return PyLong_FromUnsignedLong((unsigned long) value);
46310 #ifdef HAVE_LONG_LONG
46311         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
46312             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46313 #endif
46314         }
46315     } else {
46316         if (sizeof(long) <= sizeof(long)) {
46317             return PyInt_FromLong((long) value);
46318 #ifdef HAVE_LONG_LONG
46319         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
46320             return PyLong_FromLongLong((PY_LONG_LONG) value);
46321 #endif
46322         }
46323     }
46324     {
46325         int one = 1; int little = (int)*(unsigned char *)&one;
46326         unsigned char *bytes = (unsigned char *)&value;
46327         return _PyLong_FromByteArray(bytes, sizeof(long),
46328                                      little, !is_unsigned);
46329     }
46330 }
46331 
46332 /* CIntToPy */
__Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value)46333   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
46334     const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
46335     const int is_unsigned = neg_one > const_zero;
46336     if (is_unsigned) {
46337         if (sizeof(Py_intptr_t) < sizeof(long)) {
46338             return PyInt_FromLong((long) value);
46339         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
46340             return PyLong_FromUnsignedLong((unsigned long) value);
46341 #ifdef HAVE_LONG_LONG
46342         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
46343             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46344 #endif
46345         }
46346     } else {
46347         if (sizeof(Py_intptr_t) <= sizeof(long)) {
46348             return PyInt_FromLong((long) value);
46349 #ifdef HAVE_LONG_LONG
46350         } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
46351             return PyLong_FromLongLong((PY_LONG_LONG) value);
46352 #endif
46353         }
46354     }
46355     {
46356         int one = 1; int little = (int)*(unsigned char *)&one;
46357         unsigned char *bytes = (unsigned char *)&value;
46358         return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
46359                                      little, !is_unsigned);
46360     }
46361 }
46362 
46363 /* Print */
46364   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_GetStdout(void)46365 static PyObject *__Pyx_GetStdout(void) {
46366     PyObject *f = PySys_GetObject((char *)"stdout");
46367     if (!f) {
46368         PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
46369     }
46370     return f;
46371 }
__Pyx_Print(PyObject * f,PyObject * arg_tuple,int newline)46372 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
46373     int i;
46374     if (!f) {
46375         if (!(f = __Pyx_GetStdout()))
46376             return -1;
46377     }
46378     Py_INCREF(f);
46379     for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
46380         PyObject* v;
46381         if (PyFile_SoftSpace(f, 1)) {
46382             if (PyFile_WriteString(" ", f) < 0)
46383                 goto error;
46384         }
46385         v = PyTuple_GET_ITEM(arg_tuple, i);
46386         if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
46387             goto error;
46388         if (PyString_Check(v)) {
46389             char *s = PyString_AsString(v);
46390             Py_ssize_t len = PyString_Size(v);
46391             if (len > 0) {
46392                 switch (s[len-1]) {
46393                     case ' ': break;
46394                     case '\f': case '\r': case '\n': case '\t': case '\v':
46395                         PyFile_SoftSpace(f, 0);
46396                         break;
46397                     default:  break;
46398                 }
46399             }
46400         }
46401     }
46402     if (newline) {
46403         if (PyFile_WriteString("\n", f) < 0)
46404             goto error;
46405         PyFile_SoftSpace(f, 0);
46406     }
46407     Py_DECREF(f);
46408     return 0;
46409 error:
46410     Py_DECREF(f);
46411     return -1;
46412 }
46413 #else
__Pyx_Print(PyObject * stream,PyObject * arg_tuple,int newline)46414 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
46415     PyObject* kwargs = 0;
46416     PyObject* result = 0;
46417     PyObject* end_string;
46418     if (unlikely(!__pyx_print)) {
46419         __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
46420         if (!__pyx_print)
46421             return -1;
46422     }
46423     if (stream) {
46424         kwargs = PyDict_New();
46425         if (unlikely(!kwargs))
46426             return -1;
46427         if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
46428             goto bad;
46429         if (!newline) {
46430             end_string = PyUnicode_FromStringAndSize(" ", 1);
46431             if (unlikely(!end_string))
46432                 goto bad;
46433             if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
46434                 Py_DECREF(end_string);
46435                 goto bad;
46436             }
46437             Py_DECREF(end_string);
46438         }
46439     } else if (!newline) {
46440         if (unlikely(!__pyx_print_kwargs)) {
46441             __pyx_print_kwargs = PyDict_New();
46442             if (unlikely(!__pyx_print_kwargs))
46443                 return -1;
46444             end_string = PyUnicode_FromStringAndSize(" ", 1);
46445             if (unlikely(!end_string))
46446                 return -1;
46447             if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
46448                 Py_DECREF(end_string);
46449                 return -1;
46450             }
46451             Py_DECREF(end_string);
46452         }
46453         kwargs = __pyx_print_kwargs;
46454     }
46455     result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
46456     if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
46457         Py_DECREF(kwargs);
46458     if (!result)
46459         return -1;
46460     Py_DECREF(result);
46461     return 0;
46462 bad:
46463     if (kwargs != __pyx_print_kwargs)
46464         Py_XDECREF(kwargs);
46465     return -1;
46466 }
46467 #endif
46468 
46469 /* CIntToPy */
__Pyx_PyInt_From_npy_uint64(npy_uint64 value)46470   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
46471     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
46472     const int is_unsigned = neg_one > const_zero;
46473     if (is_unsigned) {
46474         if (sizeof(npy_uint64) < sizeof(long)) {
46475             return PyInt_FromLong((long) value);
46476         } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
46477             return PyLong_FromUnsignedLong((unsigned long) value);
46478 #ifdef HAVE_LONG_LONG
46479         } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
46480             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46481 #endif
46482         }
46483     } else {
46484         if (sizeof(npy_uint64) <= sizeof(long)) {
46485             return PyInt_FromLong((long) value);
46486 #ifdef HAVE_LONG_LONG
46487         } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
46488             return PyLong_FromLongLong((PY_LONG_LONG) value);
46489 #endif
46490         }
46491     }
46492     {
46493         int one = 1; int little = (int)*(unsigned char *)&one;
46494         unsigned char *bytes = (unsigned char *)&value;
46495         return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
46496                                      little, !is_unsigned);
46497     }
46498 }
46499 
46500 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char * itemp)46501   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) {
46502     return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp);
46503 }
__pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char * itemp,PyObject * obj)46504 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) {
46505     __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj);
46506     if ((value == ((npy_uint8)-1)) && PyErr_Occurred())
46507         return 0;
46508     *(__pyx_t_5numpy_uint8_t *) itemp = value;
46509     return 1;
46510 }
46511 
46512 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char * itemp)46513   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint64_t(const char *itemp) {
46514     return (PyObject *) __Pyx_PyInt_From_npy_uint64(*(__pyx_t_5numpy_uint64_t *) itemp);
46515 }
__pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char * itemp,PyObject * obj)46516 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint64_t(const char *itemp, PyObject *obj) {
46517     __pyx_t_5numpy_uint64_t value = __Pyx_PyInt_As_npy_uint64(obj);
46518     if ((value == ((npy_uint64)-1)) && PyErr_Occurred())
46519         return 0;
46520     *(__pyx_t_5numpy_uint64_t *) itemp = value;
46521     return 1;
46522 }
46523 
46524 /* MemviewDtypeToObject */
__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char * itemp)46525   static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_int64_t(const char *itemp) {
46526     return (PyObject *) __Pyx_PyInt_From_npy_int64(*(__pyx_t_5numpy_int64_t *) itemp);
46527 }
__pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char * itemp,PyObject * obj)46528 static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_int64_t(const char *itemp, PyObject *obj) {
46529     __pyx_t_5numpy_int64_t value = __Pyx_PyInt_As_npy_int64(obj);
46530     if ((value == ((npy_int64)-1)) && PyErr_Occurred())
46531         return 0;
46532     *(__pyx_t_5numpy_int64_t *) itemp = value;
46533     return 1;
46534 }
46535 
__pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s)46536 static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded s) {
46537     PyObject* res;
46538     PyObject* member;
46539     res = __Pyx_PyDict_NewPresized(4); if (unlikely(!res)) return NULL;
46540     member = __Pyx_PyInt_From_npy_int64(s.file_ind); if (unlikely(!member)) goto bad;
46541     if (unlikely(PyDict_SetItem(res, __pyx_n_s_file_ind, member) < 0)) goto bad;
46542     Py_DECREF(member);
46543     member = __Pyx_PyInt_From_npy_int64(s.domain_ind); if (unlikely(!member)) goto bad;
46544     if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain_ind, member) < 0)) goto bad;
46545     Py_DECREF(member);
46546     member = __Pyx_PyInt_From_npy_int64(s.domain); if (unlikely(!member)) goto bad;
46547     if (unlikely(PyDict_SetItem(res, __pyx_n_s_domain, member) < 0)) goto bad;
46548     Py_DECREF(member);
46549     member = __Pyx_PyInt_From_npy_int64(s.padding); if (unlikely(!member)) goto bad;
46550     if (unlikely(PyDict_SetItem(res, __pyx_n_s_padding, member) < 0)) goto bad;
46551     Py_DECREF(member);
46552     return res;
46553     bad:
46554     Py_XDECREF(member);
46555     Py_DECREF(res);
46556     return NULL;
46557   }
46558   /* MemviewDtypeToObject */
__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char * itemp)46559   static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp) {
46560     return (PyObject *) __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(*(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp);
46561 }
__pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char * itemp,PyObject * obj)46562 static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(const char *itemp, PyObject *obj) {
46563     struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded value = __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(obj);
46564     if (PyErr_Occurred())
46565         return 0;
46566     *(struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded *) itemp = value;
46567     return 1;
46568 }
46569 
46570 /* Declarations */
46571   #if CYTHON_CCOMPLEX
46572   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)46573     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
46574       return ::std::complex< float >(x, y);
46575     }
46576   #else
__pyx_t_float_complex_from_parts(float x,float y)46577     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
46578       return x + y*(__pyx_t_float_complex)_Complex_I;
46579     }
46580   #endif
46581 #else
__pyx_t_float_complex_from_parts(float x,float y)46582     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
46583       __pyx_t_float_complex z;
46584       z.real = x;
46585       z.imag = y;
46586       return z;
46587     }
46588 #endif
46589 
46590 /* Arithmetic */
46591   #if CYTHON_CCOMPLEX
46592 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46593     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46594        return (a.real == b.real) && (a.imag == b.imag);
46595     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46596     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46597         __pyx_t_float_complex z;
46598         z.real = a.real + b.real;
46599         z.imag = a.imag + b.imag;
46600         return z;
46601     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46602     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46603         __pyx_t_float_complex z;
46604         z.real = a.real - b.real;
46605         z.imag = a.imag - b.imag;
46606         return z;
46607     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46608     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46609         __pyx_t_float_complex z;
46610         z.real = a.real * b.real - a.imag * b.imag;
46611         z.imag = a.real * b.imag + a.imag * b.real;
46612         return z;
46613     }
46614     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46615     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46616         if (b.imag == 0) {
46617             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
46618         } else if (fabsf(b.real) >= fabsf(b.imag)) {
46619             if (b.real == 0 && b.imag == 0) {
46620                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
46621             } else {
46622                 float r = b.imag / b.real;
46623                 float s = (float)(1.0) / (b.real + b.imag * r);
46624                 return __pyx_t_float_complex_from_parts(
46625                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
46626             }
46627         } else {
46628             float r = b.real / b.imag;
46629             float s = (float)(1.0) / (b.imag + b.real * r);
46630             return __pyx_t_float_complex_from_parts(
46631                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
46632         }
46633     }
46634     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46635     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46636         if (b.imag == 0) {
46637             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
46638         } else {
46639             float denom = b.real * b.real + b.imag * b.imag;
46640             return __pyx_t_float_complex_from_parts(
46641                 (a.real * b.real + a.imag * b.imag) / denom,
46642                 (a.imag * b.real - a.real * b.imag) / denom);
46643         }
46644     }
46645     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)46646     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
46647         __pyx_t_float_complex z;
46648         z.real = -a.real;
46649         z.imag = -a.imag;
46650         return z;
46651     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)46652     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
46653        return (a.real == 0) && (a.imag == 0);
46654     }
__Pyx_c_conj_float(__pyx_t_float_complex a)46655     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
46656         __pyx_t_float_complex z;
46657         z.real =  a.real;
46658         z.imag = -a.imag;
46659         return z;
46660     }
46661     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)46662         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
46663           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
46664             return sqrtf(z.real*z.real + z.imag*z.imag);
46665           #else
46666             return hypotf(z.real, z.imag);
46667           #endif
46668         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)46669         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
46670             __pyx_t_float_complex z;
46671             float r, lnr, theta, z_r, z_theta;
46672             if (b.imag == 0 && b.real == (int)b.real) {
46673                 if (b.real < 0) {
46674                     float denom = a.real * a.real + a.imag * a.imag;
46675                     a.real = a.real / denom;
46676                     a.imag = -a.imag / denom;
46677                     b.real = -b.real;
46678                 }
46679                 switch ((int)b.real) {
46680                     case 0:
46681                         z.real = 1;
46682                         z.imag = 0;
46683                         return z;
46684                     case 1:
46685                         return a;
46686                     case 2:
46687                         z = __Pyx_c_prod_float(a, a);
46688                         return __Pyx_c_prod_float(a, a);
46689                     case 3:
46690                         z = __Pyx_c_prod_float(a, a);
46691                         return __Pyx_c_prod_float(z, a);
46692                     case 4:
46693                         z = __Pyx_c_prod_float(a, a);
46694                         return __Pyx_c_prod_float(z, z);
46695                 }
46696             }
46697             if (a.imag == 0) {
46698                 if (a.real == 0) {
46699                     return a;
46700                 } else if (b.imag == 0) {
46701                     z.real = powf(a.real, b.real);
46702                     z.imag = 0;
46703                     return z;
46704                 } else if (a.real > 0) {
46705                     r = a.real;
46706                     theta = 0;
46707                 } else {
46708                     r = -a.real;
46709                     theta = atan2f(0.0, -1.0);
46710                 }
46711             } else {
46712                 r = __Pyx_c_abs_float(a);
46713                 theta = atan2f(a.imag, a.real);
46714             }
46715             lnr = logf(r);
46716             z_r = expf(lnr * b.real - theta * b.imag);
46717             z_theta = theta * b.real + lnr * b.imag;
46718             z.real = z_r * cosf(z_theta);
46719             z.imag = z_r * sinf(z_theta);
46720             return z;
46721         }
46722     #endif
46723 #endif
46724 
46725 /* Declarations */
46726   #if CYTHON_CCOMPLEX
46727   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)46728     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
46729       return ::std::complex< double >(x, y);
46730     }
46731   #else
__pyx_t_double_complex_from_parts(double x,double y)46732     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
46733       return x + y*(__pyx_t_double_complex)_Complex_I;
46734     }
46735   #endif
46736 #else
__pyx_t_double_complex_from_parts(double x,double y)46737     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
46738       __pyx_t_double_complex z;
46739       z.real = x;
46740       z.imag = y;
46741       return z;
46742     }
46743 #endif
46744 
46745 /* Arithmetic */
46746   #if CYTHON_CCOMPLEX
46747 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46748     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46749        return (a.real == b.real) && (a.imag == b.imag);
46750     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46751     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46752         __pyx_t_double_complex z;
46753         z.real = a.real + b.real;
46754         z.imag = a.imag + b.imag;
46755         return z;
46756     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46757     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46758         __pyx_t_double_complex z;
46759         z.real = a.real - b.real;
46760         z.imag = a.imag - b.imag;
46761         return z;
46762     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46763     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46764         __pyx_t_double_complex z;
46765         z.real = a.real * b.real - a.imag * b.imag;
46766         z.imag = a.real * b.imag + a.imag * b.real;
46767         return z;
46768     }
46769     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46770     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46771         if (b.imag == 0) {
46772             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
46773         } else if (fabs(b.real) >= fabs(b.imag)) {
46774             if (b.real == 0 && b.imag == 0) {
46775                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
46776             } else {
46777                 double r = b.imag / b.real;
46778                 double s = (double)(1.0) / (b.real + b.imag * r);
46779                 return __pyx_t_double_complex_from_parts(
46780                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
46781             }
46782         } else {
46783             double r = b.real / b.imag;
46784             double s = (double)(1.0) / (b.imag + b.real * r);
46785             return __pyx_t_double_complex_from_parts(
46786                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
46787         }
46788     }
46789     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46790     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46791         if (b.imag == 0) {
46792             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
46793         } else {
46794             double denom = b.real * b.real + b.imag * b.imag;
46795             return __pyx_t_double_complex_from_parts(
46796                 (a.real * b.real + a.imag * b.imag) / denom,
46797                 (a.imag * b.real - a.real * b.imag) / denom);
46798         }
46799     }
46800     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)46801     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
46802         __pyx_t_double_complex z;
46803         z.real = -a.real;
46804         z.imag = -a.imag;
46805         return z;
46806     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)46807     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
46808        return (a.real == 0) && (a.imag == 0);
46809     }
__Pyx_c_conj_double(__pyx_t_double_complex a)46810     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
46811         __pyx_t_double_complex z;
46812         z.real =  a.real;
46813         z.imag = -a.imag;
46814         return z;
46815     }
46816     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)46817         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
46818           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
46819             return sqrt(z.real*z.real + z.imag*z.imag);
46820           #else
46821             return hypot(z.real, z.imag);
46822           #endif
46823         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)46824         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
46825             __pyx_t_double_complex z;
46826             double r, lnr, theta, z_r, z_theta;
46827             if (b.imag == 0 && b.real == (int)b.real) {
46828                 if (b.real < 0) {
46829                     double denom = a.real * a.real + a.imag * a.imag;
46830                     a.real = a.real / denom;
46831                     a.imag = -a.imag / denom;
46832                     b.real = -b.real;
46833                 }
46834                 switch ((int)b.real) {
46835                     case 0:
46836                         z.real = 1;
46837                         z.imag = 0;
46838                         return z;
46839                     case 1:
46840                         return a;
46841                     case 2:
46842                         z = __Pyx_c_prod_double(a, a);
46843                         return __Pyx_c_prod_double(a, a);
46844                     case 3:
46845                         z = __Pyx_c_prod_double(a, a);
46846                         return __Pyx_c_prod_double(z, a);
46847                     case 4:
46848                         z = __Pyx_c_prod_double(a, a);
46849                         return __Pyx_c_prod_double(z, z);
46850                 }
46851             }
46852             if (a.imag == 0) {
46853                 if (a.real == 0) {
46854                     return a;
46855                 } else if (b.imag == 0) {
46856                     z.real = pow(a.real, b.real);
46857                     z.imag = 0;
46858                     return z;
46859                 } else if (a.real > 0) {
46860                     r = a.real;
46861                     theta = 0;
46862                 } else {
46863                     r = -a.real;
46864                     theta = atan2(0.0, -1.0);
46865                 }
46866             } else {
46867                 r = __Pyx_c_abs_double(a);
46868                 theta = atan2(a.imag, a.real);
46869             }
46870             lnr = log(r);
46871             z_r = exp(lnr * b.real - theta * b.imag);
46872             z_theta = theta * b.real + lnr * b.imag;
46873             z.real = z_r * cos(z_theta);
46874             z.imag = z_r * sin(z_theta);
46875             return z;
46876         }
46877     #endif
46878 #endif
46879 
46880 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)46881   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
46882     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
46883     const int is_unsigned = neg_one > const_zero;
46884     if (is_unsigned) {
46885         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
46886             return PyInt_FromLong((long) value);
46887         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
46888             return PyLong_FromUnsignedLong((unsigned long) value);
46889 #ifdef HAVE_LONG_LONG
46890         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
46891             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
46892 #endif
46893         }
46894     } else {
46895         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
46896             return PyInt_FromLong((long) value);
46897 #ifdef HAVE_LONG_LONG
46898         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
46899             return PyLong_FromLongLong((PY_LONG_LONG) value);
46900 #endif
46901         }
46902     }
46903     {
46904         int one = 1; int little = (int)*(unsigned char *)&one;
46905         unsigned char *bytes = (unsigned char *)&value;
46906         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
46907                                      little, !is_unsigned);
46908     }
46909 }
46910 
46911 /* MemviewSliceCopyTemplate */
46912   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)46913 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
46914                                  const char *mode, int ndim,
46915                                  size_t sizeof_dtype, int contig_flag,
46916                                  int dtype_is_object)
46917 {
46918     __Pyx_RefNannyDeclarations
46919     int i;
46920     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
46921     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
46922     Py_buffer *buf = &from_memview->view;
46923     PyObject *shape_tuple = NULL;
46924     PyObject *temp_int = NULL;
46925     struct __pyx_array_obj *array_obj = NULL;
46926     struct __pyx_memoryview_obj *memview_obj = NULL;
46927     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
46928     for (i = 0; i < ndim; i++) {
46929         if (from_mvs->suboffsets[i] >= 0) {
46930             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
46931                                            "indirect dimensions (axis %d)", i);
46932             goto fail;
46933         }
46934     }
46935     shape_tuple = PyTuple_New(ndim);
46936     if (unlikely(!shape_tuple)) {
46937         goto fail;
46938     }
46939     __Pyx_GOTREF(shape_tuple);
46940     for(i = 0; i < ndim; i++) {
46941         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
46942         if(unlikely(!temp_int)) {
46943             goto fail;
46944         } else {
46945             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
46946             temp_int = NULL;
46947         }
46948     }
46949     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
46950     if (unlikely(!array_obj)) {
46951         goto fail;
46952     }
46953     __Pyx_GOTREF(array_obj);
46954     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
46955                                     (PyObject *) array_obj, contig_flag,
46956                                     dtype_is_object,
46957                                     from_mvs->memview->typeinfo);
46958     if (unlikely(!memview_obj))
46959         goto fail;
46960     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
46961         goto fail;
46962     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
46963                                                 dtype_is_object) < 0))
46964         goto fail;
46965     goto no_fail;
46966 fail:
46967     __Pyx_XDECREF(new_mvs.memview);
46968     new_mvs.memview = NULL;
46969     new_mvs.data = NULL;
46970 no_fail:
46971     __Pyx_XDECREF(shape_tuple);
46972     __Pyx_XDECREF(temp_int);
46973     __Pyx_XDECREF(array_obj);
46974     __Pyx_RefNannyFinishContext();
46975     return new_mvs;
46976 }
46977 
46978 /* CIntFromPy */
__Pyx_PyInt_As_npy_int64(PyObject * x)46979   static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
46980     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
46981     const int is_unsigned = neg_one > const_zero;
46982 #if PY_MAJOR_VERSION < 3
46983     if (likely(PyInt_Check(x))) {
46984         if (sizeof(npy_int64) < sizeof(long)) {
46985             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
46986         } else {
46987             long val = PyInt_AS_LONG(x);
46988             if (is_unsigned && unlikely(val < 0)) {
46989                 goto raise_neg_overflow;
46990             }
46991             return (npy_int64) val;
46992         }
46993     } else
46994 #endif
46995     if (likely(PyLong_Check(x))) {
46996         if (is_unsigned) {
46997 #if CYTHON_USE_PYLONG_INTERNALS
46998             const digit* digits = ((PyLongObject*)x)->ob_digit;
46999             switch (Py_SIZE(x)) {
47000                 case  0: return (npy_int64) 0;
47001                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
47002                 case 2:
47003                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
47004                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47005                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47006                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
47007                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
47008                         }
47009                     }
47010                     break;
47011                 case 3:
47012                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
47013                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47014                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47015                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
47016                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
47017                         }
47018                     }
47019                     break;
47020                 case 4:
47021                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
47022                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47023                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47024                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
47025                             return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
47026                         }
47027                     }
47028                     break;
47029             }
47030 #endif
47031 #if CYTHON_COMPILING_IN_CPYTHON
47032             if (unlikely(Py_SIZE(x) < 0)) {
47033                 goto raise_neg_overflow;
47034             }
47035 #else
47036             {
47037                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
47038                 if (unlikely(result < 0))
47039                     return (npy_int64) -1;
47040                 if (unlikely(result == 1))
47041                     goto raise_neg_overflow;
47042             }
47043 #endif
47044             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
47045                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
47046 #ifdef HAVE_LONG_LONG
47047             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
47048                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
47049 #endif
47050             }
47051         } else {
47052 #if CYTHON_USE_PYLONG_INTERNALS
47053             const digit* digits = ((PyLongObject*)x)->ob_digit;
47054             switch (Py_SIZE(x)) {
47055                 case  0: return (npy_int64) 0;
47056                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
47057                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
47058                 case -2:
47059                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
47060                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47061                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47062                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
47063                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47064                         }
47065                     }
47066                     break;
47067                 case 2:
47068                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
47069                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47070                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47071                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
47072                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47073                         }
47074                     }
47075                     break;
47076                 case -3:
47077                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
47078                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47079                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47080                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
47081                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47082                         }
47083                     }
47084                     break;
47085                 case 3:
47086                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
47087                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47088                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47089                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
47090                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47091                         }
47092                     }
47093                     break;
47094                 case -4:
47095                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
47096                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47097                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47098                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
47099                             return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47100                         }
47101                     }
47102                     break;
47103                 case 4:
47104                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
47105                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47106                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47107                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
47108                             return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
47109                         }
47110                     }
47111                     break;
47112             }
47113 #endif
47114             if (sizeof(npy_int64) <= sizeof(long)) {
47115                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
47116 #ifdef HAVE_LONG_LONG
47117             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
47118                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
47119 #endif
47120             }
47121         }
47122         {
47123 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
47124             PyErr_SetString(PyExc_RuntimeError,
47125                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
47126 #else
47127             npy_int64 val;
47128             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
47129  #if PY_MAJOR_VERSION < 3
47130             if (likely(v) && !PyLong_Check(v)) {
47131                 PyObject *tmp = v;
47132                 v = PyNumber_Long(tmp);
47133                 Py_DECREF(tmp);
47134             }
47135  #endif
47136             if (likely(v)) {
47137                 int one = 1; int is_little = (int)*(unsigned char *)&one;
47138                 unsigned char *bytes = (unsigned char *)&val;
47139                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
47140                                               bytes, sizeof(val),
47141                                               is_little, !is_unsigned);
47142                 Py_DECREF(v);
47143                 if (likely(!ret))
47144                     return val;
47145             }
47146 #endif
47147             return (npy_int64) -1;
47148         }
47149     } else {
47150         npy_int64 val;
47151         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
47152         if (!tmp) return (npy_int64) -1;
47153         val = __Pyx_PyInt_As_npy_int64(tmp);
47154         Py_DECREF(tmp);
47155         return val;
47156     }
47157 raise_overflow:
47158     PyErr_SetString(PyExc_OverflowError,
47159         "value too large to convert to npy_int64");
47160     return (npy_int64) -1;
47161 raise_neg_overflow:
47162     PyErr_SetString(PyExc_OverflowError,
47163         "can't convert negative value to npy_int64");
47164     return (npy_int64) -1;
47165 }
47166 
47167 /* TypeInfoToFormat */
__Pyx_TypeInfoToFormat(__Pyx_TypeInfo * type)47168   static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
47169     struct __pyx_typeinfo_string result = { {0} };
47170     char *buf = (char *) result.string;
47171     size_t size = type->size;
47172     switch (type->typegroup) {
47173         case 'H':
47174             *buf = 'c';
47175             break;
47176         case 'I':
47177         case 'U':
47178             if (size == 1)
47179                 *buf = (type->is_unsigned) ? 'B' : 'b';
47180             else if (size == 2)
47181                 *buf = (type->is_unsigned) ? 'H' : 'h';
47182             else if (size == 4)
47183                 *buf = (type->is_unsigned) ? 'I' : 'i';
47184             else if (size == 8)
47185                 *buf = (type->is_unsigned) ? 'Q' : 'q';
47186             break;
47187         case 'P':
47188             *buf = 'P';
47189             break;
47190         case 'C':
47191          {
47192             __Pyx_TypeInfo complex_type = *type;
47193             complex_type.typegroup = 'R';
47194             complex_type.size /= 2;
47195             *buf++ = 'Z';
47196             *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
47197             break;
47198          }
47199         case 'R':
47200             if (size == 4)
47201                 *buf = 'f';
47202             else if (size == 8)
47203                 *buf = 'd';
47204             else
47205                 *buf = 'g';
47206             break;
47207     }
47208     return result;
47209 }
47210 
47211 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)47212   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
47213     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
47214     const int is_unsigned = neg_one > const_zero;
47215 #if PY_MAJOR_VERSION < 3
47216     if (likely(PyInt_Check(x))) {
47217         if (sizeof(int) < sizeof(long)) {
47218             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
47219         } else {
47220             long val = PyInt_AS_LONG(x);
47221             if (is_unsigned && unlikely(val < 0)) {
47222                 goto raise_neg_overflow;
47223             }
47224             return (int) val;
47225         }
47226     } else
47227 #endif
47228     if (likely(PyLong_Check(x))) {
47229         if (is_unsigned) {
47230 #if CYTHON_USE_PYLONG_INTERNALS
47231             const digit* digits = ((PyLongObject*)x)->ob_digit;
47232             switch (Py_SIZE(x)) {
47233                 case  0: return (int) 0;
47234                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
47235                 case 2:
47236                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
47237                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47238                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47239                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
47240                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
47241                         }
47242                     }
47243                     break;
47244                 case 3:
47245                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
47246                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47247                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47248                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
47249                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
47250                         }
47251                     }
47252                     break;
47253                 case 4:
47254                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
47255                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47256                             __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])))
47257                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
47258                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
47259                         }
47260                     }
47261                     break;
47262             }
47263 #endif
47264 #if CYTHON_COMPILING_IN_CPYTHON
47265             if (unlikely(Py_SIZE(x) < 0)) {
47266                 goto raise_neg_overflow;
47267             }
47268 #else
47269             {
47270                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
47271                 if (unlikely(result < 0))
47272                     return (int) -1;
47273                 if (unlikely(result == 1))
47274                     goto raise_neg_overflow;
47275             }
47276 #endif
47277             if (sizeof(int) <= sizeof(unsigned long)) {
47278                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
47279 #ifdef HAVE_LONG_LONG
47280             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
47281                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
47282 #endif
47283             }
47284         } else {
47285 #if CYTHON_USE_PYLONG_INTERNALS
47286             const digit* digits = ((PyLongObject*)x)->ob_digit;
47287             switch (Py_SIZE(x)) {
47288                 case  0: return (int) 0;
47289                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
47290                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
47291                 case -2:
47292                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
47293                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47294                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47295                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
47296                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47297                         }
47298                     }
47299                     break;
47300                 case 2:
47301                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
47302                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47303                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47304                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
47305                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47306                         }
47307                     }
47308                     break;
47309                 case -3:
47310                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
47311                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47312                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47313                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
47314                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47315                         }
47316                     }
47317                     break;
47318                 case 3:
47319                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
47320                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47321                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47322                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
47323                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47324                         }
47325                     }
47326                     break;
47327                 case -4:
47328                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
47329                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47330                             __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])))
47331                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
47332                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47333                         }
47334                     }
47335                     break;
47336                 case 4:
47337                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
47338                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47339                             __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])))
47340                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
47341                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
47342                         }
47343                     }
47344                     break;
47345             }
47346 #endif
47347             if (sizeof(int) <= sizeof(long)) {
47348                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
47349 #ifdef HAVE_LONG_LONG
47350             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
47351                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
47352 #endif
47353             }
47354         }
47355         {
47356 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
47357             PyErr_SetString(PyExc_RuntimeError,
47358                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
47359 #else
47360             int val;
47361             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
47362  #if PY_MAJOR_VERSION < 3
47363             if (likely(v) && !PyLong_Check(v)) {
47364                 PyObject *tmp = v;
47365                 v = PyNumber_Long(tmp);
47366                 Py_DECREF(tmp);
47367             }
47368  #endif
47369             if (likely(v)) {
47370                 int one = 1; int is_little = (int)*(unsigned char *)&one;
47371                 unsigned char *bytes = (unsigned char *)&val;
47372                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
47373                                               bytes, sizeof(val),
47374                                               is_little, !is_unsigned);
47375                 Py_DECREF(v);
47376                 if (likely(!ret))
47377                     return val;
47378             }
47379 #endif
47380             return (int) -1;
47381         }
47382     } else {
47383         int val;
47384         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
47385         if (!tmp) return (int) -1;
47386         val = __Pyx_PyInt_As_int(tmp);
47387         Py_DECREF(tmp);
47388         return val;
47389     }
47390 raise_overflow:
47391     PyErr_SetString(PyExc_OverflowError,
47392         "value too large to convert to int");
47393     return (int) -1;
47394 raise_neg_overflow:
47395     PyErr_SetString(PyExc_OverflowError,
47396         "can't convert negative value to int");
47397     return (int) -1;
47398 }
47399 
47400 /* CIntFromPy */
__Pyx_PyInt_As_npy_int32(PyObject * x)47401   static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
47402     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
47403     const int is_unsigned = neg_one > const_zero;
47404 #if PY_MAJOR_VERSION < 3
47405     if (likely(PyInt_Check(x))) {
47406         if (sizeof(npy_int32) < sizeof(long)) {
47407             __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
47408         } else {
47409             long val = PyInt_AS_LONG(x);
47410             if (is_unsigned && unlikely(val < 0)) {
47411                 goto raise_neg_overflow;
47412             }
47413             return (npy_int32) val;
47414         }
47415     } else
47416 #endif
47417     if (likely(PyLong_Check(x))) {
47418         if (is_unsigned) {
47419 #if CYTHON_USE_PYLONG_INTERNALS
47420             const digit* digits = ((PyLongObject*)x)->ob_digit;
47421             switch (Py_SIZE(x)) {
47422                 case  0: return (npy_int32) 0;
47423                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
47424                 case 2:
47425                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
47426                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47427                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47428                         } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
47429                             return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
47430                         }
47431                     }
47432                     break;
47433                 case 3:
47434                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
47435                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47436                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47437                         } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
47438                             return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
47439                         }
47440                     }
47441                     break;
47442                 case 4:
47443                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
47444                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47445                             __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])))
47446                         } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
47447                             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]));
47448                         }
47449                     }
47450                     break;
47451             }
47452 #endif
47453 #if CYTHON_COMPILING_IN_CPYTHON
47454             if (unlikely(Py_SIZE(x) < 0)) {
47455                 goto raise_neg_overflow;
47456             }
47457 #else
47458             {
47459                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
47460                 if (unlikely(result < 0))
47461                     return (npy_int32) -1;
47462                 if (unlikely(result == 1))
47463                     goto raise_neg_overflow;
47464             }
47465 #endif
47466             if (sizeof(npy_int32) <= sizeof(unsigned long)) {
47467                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
47468 #ifdef HAVE_LONG_LONG
47469             } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
47470                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
47471 #endif
47472             }
47473         } else {
47474 #if CYTHON_USE_PYLONG_INTERNALS
47475             const digit* digits = ((PyLongObject*)x)->ob_digit;
47476             switch (Py_SIZE(x)) {
47477                 case  0: return (npy_int32) 0;
47478                 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
47479                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +digits[0])
47480                 case -2:
47481                     if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
47482                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47483                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47484                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
47485                             return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
47486                         }
47487                     }
47488                     break;
47489                 case 2:
47490                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
47491                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47492                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47493                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
47494                             return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
47495                         }
47496                     }
47497                     break;
47498                 case -3:
47499                     if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
47500                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47501                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47502                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
47503                             return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
47504                         }
47505                     }
47506                     break;
47507                 case 3:
47508                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
47509                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47510                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47511                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
47512                             return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
47513                         }
47514                     }
47515                     break;
47516                 case -4:
47517                     if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
47518                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47519                             __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])))
47520                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
47521                             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])));
47522                         }
47523                     }
47524                     break;
47525                 case 4:
47526                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
47527                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47528                             __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])))
47529                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
47530                             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])));
47531                         }
47532                     }
47533                     break;
47534             }
47535 #endif
47536             if (sizeof(npy_int32) <= sizeof(long)) {
47537                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
47538 #ifdef HAVE_LONG_LONG
47539             } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
47540                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
47541 #endif
47542             }
47543         }
47544         {
47545 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
47546             PyErr_SetString(PyExc_RuntimeError,
47547                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
47548 #else
47549             npy_int32 val;
47550             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
47551  #if PY_MAJOR_VERSION < 3
47552             if (likely(v) && !PyLong_Check(v)) {
47553                 PyObject *tmp = v;
47554                 v = PyNumber_Long(tmp);
47555                 Py_DECREF(tmp);
47556             }
47557  #endif
47558             if (likely(v)) {
47559                 int one = 1; int is_little = (int)*(unsigned char *)&one;
47560                 unsigned char *bytes = (unsigned char *)&val;
47561                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
47562                                               bytes, sizeof(val),
47563                                               is_little, !is_unsigned);
47564                 Py_DECREF(v);
47565                 if (likely(!ret))
47566                     return val;
47567             }
47568 #endif
47569             return (npy_int32) -1;
47570         }
47571     } else {
47572         npy_int32 val;
47573         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
47574         if (!tmp) return (npy_int32) -1;
47575         val = __Pyx_PyInt_As_npy_int32(tmp);
47576         Py_DECREF(tmp);
47577         return val;
47578     }
47579 raise_overflow:
47580     PyErr_SetString(PyExc_OverflowError,
47581         "value too large to convert to npy_int32");
47582     return (npy_int32) -1;
47583 raise_neg_overflow:
47584     PyErr_SetString(PyExc_OverflowError,
47585         "can't convert negative value to npy_int32");
47586     return (npy_int32) -1;
47587 }
47588 
47589 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint8(PyObject * x)47590   static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
47591     const npy_uint8 neg_one = (npy_uint8) ((npy_uint8) 0 - (npy_uint8) 1), const_zero = (npy_uint8) 0;
47592     const int is_unsigned = neg_one > const_zero;
47593 #if PY_MAJOR_VERSION < 3
47594     if (likely(PyInt_Check(x))) {
47595         if (sizeof(npy_uint8) < sizeof(long)) {
47596             __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
47597         } else {
47598             long val = PyInt_AS_LONG(x);
47599             if (is_unsigned && unlikely(val < 0)) {
47600                 goto raise_neg_overflow;
47601             }
47602             return (npy_uint8) val;
47603         }
47604     } else
47605 #endif
47606     if (likely(PyLong_Check(x))) {
47607         if (is_unsigned) {
47608 #if CYTHON_USE_PYLONG_INTERNALS
47609             const digit* digits = ((PyLongObject*)x)->ob_digit;
47610             switch (Py_SIZE(x)) {
47611                 case  0: return (npy_uint8) 0;
47612                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint8, digit, digits[0])
47613                 case 2:
47614                     if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) {
47615                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47616                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47617                         } else if (8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT) {
47618                             return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
47619                         }
47620                     }
47621                     break;
47622                 case 3:
47623                     if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) {
47624                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47625                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47626                         } else if (8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT) {
47627                             return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
47628                         }
47629                     }
47630                     break;
47631                 case 4:
47632                     if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) {
47633                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47634                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47635                         } else if (8 * sizeof(npy_uint8) >= 4 * PyLong_SHIFT) {
47636                             return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
47637                         }
47638                     }
47639                     break;
47640             }
47641 #endif
47642 #if CYTHON_COMPILING_IN_CPYTHON
47643             if (unlikely(Py_SIZE(x) < 0)) {
47644                 goto raise_neg_overflow;
47645             }
47646 #else
47647             {
47648                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
47649                 if (unlikely(result < 0))
47650                     return (npy_uint8) -1;
47651                 if (unlikely(result == 1))
47652                     goto raise_neg_overflow;
47653             }
47654 #endif
47655             if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
47656                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
47657 #ifdef HAVE_LONG_LONG
47658             } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
47659                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
47660 #endif
47661             }
47662         } else {
47663 #if CYTHON_USE_PYLONG_INTERNALS
47664             const digit* digits = ((PyLongObject*)x)->ob_digit;
47665             switch (Py_SIZE(x)) {
47666                 case  0: return (npy_uint8) 0;
47667                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint8, sdigit, (sdigit) (-(sdigit)digits[0]))
47668                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint8,  digit, +digits[0])
47669                 case -2:
47670                     if (8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT) {
47671                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47672                             __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47673                         } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
47674                             return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47675                         }
47676                     }
47677                     break;
47678                 case 2:
47679                     if (8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT) {
47680                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47681                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47682                         } else if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
47683                             return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47684                         }
47685                     }
47686                     break;
47687                 case -3:
47688                     if (8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT) {
47689                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47690                             __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47691                         } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
47692                             return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47693                         }
47694                     }
47695                     break;
47696                 case 3:
47697                     if (8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT) {
47698                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47699                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47700                         } else if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
47701                             return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47702                         }
47703                     }
47704                     break;
47705                 case -4:
47706                     if (8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT) {
47707                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47708                             __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47709                         } else if (8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT) {
47710                             return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47711                         }
47712                     }
47713                     break;
47714                 case 4:
47715                     if (8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT) {
47716                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47717                             __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47718                         } else if (8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT) {
47719                             return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
47720                         }
47721                     }
47722                     break;
47723             }
47724 #endif
47725             if (sizeof(npy_uint8) <= sizeof(long)) {
47726                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x))
47727 #ifdef HAVE_LONG_LONG
47728             } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
47729                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
47730 #endif
47731             }
47732         }
47733         {
47734 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
47735             PyErr_SetString(PyExc_RuntimeError,
47736                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
47737 #else
47738             npy_uint8 val;
47739             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
47740  #if PY_MAJOR_VERSION < 3
47741             if (likely(v) && !PyLong_Check(v)) {
47742                 PyObject *tmp = v;
47743                 v = PyNumber_Long(tmp);
47744                 Py_DECREF(tmp);
47745             }
47746  #endif
47747             if (likely(v)) {
47748                 int one = 1; int is_little = (int)*(unsigned char *)&one;
47749                 unsigned char *bytes = (unsigned char *)&val;
47750                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
47751                                               bytes, sizeof(val),
47752                                               is_little, !is_unsigned);
47753                 Py_DECREF(v);
47754                 if (likely(!ret))
47755                     return val;
47756             }
47757 #endif
47758             return (npy_uint8) -1;
47759         }
47760     } else {
47761         npy_uint8 val;
47762         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
47763         if (!tmp) return (npy_uint8) -1;
47764         val = __Pyx_PyInt_As_npy_uint8(tmp);
47765         Py_DECREF(tmp);
47766         return val;
47767     }
47768 raise_overflow:
47769     PyErr_SetString(PyExc_OverflowError,
47770         "value too large to convert to npy_uint8");
47771     return (npy_uint8) -1;
47772 raise_neg_overflow:
47773     PyErr_SetString(PyExc_OverflowError,
47774         "can't convert negative value to npy_uint8");
47775     return (npy_uint8) -1;
47776 }
47777 
47778 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)47779   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
47780     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
47781     const int is_unsigned = neg_one > const_zero;
47782 #if PY_MAJOR_VERSION < 3
47783     if (likely(PyInt_Check(x))) {
47784         if (sizeof(long) < sizeof(long)) {
47785             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
47786         } else {
47787             long val = PyInt_AS_LONG(x);
47788             if (is_unsigned && unlikely(val < 0)) {
47789                 goto raise_neg_overflow;
47790             }
47791             return (long) val;
47792         }
47793     } else
47794 #endif
47795     if (likely(PyLong_Check(x))) {
47796         if (is_unsigned) {
47797 #if CYTHON_USE_PYLONG_INTERNALS
47798             const digit* digits = ((PyLongObject*)x)->ob_digit;
47799             switch (Py_SIZE(x)) {
47800                 case  0: return (long) 0;
47801                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
47802                 case 2:
47803                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
47804                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47805                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47806                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
47807                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
47808                         }
47809                     }
47810                     break;
47811                 case 3:
47812                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
47813                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47814                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47815                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
47816                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
47817                         }
47818                     }
47819                     break;
47820                 case 4:
47821                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
47822                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47823                             __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])))
47824                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
47825                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
47826                         }
47827                     }
47828                     break;
47829             }
47830 #endif
47831 #if CYTHON_COMPILING_IN_CPYTHON
47832             if (unlikely(Py_SIZE(x) < 0)) {
47833                 goto raise_neg_overflow;
47834             }
47835 #else
47836             {
47837                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
47838                 if (unlikely(result < 0))
47839                     return (long) -1;
47840                 if (unlikely(result == 1))
47841                     goto raise_neg_overflow;
47842             }
47843 #endif
47844             if (sizeof(long) <= sizeof(unsigned long)) {
47845                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
47846 #ifdef HAVE_LONG_LONG
47847             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
47848                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
47849 #endif
47850             }
47851         } else {
47852 #if CYTHON_USE_PYLONG_INTERNALS
47853             const digit* digits = ((PyLongObject*)x)->ob_digit;
47854             switch (Py_SIZE(x)) {
47855                 case  0: return (long) 0;
47856                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
47857                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
47858                 case -2:
47859                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
47860                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47861                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47862                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
47863                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47864                         }
47865                     }
47866                     break;
47867                 case 2:
47868                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
47869                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47870                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47871                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
47872                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47873                         }
47874                     }
47875                     break;
47876                 case -3:
47877                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
47878                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47879                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47880                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
47881                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47882                         }
47883                     }
47884                     break;
47885                 case 3:
47886                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
47887                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
47888                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47889                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
47890                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47891                         }
47892                     }
47893                     break;
47894                 case -4:
47895                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
47896                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47897                             __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])))
47898                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
47899                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47900                         }
47901                     }
47902                     break;
47903                 case 4:
47904                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
47905                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
47906                             __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])))
47907                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
47908                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
47909                         }
47910                     }
47911                     break;
47912             }
47913 #endif
47914             if (sizeof(long) <= sizeof(long)) {
47915                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
47916 #ifdef HAVE_LONG_LONG
47917             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
47918                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
47919 #endif
47920             }
47921         }
47922         {
47923 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
47924             PyErr_SetString(PyExc_RuntimeError,
47925                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
47926 #else
47927             long val;
47928             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
47929  #if PY_MAJOR_VERSION < 3
47930             if (likely(v) && !PyLong_Check(v)) {
47931                 PyObject *tmp = v;
47932                 v = PyNumber_Long(tmp);
47933                 Py_DECREF(tmp);
47934             }
47935  #endif
47936             if (likely(v)) {
47937                 int one = 1; int is_little = (int)*(unsigned char *)&one;
47938                 unsigned char *bytes = (unsigned char *)&val;
47939                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
47940                                               bytes, sizeof(val),
47941                                               is_little, !is_unsigned);
47942                 Py_DECREF(v);
47943                 if (likely(!ret))
47944                     return val;
47945             }
47946 #endif
47947             return (long) -1;
47948         }
47949     } else {
47950         long val;
47951         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
47952         if (!tmp) return (long) -1;
47953         val = __Pyx_PyInt_As_long(tmp);
47954         Py_DECREF(tmp);
47955         return val;
47956     }
47957 raise_overflow:
47958     PyErr_SetString(PyExc_OverflowError,
47959         "value too large to convert to long");
47960     return (long) -1;
47961 raise_neg_overflow:
47962     PyErr_SetString(PyExc_OverflowError,
47963         "can't convert negative value to long");
47964     return (long) -1;
47965 }
47966 
47967 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint64(PyObject * x)47968   static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) {
47969     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
47970     const int is_unsigned = neg_one > const_zero;
47971 #if PY_MAJOR_VERSION < 3
47972     if (likely(PyInt_Check(x))) {
47973         if (sizeof(npy_uint64) < sizeof(long)) {
47974             __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x))
47975         } else {
47976             long val = PyInt_AS_LONG(x);
47977             if (is_unsigned && unlikely(val < 0)) {
47978                 goto raise_neg_overflow;
47979             }
47980             return (npy_uint64) val;
47981         }
47982     } else
47983 #endif
47984     if (likely(PyLong_Check(x))) {
47985         if (is_unsigned) {
47986 #if CYTHON_USE_PYLONG_INTERNALS
47987             const digit* digits = ((PyLongObject*)x)->ob_digit;
47988             switch (Py_SIZE(x)) {
47989                 case  0: return (npy_uint64) 0;
47990                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0])
47991                 case 2:
47992                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
47993                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
47994                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
47995                         } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) {
47996                             return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
47997                         }
47998                     }
47999                     break;
48000                 case 3:
48001                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
48002                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48003                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48004                         } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) {
48005                             return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
48006                         }
48007                     }
48008                     break;
48009                 case 4:
48010                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
48011                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48012                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48013                         } else if (8 * sizeof(npy_uint64) >= 4 * PyLong_SHIFT) {
48014                             return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
48015                         }
48016                     }
48017                     break;
48018             }
48019 #endif
48020 #if CYTHON_COMPILING_IN_CPYTHON
48021             if (unlikely(Py_SIZE(x) < 0)) {
48022                 goto raise_neg_overflow;
48023             }
48024 #else
48025             {
48026                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
48027                 if (unlikely(result < 0))
48028                     return (npy_uint64) -1;
48029                 if (unlikely(result == 1))
48030                     goto raise_neg_overflow;
48031             }
48032 #endif
48033             if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
48034                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x))
48035 #ifdef HAVE_LONG_LONG
48036             } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
48037                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
48038 #endif
48039             }
48040         } else {
48041 #if CYTHON_USE_PYLONG_INTERNALS
48042             const digit* digits = ((PyLongObject*)x)->ob_digit;
48043             switch (Py_SIZE(x)) {
48044                 case  0: return (npy_uint64) 0;
48045                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0]))
48046                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64,  digit, +digits[0])
48047                 case -2:
48048                     if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) {
48049                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48050                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48051                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
48052                             return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48053                         }
48054                     }
48055                     break;
48056                 case 2:
48057                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
48058                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48059                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48060                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
48061                             return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48062                         }
48063                     }
48064                     break;
48065                 case -3:
48066                     if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
48067                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48068                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48069                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
48070                             return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48071                         }
48072                     }
48073                     break;
48074                 case 3:
48075                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
48076                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48077                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48078                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
48079                             return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48080                         }
48081                     }
48082                     break;
48083                 case -4:
48084                     if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
48085                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48086                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48087                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
48088                             return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48089                         }
48090                     }
48091                     break;
48092                 case 4:
48093                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
48094                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48095                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48096                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
48097                             return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
48098                         }
48099                     }
48100                     break;
48101             }
48102 #endif
48103             if (sizeof(npy_uint64) <= sizeof(long)) {
48104                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x))
48105 #ifdef HAVE_LONG_LONG
48106             } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
48107                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x))
48108 #endif
48109             }
48110         }
48111         {
48112 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
48113             PyErr_SetString(PyExc_RuntimeError,
48114                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
48115 #else
48116             npy_uint64 val;
48117             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
48118  #if PY_MAJOR_VERSION < 3
48119             if (likely(v) && !PyLong_Check(v)) {
48120                 PyObject *tmp = v;
48121                 v = PyNumber_Long(tmp);
48122                 Py_DECREF(tmp);
48123             }
48124  #endif
48125             if (likely(v)) {
48126                 int one = 1; int is_little = (int)*(unsigned char *)&one;
48127                 unsigned char *bytes = (unsigned char *)&val;
48128                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
48129                                               bytes, sizeof(val),
48130                                               is_little, !is_unsigned);
48131                 Py_DECREF(v);
48132                 if (likely(!ret))
48133                     return val;
48134             }
48135 #endif
48136             return (npy_uint64) -1;
48137         }
48138     } else {
48139         npy_uint64 val;
48140         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
48141         if (!tmp) return (npy_uint64) -1;
48142         val = __Pyx_PyInt_As_npy_uint64(tmp);
48143         Py_DECREF(tmp);
48144         return val;
48145     }
48146 raise_overflow:
48147     PyErr_SetString(PyExc_OverflowError,
48148         "value too large to convert to npy_uint64");
48149     return (npy_uint64) -1;
48150 raise_neg_overflow:
48151     PyErr_SetString(PyExc_OverflowError,
48152         "can't convert negative value to npy_uint64");
48153     return (npy_uint64) -1;
48154 }
48155 
48156 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint32(PyObject * x)48157   static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
48158     const npy_uint32 neg_one = (npy_uint32) ((npy_uint32) 0 - (npy_uint32) 1), const_zero = (npy_uint32) 0;
48159     const int is_unsigned = neg_one > const_zero;
48160 #if PY_MAJOR_VERSION < 3
48161     if (likely(PyInt_Check(x))) {
48162         if (sizeof(npy_uint32) < sizeof(long)) {
48163             __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG(x))
48164         } else {
48165             long val = PyInt_AS_LONG(x);
48166             if (is_unsigned && unlikely(val < 0)) {
48167                 goto raise_neg_overflow;
48168             }
48169             return (npy_uint32) val;
48170         }
48171     } else
48172 #endif
48173     if (likely(PyLong_Check(x))) {
48174         if (is_unsigned) {
48175 #if CYTHON_USE_PYLONG_INTERNALS
48176             const digit* digits = ((PyLongObject*)x)->ob_digit;
48177             switch (Py_SIZE(x)) {
48178                 case  0: return (npy_uint32) 0;
48179                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, digits[0])
48180                 case 2:
48181                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
48182                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48183                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48184                         } else if (8 * sizeof(npy_uint32) >= 2 * PyLong_SHIFT) {
48185                             return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
48186                         }
48187                     }
48188                     break;
48189                 case 3:
48190                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
48191                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48192                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48193                         } else if (8 * sizeof(npy_uint32) >= 3 * PyLong_SHIFT) {
48194                             return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
48195                         }
48196                     }
48197                     break;
48198                 case 4:
48199                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
48200                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48201                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48202                         } else if (8 * sizeof(npy_uint32) >= 4 * PyLong_SHIFT) {
48203                             return (npy_uint32) (((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
48204                         }
48205                     }
48206                     break;
48207             }
48208 #endif
48209 #if CYTHON_COMPILING_IN_CPYTHON
48210             if (unlikely(Py_SIZE(x) < 0)) {
48211                 goto raise_neg_overflow;
48212             }
48213 #else
48214             {
48215                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
48216                 if (unlikely(result < 0))
48217                     return (npy_uint32) -1;
48218                 if (unlikely(result == 1))
48219                     goto raise_neg_overflow;
48220             }
48221 #endif
48222             if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
48223                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
48224 #ifdef HAVE_LONG_LONG
48225             } else if (sizeof(npy_uint32) <= sizeof(unsigned PY_LONG_LONG)) {
48226                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
48227 #endif
48228             }
48229         } else {
48230 #if CYTHON_USE_PYLONG_INTERNALS
48231             const digit* digits = ((PyLongObject*)x)->ob_digit;
48232             switch (Py_SIZE(x)) {
48233                 case  0: return (npy_uint32) 0;
48234                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, (sdigit) (-(sdigit)digits[0]))
48235                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32,  digit, +digits[0])
48236                 case -2:
48237                     if (8 * sizeof(npy_uint32) - 1 > 1 * PyLong_SHIFT) {
48238                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48239                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48240                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
48241                             return (npy_uint32) (((npy_uint32)-1)*(((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48242                         }
48243                     }
48244                     break;
48245                 case 2:
48246                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
48247                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48248                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48249                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
48250                             return (npy_uint32) ((((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48251                         }
48252                     }
48253                     break;
48254                 case -3:
48255                     if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
48256                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48257                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48258                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
48259                             return (npy_uint32) (((npy_uint32)-1)*(((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48260                         }
48261                     }
48262                     break;
48263                 case 3:
48264                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
48265                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48266                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48267                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
48268                             return (npy_uint32) ((((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48269                         }
48270                     }
48271                     break;
48272                 case -4:
48273                     if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
48274                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48275                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48276                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
48277                             return (npy_uint32) (((npy_uint32)-1)*(((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48278                         }
48279                     }
48280                     break;
48281                 case 4:
48282                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
48283                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48284                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48285                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
48286                             return (npy_uint32) ((((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
48287                         }
48288                     }
48289                     break;
48290             }
48291 #endif
48292             if (sizeof(npy_uint32) <= sizeof(long)) {
48293                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, long, PyLong_AsLong(x))
48294 #ifdef HAVE_LONG_LONG
48295             } else if (sizeof(npy_uint32) <= sizeof(PY_LONG_LONG)) {
48296                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x))
48297 #endif
48298             }
48299         }
48300         {
48301 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
48302             PyErr_SetString(PyExc_RuntimeError,
48303                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
48304 #else
48305             npy_uint32 val;
48306             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
48307  #if PY_MAJOR_VERSION < 3
48308             if (likely(v) && !PyLong_Check(v)) {
48309                 PyObject *tmp = v;
48310                 v = PyNumber_Long(tmp);
48311                 Py_DECREF(tmp);
48312             }
48313  #endif
48314             if (likely(v)) {
48315                 int one = 1; int is_little = (int)*(unsigned char *)&one;
48316                 unsigned char *bytes = (unsigned char *)&val;
48317                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
48318                                               bytes, sizeof(val),
48319                                               is_little, !is_unsigned);
48320                 Py_DECREF(v);
48321                 if (likely(!ret))
48322                     return val;
48323             }
48324 #endif
48325             return (npy_uint32) -1;
48326         }
48327     } else {
48328         npy_uint32 val;
48329         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
48330         if (!tmp) return (npy_uint32) -1;
48331         val = __Pyx_PyInt_As_npy_uint32(tmp);
48332         Py_DECREF(tmp);
48333         return val;
48334     }
48335 raise_overflow:
48336     PyErr_SetString(PyExc_OverflowError,
48337         "value too large to convert to npy_uint32");
48338     return (npy_uint32) -1;
48339 raise_neg_overflow:
48340     PyErr_SetString(PyExc_OverflowError,
48341         "can't convert negative value to npy_uint32");
48342     return (npy_uint32) -1;
48343 }
48344 
48345 /* PrintOne */
48346   #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
__Pyx_PrintOne(PyObject * f,PyObject * o)48347 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
48348     if (!f) {
48349         if (!(f = __Pyx_GetStdout()))
48350             return -1;
48351     }
48352     Py_INCREF(f);
48353     if (PyFile_SoftSpace(f, 0)) {
48354         if (PyFile_WriteString(" ", f) < 0)
48355             goto error;
48356     }
48357     if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
48358         goto error;
48359     if (PyFile_WriteString("\n", f) < 0)
48360         goto error;
48361     Py_DECREF(f);
48362     return 0;
48363 error:
48364     Py_DECREF(f);
48365     return -1;
48366     /* the line below is just to avoid C compiler
48367      * warnings about unused functions */
48368     return __Pyx_Print(f, NULL, 0);
48369 }
48370 #else
__Pyx_PrintOne(PyObject * stream,PyObject * o)48371 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
48372     int res;
48373     PyObject* arg_tuple = PyTuple_Pack(1, o);
48374     if (unlikely(!arg_tuple))
48375         return -1;
48376     res = __Pyx_Print(stream, arg_tuple, 1);
48377     Py_DECREF(arg_tuple);
48378     return res;
48379 }
48380 #endif
48381 
48382 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)48383   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
48384     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
48385     const int is_unsigned = neg_one > const_zero;
48386 #if PY_MAJOR_VERSION < 3
48387     if (likely(PyInt_Check(x))) {
48388         if (sizeof(char) < sizeof(long)) {
48389             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
48390         } else {
48391             long val = PyInt_AS_LONG(x);
48392             if (is_unsigned && unlikely(val < 0)) {
48393                 goto raise_neg_overflow;
48394             }
48395             return (char) val;
48396         }
48397     } else
48398 #endif
48399     if (likely(PyLong_Check(x))) {
48400         if (is_unsigned) {
48401 #if CYTHON_USE_PYLONG_INTERNALS
48402             const digit* digits = ((PyLongObject*)x)->ob_digit;
48403             switch (Py_SIZE(x)) {
48404                 case  0: return (char) 0;
48405                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
48406                 case 2:
48407                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
48408                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48409                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48410                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
48411                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
48412                         }
48413                     }
48414                     break;
48415                 case 3:
48416                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
48417                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48418                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48419                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
48420                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
48421                         }
48422                     }
48423                     break;
48424                 case 4:
48425                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
48426                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48427                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48428                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
48429                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
48430                         }
48431                     }
48432                     break;
48433             }
48434 #endif
48435 #if CYTHON_COMPILING_IN_CPYTHON
48436             if (unlikely(Py_SIZE(x) < 0)) {
48437                 goto raise_neg_overflow;
48438             }
48439 #else
48440             {
48441                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
48442                 if (unlikely(result < 0))
48443                     return (char) -1;
48444                 if (unlikely(result == 1))
48445                     goto raise_neg_overflow;
48446             }
48447 #endif
48448             if (sizeof(char) <= sizeof(unsigned long)) {
48449                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
48450 #ifdef HAVE_LONG_LONG
48451             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
48452                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
48453 #endif
48454             }
48455         } else {
48456 #if CYTHON_USE_PYLONG_INTERNALS
48457             const digit* digits = ((PyLongObject*)x)->ob_digit;
48458             switch (Py_SIZE(x)) {
48459                 case  0: return (char) 0;
48460                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
48461                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
48462                 case -2:
48463                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
48464                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48465                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48466                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
48467                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48468                         }
48469                     }
48470                     break;
48471                 case 2:
48472                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
48473                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
48474                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48475                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
48476                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48477                         }
48478                     }
48479                     break;
48480                 case -3:
48481                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
48482                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48483                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48484                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
48485                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48486                         }
48487                     }
48488                     break;
48489                 case 3:
48490                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
48491                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
48492                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48493                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
48494                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48495                         }
48496                     }
48497                     break;
48498                 case -4:
48499                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
48500                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48501                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48502                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
48503                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48504                         }
48505                     }
48506                     break;
48507                 case 4:
48508                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
48509                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
48510                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
48511                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
48512                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
48513                         }
48514                     }
48515                     break;
48516             }
48517 #endif
48518             if (sizeof(char) <= sizeof(long)) {
48519                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
48520 #ifdef HAVE_LONG_LONG
48521             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
48522                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
48523 #endif
48524             }
48525         }
48526         {
48527 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
48528             PyErr_SetString(PyExc_RuntimeError,
48529                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
48530 #else
48531             char val;
48532             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
48533  #if PY_MAJOR_VERSION < 3
48534             if (likely(v) && !PyLong_Check(v)) {
48535                 PyObject *tmp = v;
48536                 v = PyNumber_Long(tmp);
48537                 Py_DECREF(tmp);
48538             }
48539  #endif
48540             if (likely(v)) {
48541                 int one = 1; int is_little = (int)*(unsigned char *)&one;
48542                 unsigned char *bytes = (unsigned char *)&val;
48543                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
48544                                               bytes, sizeof(val),
48545                                               is_little, !is_unsigned);
48546                 Py_DECREF(v);
48547                 if (likely(!ret))
48548                     return val;
48549             }
48550 #endif
48551             return (char) -1;
48552         }
48553     } else {
48554         char val;
48555         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
48556         if (!tmp) return (char) -1;
48557         val = __Pyx_PyInt_As_char(tmp);
48558         Py_DECREF(tmp);
48559         return val;
48560     }
48561 raise_overflow:
48562     PyErr_SetString(PyExc_OverflowError,
48563         "value too large to convert to char");
48564     return (char) -1;
48565 raise_neg_overflow:
48566     PyErr_SetString(PyExc_OverflowError,
48567         "can't convert negative value to char");
48568     return (char) -1;
48569 }
48570 
48571 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject * obj,int writable_flag)48572   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_uint8_t(PyObject *obj, int writable_flag) {
48573     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48574     __Pyx_BufFmt_StackElem stack[1];
48575     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48576     int retcode;
48577     if (obj == Py_None) {
48578         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48579         return result;
48580     }
48581     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48582                                                  PyBUF_RECORDS_RO | writable_flag, 4,
48583                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
48584                                                  &result, obj);
48585     if (unlikely(retcode == -1))
48586         goto __pyx_fail;
48587     return result;
48588 __pyx_fail:
48589     result.memview = NULL;
48590     result.data = NULL;
48591     return result;
48592 }
48593 
48594 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)48595   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
48596     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48597     __Pyx_BufFmt_StackElem stack[1];
48598     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48599     int retcode;
48600     if (obj == Py_None) {
48601         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48602         return result;
48603     }
48604     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48605                                                  PyBUF_RECORDS_RO | writable_flag, 2,
48606                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
48607                                                  &result, obj);
48608     if (unlikely(retcode == -1))
48609         goto __pyx_fail;
48610     return result;
48611 __pyx_fail:
48612     result.memview = NULL;
48613     result.data = NULL;
48614     return result;
48615 }
48616 
48617 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)48618   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
48619     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48620     __Pyx_BufFmt_StackElem stack[1];
48621     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48622     int retcode;
48623     if (obj == Py_None) {
48624         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48625         return result;
48626     }
48627     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48628                                                  PyBUF_RECORDS_RO | writable_flag, 6,
48629                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
48630                                                  &result, obj);
48631     if (unlikely(retcode == -1))
48632         goto __pyx_fail;
48633     return result;
48634 __pyx_fail:
48635     result.memview = NULL;
48636     result.data = NULL;
48637     return result;
48638 }
48639 
48640 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject * obj,int writable_flag)48641   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsdsds_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
48642     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48643     __Pyx_BufFmt_StackElem stack[1];
48644     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48645     int retcode;
48646     if (obj == Py_None) {
48647         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48648         return result;
48649     }
48650     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48651                                                  PyBUF_RECORDS_RO | writable_flag, 5,
48652                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
48653                                                  &result, obj);
48654     if (unlikely(retcode == -1))
48655         goto __pyx_fail;
48656     return result;
48657 __pyx_fail:
48658     result.memview = NULL;
48659     result.data = NULL;
48660     return result;
48661 }
48662 
48663 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject * obj,int writable_flag)48664   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint64_t(PyObject *obj, int writable_flag) {
48665     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48666     __Pyx_BufFmt_StackElem stack[1];
48667     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48668     int retcode;
48669     if (obj == Py_None) {
48670         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48671         return result;
48672     }
48673     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48674                                                  PyBUF_RECORDS_RO | writable_flag, 1,
48675                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint64_t, stack,
48676                                                  &result, obj);
48677     if (unlikely(retcode == -1))
48678         goto __pyx_fail;
48679     return result;
48680 __pyx_fail:
48681     result.memview = NULL;
48682     result.data = NULL;
48683     return result;
48684 }
48685 
48686 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)48687   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsdsdsds_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
48688     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48689     __Pyx_BufFmt_StackElem stack[1];
48690     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48691     int retcode;
48692     if (obj == Py_None) {
48693         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48694         return result;
48695     }
48696     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48697                                                  PyBUF_RECORDS_RO | writable_flag, 4,
48698                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
48699                                                  &result, obj);
48700     if (unlikely(retcode == -1))
48701         goto __pyx_fail;
48702     return result;
48703 __pyx_fail:
48704     result.memview = NULL;
48705     result.data = NULL;
48706     return result;
48707 }
48708 
48709 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject * obj,int writable_flag)48710   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *obj, int writable_flag) {
48711     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48712     __Pyx_BufFmt_StackElem stack[1];
48713     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
48714     int retcode;
48715     if (obj == Py_None) {
48716         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48717         return result;
48718     }
48719     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
48720                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
48721                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
48722                                                  &result, obj);
48723     if (unlikely(retcode == -1))
48724         goto __pyx_fail;
48725     return result;
48726 __pyx_fail:
48727     result.memview = NULL;
48728     result.data = NULL;
48729     return result;
48730 }
48731 
48732 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject * obj,int writable_flag)48733   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
48734     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48735     __Pyx_BufFmt_StackElem stack[1];
48736     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
48737     int retcode;
48738     if (obj == Py_None) {
48739         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48740         return result;
48741     }
48742     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
48743                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
48744                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
48745                                                  &result, obj);
48746     if (unlikely(retcode == -1))
48747         goto __pyx_fail;
48748     return result;
48749 __pyx_fail:
48750     result.memview = NULL;
48751     result.data = NULL;
48752     return result;
48753 }
48754 
48755 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject * obj,int writable_flag)48756   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj, int writable_flag) {
48757     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48758     __Pyx_BufFmt_StackElem stack[1];
48759     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
48760     int retcode;
48761     if (obj == Py_None) {
48762         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48763         return result;
48764     }
48765     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
48766                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
48767                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, stack,
48768                                                  &result, obj);
48769     if (unlikely(retcode == -1))
48770         goto __pyx_fail;
48771     return result;
48772 __pyx_fail:
48773     result.memview = NULL;
48774     result.data = NULL;
48775     return result;
48776 }
48777 
48778 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject * obj,int writable_flag)48779   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded(PyObject *obj, int writable_flag) {
48780     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
48781     __Pyx_BufFmt_StackElem stack[2];
48782     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
48783     int retcode;
48784     if (obj == Py_None) {
48785         result.memview = (struct __pyx_memoryview_obj *) Py_None;
48786         return result;
48787     }
48788     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
48789                                                  PyBUF_RECORDS_RO | writable_flag, 1,
48790                                                  &__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_12oct_visitors_OctPadded, stack,
48791                                                  &result, obj);
48792     if (unlikely(retcode == -1))
48793         goto __pyx_fail;
48794     return result;
48795 __pyx_fail:
48796     result.memview = NULL;
48797     result.data = NULL;
48798     return result;
48799 }
48800 
48801 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)48802   static int __Pyx_check_binary_version(void) {
48803     char ctversion[4], rtversion[4];
48804     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
48805     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
48806     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
48807         char message[200];
48808         PyOS_snprintf(message, sizeof(message),
48809                       "compiletime version %s of module '%.100s' "
48810                       "does not match runtime version %s",
48811                       ctversion, __Pyx_MODULE_NAME, rtversion);
48812         return PyErr_WarnEx(NULL, message, 1);
48813     }
48814     return 0;
48815 }
48816 
48817 /* PyObjectSetAttrStr */
48818   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)48819 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
48820     PyTypeObject* tp = Py_TYPE(obj);
48821     if (likely(tp->tp_setattro))
48822         return tp->tp_setattro(obj, attr_name, value);
48823 #if PY_MAJOR_VERSION < 3
48824     if (likely(tp->tp_setattr))
48825         return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
48826 #endif
48827     return PyObject_SetAttr(obj, attr_name, value);
48828 }
48829 #endif
48830 
48831 /* VoidPtrExport */
__Pyx_ExportVoidPtr(PyObject * name,void * p,const char * sig)48832   static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
48833     PyObject *d;
48834     PyObject *cobj = 0;
48835     d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
48836     Py_XINCREF(d);
48837     if (!d) {
48838         d = PyDict_New();
48839         if (!d)
48840             goto bad;
48841         if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
48842             goto bad;
48843     }
48844 #if PY_VERSION_HEX >= 0x02070000
48845     cobj = PyCapsule_New(p, sig, 0);
48846 #else
48847     cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
48848 #endif
48849     if (!cobj)
48850         goto bad;
48851     if (PyDict_SetItem(d, name, cobj) < 0)
48852         goto bad;
48853     Py_DECREF(cobj);
48854     Py_DECREF(d);
48855     return 0;
48856 bad:
48857     Py_XDECREF(cobj);
48858     Py_XDECREF(d);
48859     return -1;
48860 }
48861 
48862 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)48863   static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
48864     PyObject *d = 0;
48865     PyObject *cobj = 0;
48866     union {
48867         void (*fp)(void);
48868         void *p;
48869     } tmp;
48870     d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
48871     if (!d) {
48872         PyErr_Clear();
48873         d = PyDict_New();
48874         if (!d)
48875             goto bad;
48876         Py_INCREF(d);
48877         if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
48878             goto bad;
48879     }
48880     tmp.fp = f;
48881 #if PY_VERSION_HEX >= 0x02070000
48882     cobj = PyCapsule_New(tmp.p, sig, 0);
48883 #else
48884     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
48885 #endif
48886     if (!cobj)
48887         goto bad;
48888     if (PyDict_SetItemString(d, name, cobj) < 0)
48889         goto bad;
48890     Py_DECREF(cobj);
48891     Py_DECREF(d);
48892     return 0;
48893 bad:
48894     Py_XDECREF(cobj);
48895     Py_XDECREF(d);
48896     return -1;
48897 }
48898 
48899 /* FunctionImport */
48900   #ifndef __PYX_HAVE_RT_ImportFunction
48901 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)48902 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
48903     PyObject *d = 0;
48904     PyObject *cobj = 0;
48905     union {
48906         void (*fp)(void);
48907         void *p;
48908     } tmp;
48909     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
48910     if (!d)
48911         goto bad;
48912     cobj = PyDict_GetItemString(d, funcname);
48913     if (!cobj) {
48914         PyErr_Format(PyExc_ImportError,
48915             "%.200s does not export expected C function %.200s",
48916                 PyModule_GetName(module), funcname);
48917         goto bad;
48918     }
48919 #if PY_VERSION_HEX >= 0x02070000
48920     if (!PyCapsule_IsValid(cobj, sig)) {
48921         PyErr_Format(PyExc_TypeError,
48922             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
48923              PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
48924         goto bad;
48925     }
48926     tmp.p = PyCapsule_GetPointer(cobj, sig);
48927 #else
48928     {const char *desc, *s1, *s2;
48929     desc = (const char *)PyCObject_GetDesc(cobj);
48930     if (!desc)
48931         goto bad;
48932     s1 = desc; s2 = sig;
48933     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
48934     if (*s1 != *s2) {
48935         PyErr_Format(PyExc_TypeError,
48936             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
48937              PyModule_GetName(module), funcname, sig, desc);
48938         goto bad;
48939     }
48940     tmp.p = PyCObject_AsVoidPtr(cobj);}
48941 #endif
48942     *f = tmp.fp;
48943     if (!(*f))
48944         goto bad;
48945     Py_DECREF(d);
48946     return 0;
48947 bad:
48948     Py_XDECREF(d);
48949     return -1;
48950 }
48951 #endif
48952 
48953 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)48954   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
48955     while (t->p) {
48956         #if PY_MAJOR_VERSION < 3
48957         if (t->is_unicode) {
48958             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
48959         } else if (t->intern) {
48960             *t->p = PyString_InternFromString(t->s);
48961         } else {
48962             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
48963         }
48964         #else
48965         if (t->is_unicode | t->is_str) {
48966             if (t->intern) {
48967                 *t->p = PyUnicode_InternFromString(t->s);
48968             } else if (t->encoding) {
48969                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
48970             } else {
48971                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
48972             }
48973         } else {
48974             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
48975         }
48976         #endif
48977         if (!*t->p)
48978             return -1;
48979         if (PyObject_Hash(*t->p) == -1)
48980             return -1;
48981         ++t;
48982     }
48983     return 0;
48984 }
48985 
__Pyx_PyUnicode_FromString(const char * c_str)48986 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
48987     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
48988 }
__Pyx_PyObject_AsString(PyObject * o)48989 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
48990     Py_ssize_t ignore;
48991     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
48992 }
48993 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
48994 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)48995 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
48996     char* defenc_c;
48997     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
48998     if (!defenc) return NULL;
48999     defenc_c = PyBytes_AS_STRING(defenc);
49000 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
49001     {
49002         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
49003         char* c;
49004         for (c = defenc_c; c < end; c++) {
49005             if ((unsigned char) (*c) >= 128) {
49006                 PyUnicode_AsASCIIString(o);
49007                 return NULL;
49008             }
49009         }
49010     }
49011 #endif
49012     *length = PyBytes_GET_SIZE(defenc);
49013     return defenc_c;
49014 }
49015 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)49016 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
49017     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
49018 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
49019     if (likely(PyUnicode_IS_ASCII(o))) {
49020         *length = PyUnicode_GET_LENGTH(o);
49021         return PyUnicode_AsUTF8(o);
49022     } else {
49023         PyUnicode_AsASCIIString(o);
49024         return NULL;
49025     }
49026 #else
49027     return PyUnicode_AsUTF8AndSize(o, length);
49028 #endif
49029 }
49030 #endif
49031 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)49032 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
49033 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
49034     if (
49035 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
49036             __Pyx_sys_getdefaultencoding_not_ascii &&
49037 #endif
49038             PyUnicode_Check(o)) {
49039         return __Pyx_PyUnicode_AsStringAndSize(o, length);
49040     } else
49041 #endif
49042 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
49043     if (PyByteArray_Check(o)) {
49044         *length = PyByteArray_GET_SIZE(o);
49045         return PyByteArray_AS_STRING(o);
49046     } else
49047 #endif
49048     {
49049         char* result;
49050         int r = PyBytes_AsStringAndSize(o, &result, length);
49051         if (unlikely(r < 0)) {
49052             return NULL;
49053         } else {
49054             return result;
49055         }
49056     }
49057 }
__Pyx_PyObject_IsTrue(PyObject * x)49058 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
49059    int is_true = x == Py_True;
49060    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
49061    else return PyObject_IsTrue(x);
49062 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)49063 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
49064     int retval;
49065     if (unlikely(!x)) return -1;
49066     retval = __Pyx_PyObject_IsTrue(x);
49067     Py_DECREF(x);
49068     return retval;
49069 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)49070 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
49071 #if PY_MAJOR_VERSION >= 3
49072     if (PyLong_Check(result)) {
49073         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
49074                 "__int__ returned non-int (type %.200s).  "
49075                 "The ability to return an instance of a strict subclass of int "
49076                 "is deprecated, and may be removed in a future version of Python.",
49077                 Py_TYPE(result)->tp_name)) {
49078             Py_DECREF(result);
49079             return NULL;
49080         }
49081         return result;
49082     }
49083 #endif
49084     PyErr_Format(PyExc_TypeError,
49085                  "__%.4s__ returned non-%.4s (type %.200s)",
49086                  type_name, type_name, Py_TYPE(result)->tp_name);
49087     Py_DECREF(result);
49088     return NULL;
49089 }
__Pyx_PyNumber_IntOrLong(PyObject * x)49090 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
49091 #if CYTHON_USE_TYPE_SLOTS
49092   PyNumberMethods *m;
49093 #endif
49094   const char *name = NULL;
49095   PyObject *res = NULL;
49096 #if PY_MAJOR_VERSION < 3
49097   if (likely(PyInt_Check(x) || PyLong_Check(x)))
49098 #else
49099   if (likely(PyLong_Check(x)))
49100 #endif
49101     return __Pyx_NewRef(x);
49102 #if CYTHON_USE_TYPE_SLOTS
49103   m = Py_TYPE(x)->tp_as_number;
49104   #if PY_MAJOR_VERSION < 3
49105   if (m && m->nb_int) {
49106     name = "int";
49107     res = m->nb_int(x);
49108   }
49109   else if (m && m->nb_long) {
49110     name = "long";
49111     res = m->nb_long(x);
49112   }
49113   #else
49114   if (likely(m && m->nb_int)) {
49115     name = "int";
49116     res = m->nb_int(x);
49117   }
49118   #endif
49119 #else
49120   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
49121     res = PyNumber_Int(x);
49122   }
49123 #endif
49124   if (likely(res)) {
49125 #if PY_MAJOR_VERSION < 3
49126     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
49127 #else
49128     if (unlikely(!PyLong_CheckExact(res))) {
49129 #endif
49130         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
49131     }
49132   }
49133   else if (!PyErr_Occurred()) {
49134     PyErr_SetString(PyExc_TypeError,
49135                     "an integer is required");
49136   }
49137   return res;
49138 }
49139 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
49140   Py_ssize_t ival;
49141   PyObject *x;
49142 #if PY_MAJOR_VERSION < 3
49143   if (likely(PyInt_CheckExact(b))) {
49144     if (sizeof(Py_ssize_t) >= sizeof(long))
49145         return PyInt_AS_LONG(b);
49146     else
49147         return PyInt_AsSsize_t(b);
49148   }
49149 #endif
49150   if (likely(PyLong_CheckExact(b))) {
49151     #if CYTHON_USE_PYLONG_INTERNALS
49152     const digit* digits = ((PyLongObject*)b)->ob_digit;
49153     const Py_ssize_t size = Py_SIZE(b);
49154     if (likely(__Pyx_sst_abs(size) <= 1)) {
49155         ival = likely(size) ? digits[0] : 0;
49156         if (size == -1) ival = -ival;
49157         return ival;
49158     } else {
49159       switch (size) {
49160          case 2:
49161            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
49162              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
49163            }
49164            break;
49165          case -2:
49166            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
49167              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
49168            }
49169            break;
49170          case 3:
49171            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
49172              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
49173            }
49174            break;
49175          case -3:
49176            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
49177              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
49178            }
49179            break;
49180          case 4:
49181            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
49182              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]));
49183            }
49184            break;
49185          case -4:
49186            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
49187              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]));
49188            }
49189            break;
49190       }
49191     }
49192     #endif
49193     return PyLong_AsSsize_t(b);
49194   }
49195   x = PyNumber_Index(b);
49196   if (!x) return -1;
49197   ival = PyInt_AsSsize_t(x);
49198   Py_DECREF(x);
49199   return ival;
49200 }
49201 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
49202   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
49203 }
49204 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
49205     return PyInt_FromSize_t(ival);
49206 }
49207 
49208 
49209 #endif /* Py_PYTHON_H */
49210