[Yt-svn] yt-commit r1166 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Tue Feb 10 14:12:35 PST 2009
Author: mturk
Date: Tue Feb 10 14:12:34 2009
New Revision: 1166
URL: http://yt.spacepope.org/changeset/1166
Log:
Fixes for the by-levels octree generation. Fixes for generating child_indices.
Modified:
trunk/yt/lagos/BaseGridType.py
trunk/yt/lagos/DepthFirstOctree.c
trunk/yt/lagos/DepthFirstOctree.pyx
trunk/yt/lagos/HierarchyType.py
Modified: trunk/yt/lagos/BaseGridType.py
==============================================================================
--- trunk/yt/lagos/BaseGridType.py (original)
+++ trunk/yt/lagos/BaseGridType.py Tue Feb 10 14:12:34 2009
@@ -306,7 +306,8 @@
"""
self.__child_index_mask = na.zeros(self.ActiveDimensions, 'int32') - 1
for child in self.Children:
- self.__fill_child_mask(child, self.__child_mask, child.id)
+ self.__fill_child_mask(child, self.__child_index_mask,
+ child.id)
def _get_coords(self):
if self.__coords == None: self._generate_coords()
Modified: trunk/yt/lagos/DepthFirstOctree.c
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.c (original)
+++ trunk/yt/lagos/DepthFirstOctree.c Tue Feb 10 14:12:34 2009
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Wed Nov 5 09:40:16 2008 */
+/* Generated by Cython 0.10.3 on Fri Feb 6 13:47:10 2009 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -31,14 +31,15 @@
typedef struct {
void *buf;
+ PyObject *obj;
Py_ssize_t len;
+ Py_ssize_t itemsize;
int readonly;
- const char *format;
int ndim;
+ char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
- Py_ssize_t itemsize;
void *internal;
} Py_buffer;
@@ -63,6 +64,9 @@
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
+#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyString_Type PyBytes_Type
@@ -104,6 +108,7 @@
#endif
#include <math.h>
#define __PYX_HAVE_API__yt__lagos__DepthFirstOctree
+#include "stdlib.h"
#include "numpy/arrayobject.h"
@@ -176,41 +181,31 @@
static const char **__pyx_f;
static char __pyx_mdoc[] = "\nThis is a recursive function to return a depth-first octree\n\nAuthor: Matthew Turk <matthewturk at gmail.com>\nAffiliation: KIPAC/SLAC/Stanford\nHomepage: http://yt.enzotools.org/\nLicense:\n Copyright (C) 2008 Matthew Turk. All Rights Reserved.\n\n This file is part of yt.\n\n yt is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n";
-static INLINE void __Pyx_SafeReleaseBuffer(PyObject* obj, Py_buffer* info);
-static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/
-static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/
-static INLINE const char* __Pyx_BufferTypestringCheckEndian(const char* ts); /*proto*/
-static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_t(const char* ts); /*proto*/
-static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd); /*proto*/
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(const char* ts); /*proto*/
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd); /*proto*/
-#define __Pyx_BufPtrStrided1d(buf, i0, s0) ((char*)buf + i0 * s0)
-#define __Pyx_BufPtrStrided4d(buf, i0, s0, i1, s1, i2, s2, i3, s3) ((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
-#define __Pyx_BufPtrStrided2d(buf, i0, s0, i1, s1) ((char*)buf + i0 * s0 + i1 * s1)
-
-static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
-#define __Pyx_BufPtrStrided3d(buf, i0, s0, i1, s1, i2, s2) ((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
+static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
+ const char* function_name, int kw_allowed); /*proto*/
-static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name, PyObject* kw_name); /*proto*/
-static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
+static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
+static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf); /*proto*/
+static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts); /*proto*/
+static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim); /*proto*/
+static const char* __Pyx_DescribeTokenInFormatString(const char* ts); /*proto*/
+static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts); /*proto*/
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact); /*proto*/
-#if (PY_MAJOR_VERSION < 3) && !(Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
-static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
-static void __Pyx_ReleaseBuffer(PyObject *obj, Py_buffer *view);
-#else
-#define __Pyx_GetBuffer PyObject_GetBuffer
-#define __Pyx_ReleaseBuffer PyObject_ReleaseBuffer
-#endif
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/
+static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts); /*proto*/
-Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0};
-Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1};
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
PyObject *r;
@@ -233,6 +228,27 @@
}
return r;
}
+#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+#define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
+#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
+
+static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
+#define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
+
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact); /*proto*/
+#if PY_MAJOR_VERSION < 3
+static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+#define __Pyx_GetBuffer PyObject_GetBuffer
+#define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0};
+Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1};
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
@@ -244,11 +260,16 @@
static PyObject* __pyx_print_kwargs = 0;
#endif
+static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static PyObject *__Pyx_ImportModule(char *name); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/
+
+static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
@@ -290,6 +311,12 @@
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":30
* cimport cython
*
@@ -334,10 +361,15 @@
PyObject_HEAD
PyObject *grids;
};
+/* Module declarations from python_buffer */
+
+/* Module declarations from stdlib */
+
/* Module declarations from numpy */
/* Module declarations from numpy */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
/* Module declarations from cython */
@@ -355,40 +387,104 @@
static PyObject *__pyx_kp___cinit__;
static char __pyx_k___getitem__[] = "__getitem__";
static PyObject *__pyx_kp___getitem__;
+static char __pyx_k_child_indices[] = "child_indices";
+static PyObject *__pyx_kp_child_indices;
+static char __pyx_k_fields[] = "fields";
+static PyObject *__pyx_kp_fields;
+static char __pyx_k_left_edges[] = "left_edges";
+static PyObject *__pyx_kp_left_edges;
+static char __pyx_k_dimensions[] = "dimensions";
+static PyObject *__pyx_kp_dimensions;
+static char __pyx_k_dx[] = "dx";
+static PyObject *__pyx_kp_dx;
+static char __pyx_k_level[] = "level";
+static PyObject *__pyx_kp_level;
+static char __pyx_k_grids[] = "grids";
+static PyObject *__pyx_kp_grids;
+static char __pyx_k_item[] = "item";
+static PyObject *__pyx_kp_item;
+static char __pyx_k_i_i[] = "i_i";
+static PyObject *__pyx_kp_i_i;
+static char __pyx_k_j_i[] = "j_i";
+static PyObject *__pyx_kp_j_i;
+static char __pyx_k_k_i[] = "k_i";
+static PyObject *__pyx_kp_k_i;
+static char __pyx_k_i_f[] = "i_f";
+static PyObject *__pyx_kp_i_f;
+static char __pyx_k_j_f[] = "j_f";
+static PyObject *__pyx_kp_j_f;
+static char __pyx_k_k_f[] = "k_f";
+static PyObject *__pyx_kp_k_f;
+static char __pyx_k_curpos[] = "curpos";
+static PyObject *__pyx_kp_curpos;
+static char __pyx_k_gi[] = "gi";
+static PyObject *__pyx_kp_gi;
+static char __pyx_k_output[] = "output";
+static PyObject *__pyx_kp_output;
+static char __pyx_k_refined[] = "refined";
+static PyObject *__pyx_kp_refined;
+static char __pyx_k_genealogy[] = "genealogy";
+static PyObject *__pyx_kp_genealogy;
+static char __pyx_k_corners[] = "corners";
+static PyObject *__pyx_kp_corners;
static char __pyx_k_numpy[] = "numpy";
static PyObject *__pyx_kp_numpy;
static char __pyx_k_np[] = "np";
static PyObject *__pyx_kp_np;
-static char __pyx_k_17[] = "RecurseOctreeDepthFirst";
-static PyObject *__pyx_kp_17;
-static char __pyx_k_18[] = "RecurseOctreeByLevels";
-static PyObject *__pyx_kp_18;
+static char __pyx_k_23[] = "RecurseOctreeDepthFirst";
+static PyObject *__pyx_kp_23;
+static char __pyx_k_24[] = "RecurseOctreeByLevels";
+static PyObject *__pyx_kp_24;
static char __pyx_k___getbuffer__[] = "__getbuffer__";
static PyObject *__pyx_kp___getbuffer__;
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static PyObject *__pyx_kp_RuntimeError;
+static char __pyx_k___releasebuffer__[] = "__releasebuffer__";
+static PyObject *__pyx_kp___releasebuffer__;
+static char __pyx_k_info[] = "info";
+static PyObject *__pyx_kp_info;
+static char __pyx_k_flags[] = "flags";
+static PyObject *__pyx_kp_flags;
static char __pyx_k_ValueError[] = "ValueError";
static PyObject *__pyx_kp_ValueError;
+static char __pyx_k_iteritems[] = "iteritems";
+static PyObject *__pyx_kp_iteritems;
+static char __pyx_k_next[] = "next";
+static PyObject *__pyx_kp_next;
+static char __pyx_k_StopIteration[] = "StopIteration";
+static PyObject *__pyx_kp_StopIteration;
+static char __pyx_k_pop[] = "pop";
+static PyObject *__pyx_kp_pop;
+static char __pyx_k_RuntimeError[] = "RuntimeError";
+static PyObject *__pyx_kp_RuntimeError;
static PyObject *__pyx_kp_1;
-static PyObject *__pyx_kp_16;
-static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_kp_2;
+static PyObject *__pyx_kp_20;
+static PyObject *__pyx_kp_21;
+static PyObject *__pyx_kp_22;
static PyObject *__pyx_builtin_ValueError;
-static char __pyx_k_1[] = "Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this";
-static char __pyx_k_2[] = "b";
-static char __pyx_k_3[] = "B";
-static char __pyx_k_4[] = "h";
-static char __pyx_k_5[] = "H";
-static char __pyx_k_6[] = "i";
-static char __pyx_k_7[] = "I";
-static char __pyx_k_8[] = "l";
-static char __pyx_k_9[] = "L";
-static char __pyx_k_10[] = "q";
-static char __pyx_k_11[] = "Q";
-static char __pyx_k_12[] = "f";
-static char __pyx_k_13[] = "d";
-static char __pyx_k_14[] = "g";
-static char __pyx_k_15[] = "O";
-static char __pyx_k_16[] = "only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)";
+static PyObject *__pyx_builtin_StopIteration;
+static PyObject *__pyx_builtin_RuntimeError;
+static char __pyx_k_1[] = "ndarray is not C contiguous";
+static char __pyx_k_2[] = "ndarray is not Fortran contiguous";
+static char __pyx_k_3[] = "b";
+static char __pyx_k_4[] = "B";
+static char __pyx_k_5[] = "h";
+static char __pyx_k_6[] = "H";
+static char __pyx_k_7[] = "i";
+static char __pyx_k_8[] = "I";
+static char __pyx_k_9[] = "l";
+static char __pyx_k_10[] = "L";
+static char __pyx_k_11[] = "q";
+static char __pyx_k_12[] = "Q";
+static char __pyx_k_13[] = "f";
+static char __pyx_k_14[] = "d";
+static char __pyx_k_15[] = "g";
+static char __pyx_k_16[] = "Zf";
+static char __pyx_k_17[] = "Zd";
+static char __pyx_k_18[] = "Zg";
+static char __pyx_k_19[] = "O";
+static char __pyx_k_20[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_21[] = "Format string allocated too short.";
+static char __pyx_k_22[] = "unknown dtype code in numpy.pxd (%d)";
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":32
* cdef class position:
@@ -402,12 +498,8 @@
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_8position___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
- __Pyx_RaiseArgtupleTooLong(0, PyTuple_GET_SIZE(__pyx_args));
- return -1;
- }
- if (unlikely(__pyx_kwds)) {
- if (unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
- }
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+ if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":33
* cdef public int output_pos, refined_pos
@@ -473,8 +565,68 @@
Py_ssize_t __pyx_bstride_0_dimensions = 0;
Py_ssize_t __pyx_bshape_0_dimensions = 0;
int __pyx_r;
- static char *__pyx_argnames[] = {"child_indices","fields","left_edges","dimensions","dx","level",0};
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 6)) {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_child_indices,&__pyx_kp_fields,&__pyx_kp_left_edges,&__pyx_kp_dimensions,&__pyx_kp_dx,&__pyx_kp_level,0};
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[6] = {0,0,0,0,0,0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_child_indices);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_fields);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_left_edges);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dimensions);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dx);
+ if (likely(values[4])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 5:
+ values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_level);
+ if (likely(values[5])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_child_indices = ((PyArrayObject *)values[0]);
+ __pyx_v_fields = ((PyArrayObject *)values[1]);
+ __pyx_v_left_edges = ((PyArrayObject *)values[2]);
+ __pyx_v_dimensions = ((PyArrayObject *)values[3]);
+ __pyx_v_dx = ((PyArrayObject *)values[4]);
+ __pyx_v_level = __pyx_PyInt_int(values[5]); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_child_indices = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
__pyx_v_fields = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
__pyx_v_left_edges = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2));
@@ -482,32 +634,36 @@
__pyx_v_dx = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 4));
__pyx_v_level = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_level == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOOi", __pyx_argnames, &__pyx_v_child_indices, &__pyx_v_fields, &__pyx_v_left_edges, &__pyx_v_dimensions, &__pyx_v_dx, &__pyx_v_level))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGrid.__cinit__");
return -1;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_bstruct_child_indices.buf = NULL;
+ __pyx_bstruct_fields.buf = NULL;
+ __pyx_bstruct_left_edges.buf = NULL;
+ __pyx_bstruct_dimensions.buf = NULL;
+ __pyx_bstruct_dx.buf = NULL;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child_indices), __pyx_ptype_5numpy_ndarray, 1, "child_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), __pyx_ptype_5numpy_ndarray, 1, "fields", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edges), __pyx_ptype_5numpy_ndarray, 1, "left_edges", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dx), __pyx_ptype_5numpy_ndarray, 1, "dx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_child_indices = __pyx_bstruct_child_indices.strides[0]; __pyx_bstride_1_child_indices = __pyx_bstruct_child_indices.strides[1]; __pyx_bstride_2_child_indices = __pyx_bstruct_child_indices.strides[2];
__pyx_bshape_0_child_indices = __pyx_bstruct_child_indices.shape[0]; __pyx_bshape_1_child_indices = __pyx_bstruct_child_indices.shape[1]; __pyx_bshape_2_child_indices = __pyx_bstruct_child_indices.shape[2];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
__pyx_bshape_0_fields = __pyx_bstruct_fields.shape[0]; __pyx_bshape_1_fields = __pyx_bstruct_fields.shape[1]; __pyx_bshape_2_fields = __pyx_bstruct_fields.shape[2]; __pyx_bshape_3_fields = __pyx_bstruct_fields.shape[3];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_left_edges = __pyx_bstruct_left_edges.strides[0];
__pyx_bshape_0_left_edges = __pyx_bstruct_left_edges.shape[0];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
__pyx_bshape_0_dimensions = __pyx_bstruct_dimensions.shape[0];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
__pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
@@ -579,22 +735,22 @@
goto __pyx_L0;
__pyx_L1_error:;
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
- PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dx);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_edges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGrid.__cinit__");
__pyx_r = -1;
goto __pyx_L2;
__pyx_L0:;
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dx, &__pyx_bstruct_dx);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_left_edges, &__pyx_bstruct_left_edges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dx);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_edges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
__pyx_L2:;
return __pyx_r;
}
@@ -611,18 +767,37 @@
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_grids = 0;
int __pyx_r;
- static char *__pyx_argnames[] = {"grids",0};
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 1)) {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_grids,0};
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[1] = {0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_grids);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_grids = values[0];
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_grids = PyTuple_GET_ITEM(__pyx_args, 0);
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_grids))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__cinit__");
return -1;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":56
* cdef public object grids
@@ -655,11 +830,11 @@
assert(__pyx_arg_item); {
__pyx_v_item = __pyx_PyInt_int(__pyx_arg_item); if (unlikely((__pyx_v_item == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__getitem__");
return NULL;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":59
*
@@ -796,9 +971,109 @@
long __pyx_t_21;
long __pyx_t_22;
long __pyx_t_23;
- static char *__pyx_argnames[] = {"i_i","j_i","k_i","i_f","j_f","k_f","curpos","gi","output","refined","grids",0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_i_i,&__pyx_kp_j_i,&__pyx_kp_k_i,&__pyx_kp_i_f,&__pyx_kp_j_f,&__pyx_kp_k_f,&__pyx_kp_curpos,&__pyx_kp_gi,&__pyx_kp_output,&__pyx_kp_refined,&__pyx_kp_grids,0};
__pyx_self = __pyx_self;
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 11)) {
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_i_i);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_j_i);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_k_i);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_i_f);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_j_f);
+ if (likely(values[4])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 5:
+ values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_k_f);
+ if (likely(values[5])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 6:
+ values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_curpos);
+ if (likely(values[6])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 7:
+ values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_gi);
+ if (likely(values[7])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 8:
+ values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_output);
+ if (likely(values[8])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 9:
+ values[9] = PyDict_GetItem(__pyx_kwds, __pyx_kp_refined);
+ if (likely(values[9])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 10:
+ values[10] = PyDict_GetItem(__pyx_kwds, __pyx_kp_grids);
+ if (likely(values[10])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "RecurseOctreeDepthFirst") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_i_i = __pyx_PyInt_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_j_i = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_k_i = __pyx_PyInt_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_f = __pyx_PyInt_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_j_f = __pyx_PyInt_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_k_f = __pyx_PyInt_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_curpos = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position *)values[6]);
+ __pyx_v_gi = __pyx_PyInt_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_output = ((PyArrayObject *)values[8]);
+ __pyx_v_refined = ((PyArrayObject *)values[9]);
+ __pyx_v_grids = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)values[10]);
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_i_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_j_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_k_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
@@ -811,30 +1086,31 @@
__pyx_v_refined = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 9));
__pyx_v_grids = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)PyTuple_GET_ITEM(__pyx_args, 10));
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiiiiiOiOOO", __pyx_argnames, &__pyx_v_i_i, &__pyx_v_j_i, &__pyx_v_k_i, &__pyx_v_i_f, &__pyx_v_j_f, &__pyx_v_k_f, &__pyx_v_curpos, &__pyx_v_gi, &__pyx_v_output, &__pyx_v_refined, &__pyx_v_grids))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeDepthFirst", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.RecurseOctreeDepthFirst");
return NULL;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
__pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_child_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_s = Py_None; Py_INCREF(Py_None);
__pyx_bstruct_child_indices.buf = NULL;
__pyx_bstruct_dimensions.buf = NULL;
__pyx_bstruct_fields.buf = NULL;
__pyx_bstruct_leftedges.buf = NULL;
- __pyx_v_child_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_bstruct_child_leftedges.buf = NULL;
- __pyx_v_s = Py_None; Py_INCREF(Py_None);
+ __pyx_bstruct_output.buf = NULL;
+ __pyx_bstruct_refined.buf = NULL;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_position, 1, "curpos", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_refined), __pyx_ptype_5numpy_ndarray, 1, "refined", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList, 1, "grids", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_output = __pyx_bstruct_output.strides[0]; __pyx_bstride_1_output = __pyx_bstruct_output.strides[1];
__pyx_bshape_0_output = __pyx_bstruct_output.shape[0]; __pyx_bshape_1_output = __pyx_bstruct_output.shape[1];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_refined = __pyx_bstruct_refined.strides[0];
__pyx_bshape_0_refined = __pyx_bstruct_refined.shape[0];
@@ -860,7 +1136,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = ((PyArrayObject *)__pyx_v_grid->child_indices);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0) == -1)) {
__pyx_v_child_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_child_indices.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_child_indices = __pyx_bstruct_child_indices.strides[0]; __pyx_bstride_1_child_indices = __pyx_bstruct_child_indices.strides[1]; __pyx_bstride_2_child_indices = __pyx_bstruct_child_indices.strides[2];
@@ -879,7 +1155,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->dimensions, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = ((PyArrayObject *)__pyx_v_grid->dimensions);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
__pyx_v_dimensions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_dimensions.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
@@ -898,7 +1174,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->fields);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0) == -1)) {
__pyx_v_fields = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_fields.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
@@ -917,7 +1193,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = ((PyArrayObject *)__pyx_v_grid->left_edges);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
__pyx_v_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_leftedges.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_leftedges = __pyx_bstruct_leftedges.strides[0];
@@ -966,8 +1242,7 @@
*/
__pyx_t_5 = 2;
if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_5, __pyx_bstride_0_leftedges)));
- __pyx_v_cz = (__pyx_3 + (__pyx_v_k * __pyx_v_dx));
+ __pyx_v_cz = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_5, __pyx_bstride_0_leftedges)) + (__pyx_v_k * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":83
* k = k_off + k_i
@@ -996,8 +1271,7 @@
*/
__pyx_t_6 = 1;
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_6, __pyx_bstride_0_leftedges)));
- __pyx_v_cy = (__pyx_3 + (__pyx_v_j * __pyx_v_dx));
+ __pyx_v_cy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_6, __pyx_bstride_0_leftedges)) + (__pyx_v_j * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":86
* j = j_off + j_i
@@ -1026,8 +1300,7 @@
*/
__pyx_t_7 = 0;
if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_7, __pyx_bstride_0_leftedges)));
- __pyx_v_cx = (__pyx_3 + (__pyx_v_i * __pyx_v_dx));
+ __pyx_v_cx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_7, __pyx_bstride_0_leftedges)) + (__pyx_v_i * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":89
* i = i_off + i_i
@@ -1087,12 +1360,11 @@
if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_1_fields;
if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_2_fields;
if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_3_fields;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided4d(__pyx_bstruct_fields.buf, __pyx_t_8, __pyx_bstride_0_fields, __pyx_t_9, __pyx_bstride_1_fields, __pyx_t_10, __pyx_bstride_2_fields, __pyx_t_11, __pyx_bstride_3_fields)));
__pyx_t_12 = __pyx_v_curpos->output_pos;
__pyx_t_13 = __pyx_v_fi;
if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_output;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_1_output;
- *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_output.buf, __pyx_t_12, __pyx_bstride_0_output, __pyx_t_13, __pyx_bstride_1_output)) = __pyx_3;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_output.buf, __pyx_t_12, __pyx_bstride_0_output, __pyx_t_13, __pyx_bstride_1_output) = (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_fields.buf, __pyx_t_8, __pyx_bstride_0_fields, __pyx_t_9, __pyx_bstride_1_fields, __pyx_t_10, __pyx_bstride_2_fields, __pyx_t_11, __pyx_bstride_3_fields));
}
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":93
@@ -1104,7 +1376,7 @@
*/
__pyx_t_14 = __pyx_v_curpos->refined_pos;
if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_0_refined;
- *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_14, __pyx_bstride_0_refined)) = 0;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_refined.buf, __pyx_t_14, __pyx_bstride_0_refined) = 0;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":94
* output[curpos.output_pos,fi] = fields[fi,i,j,k]
@@ -1123,7 +1395,7 @@
* refined[curpos.refined_pos] = 1
*/
__pyx_v_curpos->refined_pos += 1;
- goto __pyx_L11;
+ goto __pyx_L12;
}
/*else*/ {
@@ -1136,7 +1408,7 @@
*/
__pyx_t_15 = __pyx_v_curpos->refined_pos;
if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_refined;
- *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_refined.buf, __pyx_t_15, __pyx_bstride_0_refined)) = 1;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_refined.buf, __pyx_t_15, __pyx_bstride_0_refined) = 1;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":98
* else:
@@ -1182,12 +1454,12 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_16 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __pyx_t_17 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_16, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __pyx_t_17 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_16, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0);
if (unlikely(__pyx_t_17 < 0))
{
PyErr_Fetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
Py_XDECREF(__pyx_t_18); Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20);
__Pyx_RaiseBufferFallbackError();
} else {
@@ -1211,19 +1483,18 @@
*/
__pyx_t_21 = 0;
if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_21, __pyx_bstride_0_child_leftedges)));
- __pyx_6 = PyFloat_FromDouble((__pyx_v_cx - __pyx_3)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble((__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_21, __pyx_bstride_0_child_leftedges)))); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
__pyx_6 = 0;
- __pyx_4 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
__pyx_5 = PyFloat_FromDouble(__pyx_v_child_dx); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_6 = __Pyx_PyNumber_Divide(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_4, __pyx_5); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_7 = __pyx_PyInt_int(__pyx_6); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_7 = __pyx_PyInt_int(__pyx_t_20); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__pyx_v_child_i = __pyx_7;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":103
@@ -1235,19 +1506,18 @@
*/
__pyx_t_22 = 1;
if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_22, __pyx_bstride_0_child_leftedges)));
- __pyx_2 = PyFloat_FromDouble((__pyx_v_cy - __pyx_3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_5 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
- __pyx_6 = PyFloat_FromDouble(__pyx_v_child_dx); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = __Pyx_PyNumber_Divide(__pyx_5, __pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble((__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_22, __pyx_bstride_0_child_leftedges)))); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
+ __pyx_6 = 0;
+ __pyx_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+ __pyx_5 = PyFloat_FromDouble(__pyx_v_child_dx); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_4, __pyx_5); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_7 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_7 = __pyx_PyInt_int(__pyx_t_20); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__pyx_v_child_j = __pyx_7;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":104
@@ -1259,19 +1529,18 @@
*/
__pyx_t_23 = 2;
if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_23, __pyx_bstride_0_child_leftedges)));
- __pyx_4 = PyFloat_FromDouble((__pyx_v_cz - __pyx_3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_6 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
- __pyx_2 = PyFloat_FromDouble(__pyx_v_child_dx); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = __Pyx_PyNumber_Divide(__pyx_6, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_7 = __pyx_PyInt_int(__pyx_4); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble((__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_23, __pyx_bstride_0_child_leftedges)))); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
+ __pyx_6 = 0;
+ __pyx_4 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+ __pyx_5 = PyFloat_FromDouble(__pyx_v_child_dx); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyNumber_Divide(__pyx_4, __pyx_5); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_7 = __pyx_PyInt_int(__pyx_t_20); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_t_20); __pyx_t_20 = 0;
__pyx_v_child_k = __pyx_7;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":105
@@ -1281,10 +1550,10 @@
* curpos, ci, output, refined, grids)
* return s
*/
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_17); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_6 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_2 = PyInt_FromLong(__pyx_v_child_j); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_4 = PyInt_FromLong(__pyx_v_child_k); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_kp_23); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_4 = PyInt_FromLong(__pyx_v_child_j); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = PyInt_FromLong(__pyx_v_child_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":106
* child_k = int(cz - child_leftedges[2])/child_dx
@@ -1295,9 +1564,9 @@
*/
__pyx_10 = PyInt_FromLong(__pyx_v_ci); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_11 = PyTuple_New(11); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_11, 0, __pyx_6);
- PyTuple_SET_ITEM(__pyx_11, 1, __pyx_2);
- PyTuple_SET_ITEM(__pyx_11, 2, __pyx_4);
+ PyTuple_SET_ITEM(__pyx_11, 0, __pyx_2);
+ PyTuple_SET_ITEM(__pyx_11, 1, __pyx_4);
+ PyTuple_SET_ITEM(__pyx_11, 2, __pyx_5);
Py_INCREF(__pyx_int_2);
PyTuple_SET_ITEM(__pyx_11, 3, __pyx_int_2);
Py_INCREF(__pyx_int_2);
@@ -1313,18 +1582,18 @@
PyTuple_SET_ITEM(__pyx_11, 9, ((PyObject *)__pyx_v_refined));
Py_INCREF(((PyObject *)__pyx_v_grids));
PyTuple_SET_ITEM(__pyx_11, 10, ((PyObject *)__pyx_v_grids));
- __pyx_6 = 0;
__pyx_2 = 0;
__pyx_4 = 0;
+ __pyx_5 = 0;
__pyx_10 = 0;
- __pyx_6 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_11), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_2 = PyObject_Call(__pyx_6, ((PyObject *)__pyx_11), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(((PyObject *)__pyx_11)); __pyx_11 = 0;
Py_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_6;
- __pyx_6 = 0;
+ __pyx_v_s = __pyx_2;
+ __pyx_2 = 0;
}
- __pyx_L11:;
+ __pyx_L12:;
}
}
}
@@ -1350,26 +1619,26 @@
Py_XDECREF(__pyx_10);
Py_XDECREF(__pyx_11);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
- PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_refined);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.RecurseOctreeDepthFirst");
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_refined, &__pyx_bstruct_refined);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_refined);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
__pyx_L2:;
Py_DECREF(__pyx_v_child_grid);
Py_XDECREF(__pyx_v_grid);
@@ -1480,20 +1749,19 @@
int __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
- __pyx_t_5numpy_int32_t __pyx_7;
- npy_intp __pyx_8;
- int __pyx_9;
+ npy_intp __pyx_7;
+ int __pyx_8;
+ PyObject *__pyx_9 = 0;
PyObject *__pyx_10 = 0;
PyObject *__pyx_11 = 0;
- PyObject *__pyx_12 = 0;
PyArrayObject *__pyx_t_1 = NULL;
PyArrayObject *__pyx_t_2 = NULL;
PyArrayObject *__pyx_t_3 = NULL;
PyArrayObject *__pyx_t_4 = NULL;
long __pyx_t_5;
long __pyx_t_6;
- int __pyx_t_7;
- long __pyx_t_8;
+ long __pyx_t_7;
+ int __pyx_t_8;
int __pyx_t_9;
long __pyx_t_10;
int __pyx_t_11;
@@ -1525,9 +1793,117 @@
long __pyx_t_37;
long __pyx_t_38;
int __pyx_t_39;
- static char *__pyx_argnames[] = {"i_i","j_i","k_i","i_f","j_f","k_f","curpos","gi","output","genealogy","corners","grids",0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_kp_i_i,&__pyx_kp_j_i,&__pyx_kp_k_i,&__pyx_kp_i_f,&__pyx_kp_j_f,&__pyx_kp_k_f,&__pyx_kp_curpos,&__pyx_kp_gi,&__pyx_kp_output,&__pyx_kp_genealogy,&__pyx_kp_corners,&__pyx_kp_grids,0};
__pyx_self = __pyx_self;
- if (likely(!__pyx_kwds) && likely(PyTuple_GET_SIZE(__pyx_args) == 12)) {
+ if (unlikely(__pyx_kwds)) {
+ PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
+ Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 0:
+ values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_i_i);
+ if (likely(values[0])) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_j_i);
+ if (likely(values[1])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_k_i);
+ if (likely(values[2])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_i_f);
+ if (likely(values[3])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_j_f);
+ if (likely(values[4])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 5:
+ values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_k_f);
+ if (likely(values[5])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 6:
+ values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_curpos);
+ if (likely(values[6])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 7:
+ values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_gi);
+ if (likely(values[7])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 8:
+ values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_output);
+ if (likely(values[8])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 9:
+ values[9] = PyDict_GetItem(__pyx_kwds, __pyx_kp_genealogy);
+ if (likely(values[9])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 10:
+ values[10] = PyDict_GetItem(__pyx_kwds, __pyx_kp_corners);
+ if (likely(values[10])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 11:
+ values[11] = PyDict_GetItem(__pyx_kwds, __pyx_kp_grids);
+ if (likely(values[11])) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "RecurseOctreeByLevels") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ __pyx_v_i_i = __pyx_PyInt_int(values[0]); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_j_i = __pyx_PyInt_int(values[1]); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_k_i = __pyx_PyInt_int(values[2]); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_f = __pyx_PyInt_int(values[3]); if (unlikely((__pyx_v_i_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_j_f = __pyx_PyInt_int(values[4]); if (unlikely((__pyx_v_j_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_k_f = __pyx_PyInt_int(values[5]); if (unlikely((__pyx_v_k_f == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_curpos = ((PyArrayObject *)values[6]);
+ __pyx_v_gi = __pyx_PyInt_int(values[7]); if (unlikely((__pyx_v_gi == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_output = ((PyArrayObject *)values[8]);
+ __pyx_v_genealogy = ((PyArrayObject *)values[9]);
+ __pyx_v_corners = ((PyArrayObject *)values[10]);
+ __pyx_v_grids = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)values[11]);
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
+ goto __pyx_L5_argtuple_error;
+ } else {
__pyx_v_i_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_i_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_j_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_j_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_k_i = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_k_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
@@ -1541,37 +1917,40 @@
__pyx_v_corners = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 10));
__pyx_v_grids = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)PyTuple_GET_ITEM(__pyx_args, 11));
}
- else {
- if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiiiiiOiOOOO", __pyx_argnames, &__pyx_v_i_i, &__pyx_v_j_i, &__pyx_v_k_i, &__pyx_v_i_f, &__pyx_v_j_f, &__pyx_v_k_f, &__pyx_v_curpos, &__pyx_v_gi, &__pyx_v_output, &__pyx_v_genealogy, &__pyx_v_corners, &__pyx_v_grids))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4;
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("RecurseOctreeByLevels", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.RecurseOctreeByLevels");
return NULL;
- __pyx_L4:;
+ __pyx_L4_argument_unpacking_done:;
__pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_child_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_s = Py_None; Py_INCREF(Py_None);
__pyx_bstruct_child_indices.buf = NULL;
__pyx_bstruct_dimensions.buf = NULL;
__pyx_bstruct_fields.buf = NULL;
__pyx_bstruct_leftedges.buf = NULL;
- __pyx_v_child_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
__pyx_bstruct_child_leftedges.buf = NULL;
- __pyx_v_s = Py_None; Py_INCREF(Py_None);
+ __pyx_bstruct_curpos.buf = NULL;
+ __pyx_bstruct_output.buf = NULL;
+ __pyx_bstruct_genealogy.buf = NULL;
+ __pyx_bstruct_corners.buf = NULL;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curpos), __pyx_ptype_5numpy_ndarray, 1, "curpos", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output), __pyx_ptype_5numpy_ndarray, 1, "output", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_genealogy), __pyx_ptype_5numpy_ndarray, 1, "genealogy", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_corners), __pyx_ptype_5numpy_ndarray, 1, "corners", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_grids), __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList, 1, "grids", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_curpos, &__pyx_bstruct_curpos, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_curpos, &__pyx_bstruct_curpos, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_curpos = __pyx_bstruct_curpos.strides[0];
__pyx_bshape_0_curpos = __pyx_bstruct_curpos.shape[0];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_output, &__pyx_bstruct_output, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_output = __pyx_bstruct_output.strides[0]; __pyx_bstride_1_output = __pyx_bstruct_output.strides[1];
__pyx_bshape_0_output = __pyx_bstruct_output.shape[0]; __pyx_bshape_1_output = __pyx_bstruct_output.shape[1];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_genealogy, &__pyx_bstruct_genealogy, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_v_genealogy, &__pyx_bstruct_genealogy, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_genealogy = __pyx_bstruct_genealogy.strides[0]; __pyx_bstride_1_genealogy = __pyx_bstruct_genealogy.strides[1];
__pyx_bshape_0_genealogy = __pyx_bstruct_genealogy.shape[0]; __pyx_bshape_1_genealogy = __pyx_bstruct_genealogy.shape[1];
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_corners, &__pyx_bstruct_corners, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_corners, &__pyx_bstruct_corners, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_bstride_0_corners = __pyx_bstruct_corners.strides[0]; __pyx_bstride_1_corners = __pyx_bstruct_corners.strides[1];
__pyx_bshape_0_corners = __pyx_bstruct_corners.shape[0]; __pyx_bshape_1_corners = __pyx_bstruct_corners.shape[1];
@@ -1606,7 +1985,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->child_indices, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = ((PyArrayObject *)__pyx_v_grid->child_indices);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_1, &__pyx_bstruct_child_indices, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0) == -1)) {
__pyx_v_child_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_child_indices.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_child_indices = __pyx_bstruct_child_indices.strides[0]; __pyx_bstride_1_child_indices = __pyx_bstruct_child_indices.strides[1]; __pyx_bstride_2_child_indices = __pyx_bstruct_child_indices.strides[2];
@@ -1625,7 +2004,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->dimensions, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = ((PyArrayObject *)__pyx_v_grid->dimensions);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t((PyObject*)__pyx_t_2, &__pyx_bstruct_dimensions, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
__pyx_v_dimensions = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_dimensions.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_dimensions = __pyx_bstruct_dimensions.strides[0];
@@ -1644,7 +2023,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->fields, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = ((PyArrayObject *)__pyx_v_grid->fields);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_3, &__pyx_bstruct_fields, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0) == -1)) {
__pyx_v_fields = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_fields.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_fields = __pyx_bstruct_fields.strides[0]; __pyx_bstride_1_fields = __pyx_bstruct_fields.strides[1]; __pyx_bstride_2_fields = __pyx_bstruct_fields.strides[2]; __pyx_bstride_3_fields = __pyx_bstruct_fields.strides[3];
@@ -1663,7 +2042,7 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = ((PyArrayObject *)__pyx_v_grid->left_edges);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_4, &__pyx_bstruct_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
__pyx_v_leftedges = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_bstruct_leftedges.buf = NULL;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
} else {__pyx_bstride_0_leftedges = __pyx_bstruct_leftedges.strides[0];
@@ -1690,7 +2069,7 @@
* cdef int cp
* for i_off in range(i_f): # <<<<<<<<<<<<<<
* i = i_off + i_i
- * cz = (leftedges[2] + k*dx)
+ * cx = (leftedges[0] + i*dx)
*/
for (__pyx_v_i_off = 0; __pyx_v_i_off < __pyx_v_i_f; __pyx_v_i_off+=1) {
@@ -1698,7 +2077,7 @@
* cdef int cp
* for i_off in range(i_f):
* i = i_off + i_i # <<<<<<<<<<<<<<
- * cz = (leftedges[2] + k*dx)
+ * cx = (leftedges[0] + i*dx)
* if i_f > 2: print k, cz
*/
__pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
@@ -1706,18 +2085,17 @@
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":134
* for i_off in range(i_f):
* i = i_off + i_i
- * cz = (leftedges[2] + k*dx) # <<<<<<<<<<<<<<
+ * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
* if i_f > 2: print k, cz
* for j_off in range(j_f):
*/
- __pyx_t_5 = 2;
+ __pyx_t_5 = 0;
if (__pyx_t_5 < 0) __pyx_t_5 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_5, __pyx_bstride_0_leftedges)));
- __pyx_v_cz = (__pyx_3 + (__pyx_v_k * __pyx_v_dx));
+ __pyx_v_cx = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_5, __pyx_bstride_0_leftedges)) + (__pyx_v_i * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":135
* i = i_off + i_i
- * cz = (leftedges[2] + k*dx)
+ * cx = (leftedges[0] + i*dx)
* if i_f > 2: print k, cz # <<<<<<<<<<<<<<
* for j_off in range(j_f):
* j = j_off + j_i
@@ -1733,12 +2111,12 @@
__pyx_5 = 0;
if (__Pyx_Print(((PyObject *)__pyx_6), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_6)); __pyx_6 = 0;
- goto __pyx_L7;
+ goto __pyx_L8;
}
- __pyx_L7:;
+ __pyx_L8:;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":136
- * cz = (leftedges[2] + k*dx)
+ * cx = (leftedges[0] + i*dx)
* if i_f > 2: print k, cz
* for j_off in range(j_f): # <<<<<<<<<<<<<<
* j = j_off + j_i
@@ -1764,15 +2142,14 @@
*/
__pyx_t_6 = 1;
if (__pyx_t_6 < 0) __pyx_t_6 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_6, __pyx_bstride_0_leftedges)));
- __pyx_v_cy = (__pyx_3 + (__pyx_v_j * __pyx_v_dx));
+ __pyx_v_cy = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_6, __pyx_bstride_0_leftedges)) + (__pyx_v_j * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":139
* j = j_off + j_i
* cy = (leftedges[1] + j*dx)
* for k_off in range(k_f): # <<<<<<<<<<<<<<
* k = k_off + k_i
- * cp = curpos[level]
+ * cz = (leftedges[2] + k*dx)
*/
for (__pyx_v_k_off = 0; __pyx_v_k_off < __pyx_v_k_f; __pyx_v_k_off+=1) {
@@ -1780,38 +2157,36 @@
* cy = (leftedges[1] + j*dx)
* for k_off in range(k_f):
* k = k_off + k_i # <<<<<<<<<<<<<<
+ * cz = (leftedges[2] + k*dx)
* cp = curpos[level]
- * cx = (leftedges[0] + i*dx)
*/
__pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":141
* for k_off in range(k_f):
* k = k_off + k_i
- * cp = curpos[level] # <<<<<<<<<<<<<<
- * cx = (leftedges[0] + i*dx)
+ * cz = (leftedges[2] + k*dx) # <<<<<<<<<<<<<<
+ * cp = curpos[level]
* corners[cp, 0] = cx
*/
- __pyx_t_7 = __pyx_v_level;
- if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_curpos;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_7, __pyx_bstride_0_curpos)));
- __pyx_v_cp = __pyx_7;
+ __pyx_t_7 = 2;
+ if (__pyx_t_7 < 0) __pyx_t_7 += __pyx_bshape_0_leftedges;
+ __pyx_v_cz = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_leftedges.buf, __pyx_t_7, __pyx_bstride_0_leftedges)) + (__pyx_v_k * __pyx_v_dx));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":142
* k = k_off + k_i
- * cp = curpos[level]
- * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
+ * cz = (leftedges[2] + k*dx)
+ * cp = curpos[level] # <<<<<<<<<<<<<<
* corners[cp, 0] = cx
* corners[cp, 1] = cy
*/
- __pyx_t_8 = 0;
- if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_leftedges.buf, __pyx_t_8, __pyx_bstride_0_leftedges)));
- __pyx_v_cx = (__pyx_3 + (__pyx_v_i * __pyx_v_dx));
+ __pyx_t_8 = __pyx_v_level;
+ if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_curpos;
+ __pyx_v_cp = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_8, __pyx_bstride_0_curpos));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":143
+ * cz = (leftedges[2] + k*dx)
* cp = curpos[level]
- * cx = (leftedges[0] + i*dx)
* corners[cp, 0] = cx # <<<<<<<<<<<<<<
* corners[cp, 1] = cy
* corners[cp, 2] = cz
@@ -1820,10 +2195,10 @@
__pyx_t_10 = 0;
if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_0_corners;
if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_1_corners;
- *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_corners.buf, __pyx_t_9, __pyx_bstride_0_corners, __pyx_t_10, __pyx_bstride_1_corners)) = __pyx_v_cx;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_corners.buf, __pyx_t_9, __pyx_bstride_0_corners, __pyx_t_10, __pyx_bstride_1_corners) = __pyx_v_cx;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":144
- * cx = (leftedges[0] + i*dx)
+ * cp = curpos[level]
* corners[cp, 0] = cx
* corners[cp, 1] = cy # <<<<<<<<<<<<<<
* corners[cp, 2] = cz
@@ -1833,7 +2208,7 @@
__pyx_t_12 = 1;
if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_bshape_0_corners;
if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_1_corners;
- *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_corners.buf, __pyx_t_11, __pyx_bstride_0_corners, __pyx_t_12, __pyx_bstride_1_corners)) = __pyx_v_cy;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_corners.buf, __pyx_t_11, __pyx_bstride_0_corners, __pyx_t_12, __pyx_bstride_1_corners) = __pyx_v_cy;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":145
* corners[cp, 0] = cx
@@ -1846,7 +2221,7 @@
__pyx_t_14 = 2;
if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_0_corners;
if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_1_corners;
- *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_corners.buf, __pyx_t_13, __pyx_bstride_0_corners, __pyx_t_14, __pyx_bstride_1_corners)) = __pyx_v_cz;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_corners.buf, __pyx_t_13, __pyx_bstride_0_corners, __pyx_t_14, __pyx_bstride_1_corners) = __pyx_v_cz;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":146
* corners[cp, 1] = cy
@@ -1857,12 +2232,11 @@
*/
__pyx_t_15 = __pyx_v_level;
if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_curpos;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_15, __pyx_bstride_0_curpos)));
- __pyx_t_16 = __pyx_7;
+ __pyx_t_16 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_15, __pyx_bstride_0_curpos));
__pyx_t_17 = 2;
if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_genealogy;
if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_1_genealogy;
- *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_genealogy.buf, __pyx_t_16, __pyx_bstride_0_genealogy, __pyx_t_17, __pyx_bstride_1_genealogy)) = __pyx_v_level;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_genealogy.buf, __pyx_t_16, __pyx_bstride_0_genealogy, __pyx_t_17, __pyx_bstride_1_genealogy) = __pyx_v_level;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":148
* genealogy[curpos[level], 2] = level
@@ -1871,8 +2245,8 @@
* output[cp,fi] = fields[fi,i,j,k]
* ci = child_indices[i,j,k]
*/
- __pyx_8 = (__pyx_v_fields->dimensions[0]);
- for (__pyx_v_fi = 0; __pyx_v_fi < __pyx_8; __pyx_v_fi+=1) {
+ __pyx_7 = (__pyx_v_fields->dimensions[0]);
+ for (__pyx_v_fi = 0; __pyx_v_fi < __pyx_7; __pyx_v_fi+=1) {
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":149
* # always output data
@@ -1889,12 +2263,11 @@
if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_bshape_1_fields;
if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_2_fields;
if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_3_fields;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided4d(__pyx_bstruct_fields.buf, __pyx_t_18, __pyx_bstride_0_fields, __pyx_t_19, __pyx_bstride_1_fields, __pyx_t_20, __pyx_bstride_2_fields, __pyx_t_21, __pyx_bstride_3_fields)));
__pyx_t_22 = __pyx_v_cp;
__pyx_t_23 = __pyx_v_fi;
if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_0_output;
if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_1_output;
- *((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_output.buf, __pyx_t_22, __pyx_bstride_0_output, __pyx_t_23, __pyx_bstride_1_output)) = __pyx_3;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_output.buf, __pyx_t_22, __pyx_bstride_0_output, __pyx_t_23, __pyx_bstride_1_output) = (*__Pyx_BufPtrStrided4d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_fields.buf, __pyx_t_18, __pyx_bstride_0_fields, __pyx_t_19, __pyx_bstride_1_fields, __pyx_t_20, __pyx_bstride_2_fields, __pyx_t_21, __pyx_bstride_3_fields));
}
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":150
@@ -1910,8 +2283,7 @@
if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_child_indices;
if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_1_child_indices;
if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_2_child_indices;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided3d(__pyx_bstruct_child_indices.buf, __pyx_t_24, __pyx_bstride_0_child_indices, __pyx_t_25, __pyx_bstride_1_child_indices, __pyx_t_26, __pyx_bstride_2_child_indices)));
- __pyx_v_ci = __pyx_7;
+ __pyx_v_ci = (*__Pyx_BufPtrStrided3d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_child_indices.buf, __pyx_t_24, __pyx_bstride_0_child_indices, __pyx_t_25, __pyx_bstride_1_child_indices, __pyx_t_26, __pyx_bstride_2_child_indices));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":151
* output[cp,fi] = fields[fi,i,j,k]
@@ -1958,12 +2330,12 @@
*/
if (!(__Pyx_TypeTest(__pyx_v_child_grid->left_edges, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_27 = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __pyx_t_28 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_27, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __pyx_t_28 = __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_t_27, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0);
if (unlikely(__pyx_t_28 < 0))
{
PyErr_Fetch(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31);
- if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1) == -1)) {
+ if (unlikely(__Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0) == -1)) {
Py_XDECREF(__pyx_t_29); Py_XDECREF(__pyx_t_30); Py_XDECREF(__pyx_t_31);
__Pyx_RaiseBufferFallbackError();
} else {
@@ -1987,16 +2359,15 @@
*/
__pyx_t_32 = 0;
if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_32, __pyx_bstride_0_child_leftedges)));
- __pyx_6 = PyFloat_FromDouble(((__pyx_v_cx - __pyx_3) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble(((__pyx_v_cx - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_32, __pyx_bstride_0_child_leftedges))) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
__pyx_6 = 0;
- __pyx_5 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- __pyx_9 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_8 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_v_child_i = __pyx_9;
+ __pyx_v_child_i = __pyx_8;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":156
* child_leftedges = child_grid.left_edges
@@ -2007,16 +2378,15 @@
*/
__pyx_t_33 = 1;
if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_33, __pyx_bstride_0_child_leftedges)));
- __pyx_6 = PyFloat_FromDouble(((__pyx_v_cy - __pyx_3) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble(((__pyx_v_cy - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_33, __pyx_bstride_0_child_leftedges))) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
__pyx_6 = 0;
- __pyx_5 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- __pyx_9 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_8 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_v_child_j = __pyx_9;
+ __pyx_v_child_j = __pyx_8;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":157
* child_i = int((cx-child_leftedges[0])/child_dx)
@@ -2027,16 +2397,15 @@
*/
__pyx_t_34 = 2;
if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_bshape_0_child_leftedges;
- __pyx_3 = *((__pyx_t_5numpy_float64_t *)((__pyx_t_5numpy_float64_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_child_leftedges.buf, __pyx_t_34, __pyx_bstride_0_child_leftedges)));
- __pyx_6 = PyFloat_FromDouble(((__pyx_v_cz - __pyx_3) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyFloat_FromDouble(((__pyx_v_cz - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_child_leftedges.buf, __pyx_t_34, __pyx_bstride_0_child_leftedges))) / __pyx_v_child_dx)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
__pyx_6 = 0;
- __pyx_5 = PyObject_Call(((PyObject*)&PyInt_Type), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- __pyx_9 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_8 = __pyx_PyInt_int(__pyx_5); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_v_child_k = __pyx_9;
+ __pyx_v_child_k = __pyx_8;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":159
* child_k = int((cz-child_leftedges[2])/child_dx)
@@ -2047,12 +2416,11 @@
*/
__pyx_t_35 = (__pyx_v_level + 1);
if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_bshape_0_curpos;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_35, __pyx_bstride_0_curpos)));
__pyx_t_28 = __pyx_v_cp;
__pyx_t_36 = 0;
if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_0_genealogy;
if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_bshape_1_genealogy;
- *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided2d(__pyx_bstruct_genealogy.buf, __pyx_t_28, __pyx_bstride_0_genealogy, __pyx_t_36, __pyx_bstride_1_genealogy)) = __pyx_7;
+ *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_genealogy.buf, __pyx_t_28, __pyx_bstride_0_genealogy, __pyx_t_36, __pyx_bstride_1_genealogy) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_35, __pyx_bstride_0_curpos));
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":161
* genealogy[cp, 0] = curpos[level+1]
@@ -2064,20 +2432,18 @@
__pyx_6 = PyInt_FromLong(__pyx_v_cp); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_37 = (__pyx_v_level + 1);
if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_bshape_0_curpos;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_37, __pyx_bstride_0_curpos)));
- __pyx_2 = PyInt_FromLong(__pyx_7); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyInt_FromLong((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_37, __pyx_bstride_0_curpos))); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_38 = (__pyx_v_level + 1);
if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_bshape_0_curpos;
- __pyx_7 = *((__pyx_t_5numpy_int32_t *)((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_38, __pyx_bstride_0_curpos)));
- __pyx_5 = PyInt_FromLong((__pyx_7 + 8)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_10 = PySlice_New(__pyx_2, __pyx_5, Py_None); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = PyInt_FromLong(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_38, __pyx_bstride_0_curpos)) + 8)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_9 = PySlice_New(__pyx_2, __pyx_5, Py_None); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_10);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_9);
Py_INCREF(__pyx_int_1);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_int_1);
- __pyx_10 = 0;
+ __pyx_9 = 0;
if (PyObject_SetItem(((PyObject *)__pyx_v_genealogy), ((PyObject *)__pyx_2), __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
@@ -2089,8 +2455,8 @@
* curpos, ci, output, genealogy,
* corners, grids)
*/
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_18); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_10 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_24); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_9 = PyInt_FromLong(__pyx_v_child_i); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_6 = PyInt_FromLong(__pyx_v_child_j); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_2 = PyInt_FromLong(__pyx_v_child_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -2101,7 +2467,7 @@
* corners, grids)
* curpos[level] += 1
*/
- __pyx_11 = PyInt_FromLong(__pyx_v_ci); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_10 = PyInt_FromLong(__pyx_v_ci); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":164
* s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
@@ -2110,40 +2476,40 @@
* curpos[level] += 1
* return s
*/
- __pyx_12 = PyTuple_New(12); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_12, 0, __pyx_10);
- PyTuple_SET_ITEM(__pyx_12, 1, __pyx_6);
- PyTuple_SET_ITEM(__pyx_12, 2, __pyx_2);
+ __pyx_11 = PyTuple_New(12); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_11, 0, __pyx_9);
+ PyTuple_SET_ITEM(__pyx_11, 1, __pyx_6);
+ PyTuple_SET_ITEM(__pyx_11, 2, __pyx_2);
Py_INCREF(__pyx_int_2);
- PyTuple_SET_ITEM(__pyx_12, 3, __pyx_int_2);
+ PyTuple_SET_ITEM(__pyx_11, 3, __pyx_int_2);
Py_INCREF(__pyx_int_2);
- PyTuple_SET_ITEM(__pyx_12, 4, __pyx_int_2);
+ PyTuple_SET_ITEM(__pyx_11, 4, __pyx_int_2);
Py_INCREF(__pyx_int_2);
- PyTuple_SET_ITEM(__pyx_12, 5, __pyx_int_2);
+ PyTuple_SET_ITEM(__pyx_11, 5, __pyx_int_2);
Py_INCREF(((PyObject *)__pyx_v_curpos));
- PyTuple_SET_ITEM(__pyx_12, 6, ((PyObject *)__pyx_v_curpos));
- PyTuple_SET_ITEM(__pyx_12, 7, __pyx_11);
+ PyTuple_SET_ITEM(__pyx_11, 6, ((PyObject *)__pyx_v_curpos));
+ PyTuple_SET_ITEM(__pyx_11, 7, __pyx_10);
Py_INCREF(((PyObject *)__pyx_v_output));
- PyTuple_SET_ITEM(__pyx_12, 8, ((PyObject *)__pyx_v_output));
+ PyTuple_SET_ITEM(__pyx_11, 8, ((PyObject *)__pyx_v_output));
Py_INCREF(((PyObject *)__pyx_v_genealogy));
- PyTuple_SET_ITEM(__pyx_12, 9, ((PyObject *)__pyx_v_genealogy));
+ PyTuple_SET_ITEM(__pyx_11, 9, ((PyObject *)__pyx_v_genealogy));
Py_INCREF(((PyObject *)__pyx_v_corners));
- PyTuple_SET_ITEM(__pyx_12, 10, ((PyObject *)__pyx_v_corners));
+ PyTuple_SET_ITEM(__pyx_11, 10, ((PyObject *)__pyx_v_corners));
Py_INCREF(((PyObject *)__pyx_v_grids));
- PyTuple_SET_ITEM(__pyx_12, 11, ((PyObject *)__pyx_v_grids));
- __pyx_10 = 0;
+ PyTuple_SET_ITEM(__pyx_11, 11, ((PyObject *)__pyx_v_grids));
+ __pyx_9 = 0;
__pyx_6 = 0;
__pyx_2 = 0;
- __pyx_11 = 0;
- __pyx_10 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_12), NULL); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_10 = 0;
+ __pyx_9 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_11), NULL); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(((PyObject *)__pyx_12)); __pyx_12 = 0;
+ Py_DECREF(((PyObject *)__pyx_11)); __pyx_11 = 0;
Py_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_10;
- __pyx_10 = 0;
- goto __pyx_L14;
+ __pyx_v_s = __pyx_9;
+ __pyx_9 = 0;
+ goto __pyx_L15;
}
- __pyx_L14:;
+ __pyx_L15:;
/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":165
* curpos, ci, output, genealogy,
@@ -2154,7 +2520,7 @@
*/
__pyx_t_39 = __pyx_v_level;
if (__pyx_t_39 < 0) __pyx_t_39 += __pyx_bshape_0_curpos;
- *((__pyx_t_5numpy_int32_t *)__Pyx_BufPtrStrided1d(__pyx_bstruct_curpos.buf, __pyx_t_39, __pyx_bstride_0_curpos)) += 1;
+ *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_curpos.buf, __pyx_t_39, __pyx_bstride_0_curpos) += 1;
}
}
}
@@ -2175,34 +2541,34 @@
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
+ Py_XDECREF(__pyx_9);
Py_XDECREF(__pyx_10);
Py_XDECREF(__pyx_11);
- Py_XDECREF(__pyx_12);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- PyErr_Fetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_curpos, &__pyx_bstruct_curpos);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_genealogy, &__pyx_bstruct_genealogy);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_corners, &__pyx_bstruct_corners);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
- PyErr_Restore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_curpos);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_genealogy);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_corners);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.RecurseOctreeByLevels");
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_leftedges, &__pyx_bstruct_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_curpos, &__pyx_bstruct_curpos);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_leftedges, &__pyx_bstruct_child_leftedges);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dimensions, &__pyx_bstruct_dimensions);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_child_indices, &__pyx_bstruct_child_indices);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_genealogy, &__pyx_bstruct_genealogy);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_corners, &__pyx_bstruct_corners);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_fields, &__pyx_bstruct_fields);
- __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_output, &__pyx_bstruct_output);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_curpos);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_leftedges);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dimensions);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_child_indices);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_genealogy);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_corners);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fields);
+ __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
__pyx_L2:;
Py_DECREF(__pyx_v_child_grid);
Py_XDECREF(__pyx_v_grid);
@@ -2215,99 +2581,270 @@
return __pyx_r;
}
-/* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":36
+/* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":50
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
* # This implementation of getbuffer is geared towards Cython
- * # requirements, and does not yet fullfill the PEP (specifically,
+ * # requirements, and does not yet fullfill the PEP.
*/
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_copy_shape;
+ int __pyx_v_i;
+ int __pyx_v_ndim;
int __pyx_v_t;
char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ PyObject *__pyx_v_stack;
+ int __pyx_v_hasfields;
+ PyObject *__pyx_v_iterator;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
+ int __pyx_4;
+ PyObject *__pyx_5 = 0;
+ PyObject *__pyx_6 = 0;
+ PyObject *__pyx_7 = 0;
+ Py_ssize_t __pyx_8 = 0;
+ PyObject *__pyx_t_1 = NULL;
+ if (__pyx_v_info == NULL) return 0;
+ __pyx_v_info->obj = Py_None; Py_INCREF(Py_None);
+ __pyx_v_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_iterator = Py_None; Py_INCREF(Py_None);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":56
+ * # of flags
+ * cdef int copy_shape, i, ndim
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":42
- * # so the flags are not even checked).
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":58
+ * ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
- * raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this")
- *
+ * copy_shape = 1
+ * else:
*/
__pyx_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
if (__pyx_1) {
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":43
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":59
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this") # <<<<<<<<<<<<<<
+ * copy_shape = 1 # <<<<<<<<<<<<<<
+ * else:
+ * copy_shape = 0
+ */
+ __pyx_v_copy_shape = 1;
+ goto __pyx_L5;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":61
+ * copy_shape = 1
+ * else:
+ * copy_shape = 0 # <<<<<<<<<<<<<<
*
- * info.buf = PyArray_DATA(self)
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_copy_shape = 0;
+ }
+ __pyx_L5:;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":63
+ * copy_shape = 0
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError("ndarray is not C contiguous")
*/
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":64
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError("ndarray is not C contiguous")
+ *
+ */
+ __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
+ }
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":65
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError("ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_INCREF(__pyx_kp_1);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_1);
- __pyx_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
__Pyx_Raise(__pyx_3, 0, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
}
- __pyx_L5:;
+ __pyx_L6:;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":67
+ * raise ValueError("ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError("ndarray is not Fortran contiguous")
+ */
+ __pyx_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":68
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError("ndarray is not Fortran contiguous")
+ *
+ */
+ __pyx_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
+ }
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":69
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError("ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_kp_2);
+ PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_2);
+ __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
+ __Pyx_Raise(__pyx_3, 0, 0);
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":45
- * raise RuntimeError("Py_intptr_t and Py_ssize_t differs in size, numpy.pxd does not support this")
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":71
+ * raise ValueError("ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
- * info.ndim = PyArray_NDIM(self)
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.ndim = ndim
+ * if copy_shape:
*/
__pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":46
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":72
*
* info.buf = PyArray_DATA(self)
- * info.ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if copy_shape:
+ * # Allocate new buffer for strides and shape info. This is allocated
*/
- __pyx_v_info->ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
+ __pyx_v_info->ndim = __pyx_v_ndim;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":47
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":73
* info.buf = PyArray_DATA(self)
- * info.ndim = PyArray_NDIM(self)
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.ndim = ndim
+ * if copy_shape: # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info. This is allocated
+ * # as one block, strides first.
+ */
+ __pyx_4 = __pyx_v_copy_shape;
+ if (__pyx_4) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":76
+ * # Allocate new buffer for strides and shape info. This is allocated
+ * # as one block, strides first.
+ * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":77
+ * # as one block, strides first.
+ * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
+ * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":78
+ * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
+ * info.shape = info.strides + ndim
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ */
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i+=1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":79
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":80
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
+ }
+ goto __pyx_L8;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":82
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
*/
- __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":48
- * info.ndim = PyArray_NDIM(self)
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":83
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
*/
- __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
+ }
+ __pyx_L8:;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":49
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":84
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self)
*/
__pyx_v_info->suboffsets = NULL;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":50
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":85
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
* info.readonly = not PyArray_ISWRITEABLE(self)
@@ -2315,251 +2852,987 @@
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":51
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":86
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
*
- * # Formats that are not tested and working in Cython are not
+ * cdef int t
*/
__pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":55
- * # Formats that are not tested and working in Cython are not
- * # made available from this pxd file yet.
- * cdef int t = PyArray_TYPE(self) # <<<<<<<<<<<<<<
- * cdef char* f = NULL
- * if t == NPY_BYTE: f = "b"
- */
- __pyx_v_t = PyArray_TYPE(((PyArrayObject *)__pyx_v_self));
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":56
- * # made available from this pxd file yet.
- * cdef int t = PyArray_TYPE(self)
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":89
+ *
+ * cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
+ * cdef dtype descr = self.descr
+ * cdef list stack
*/
__pyx_v_f = NULL;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":57
- * cdef int t = PyArray_TYPE(self)
- * cdef char* f = NULL
- * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- */
- switch (__pyx_v_t) {
- case NPY_BYTE:
- __pyx_v_f = __pyx_k_2;
- break;
- case NPY_UBYTE:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":58
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":90
+ * cdef int t
* cdef char* f = NULL
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- */
- __pyx_v_f = __pyx_k_3;
- break;
- case NPY_SHORT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":59
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- */
- __pyx_v_f = __pyx_k_4;
- break;
- case NPY_USHORT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":60
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- */
- __pyx_v_f = __pyx_k_5;
- break;
- case NPY_INT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":61
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- */
- __pyx_v_f = __pyx_k_6;
- break;
- case NPY_UINT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":62
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- */
- __pyx_v_f = __pyx_k_7;
- break;
- case NPY_LONG:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":63
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- */
- __pyx_v_f = __pyx_k_8;
- break;
- case NPY_ULONG:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":64
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- */
- __pyx_v_f = __pyx_k_9;
- break;
- case NPY_LONGLONG:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":65
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- */
- __pyx_v_f = __pyx_k_10;
- break;
- case NPY_ULONGLONG:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":66
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- */
- __pyx_v_f = __pyx_k_11;
- break;
- case NPY_FLOAT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":67
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- */
- __pyx_v_f = __pyx_k_12;
- break;
- case NPY_DOUBLE:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":68
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_OBJECT: f = "O"
- */
- __pyx_v_f = __pyx_k_13;
- break;
- case NPY_LONGDOUBLE:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":69
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
- * elif t == NPY_OBJECT: f = "O"
- *
- */
- __pyx_v_f = __pyx_k_14;
- break;
- case NPY_OBJECT:
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":70
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
- *
- * if f == NULL:
- */
- __pyx_v_f = __pyx_k_15;
- break;
- }
-
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":72
- * elif t == NPY_OBJECT: f = "O"
- *
- * if f == NULL: # <<<<<<<<<<<<<<
- * raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t)
- * info.format = f
+ * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
+ * cdef list stack
+ *
*/
- __pyx_1 = (__pyx_v_f == NULL);
- if (__pyx_1) {
+ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
+ __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":73
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":93
+ * cdef list stack
*
- * if f == NULL:
- * raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t) # <<<<<<<<<<<<<<
- * info.format = f
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
*
+ * # Ugly hack warning:
*/
- __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_3 = PyNumber_Remainder(__pyx_kp_16, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
- __pyx_3 = 0;
- __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":103
+ * # functions).
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
+ __pyx_1 = (!__pyx_v_hasfields);
+ if (__pyx_1) {
+ __pyx_1 = (!__pyx_v_copy_shape);
}
- __pyx_L6:;
+ if (__pyx_1) {
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":74
- * if f == NULL:
- * raise ValueError("only objects, int and float dtypes supported for ndarray buffer access so far (dtype is %d)" % t)
- * info.format = f # <<<<<<<<<<<<<<
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":105
+ * if not hasfields and not copy_shape:
+ * # do not call releasebuffer
+ * info.obj = None # <<<<<<<<<<<<<<
+ * else:
+ * # need to call releasebuffer
+ */
+ Py_INCREF(Py_None);
+ Py_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = Py_None;
+ goto __pyx_L11;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":108
+ * else:
+ * # need to call releasebuffer
+ * info.obj = self # <<<<<<<<<<<<<<
*
+ * if not hasfields:
+ */
+ Py_INCREF(__pyx_v_self);
+ Py_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = __pyx_v_self;
+ }
+ __pyx_L11:;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":110
+ * info.obj = self
*
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if t == NPY_BYTE: f = "b"
*/
- __pyx_v_info->format = __pyx_v_f;
+ __pyx_1 = (!__pyx_v_hasfields);
+ if (__pyx_1) {
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- Py_XDECREF(__pyx_2);
- Py_XDECREF(__pyx_3);
- __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
- __pyx_r = -1;
- __pyx_L0:;
- return __pyx_r;
-}
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":111
+ *
+ * if not hasfields:
+ * t = descr.type_num # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_v_t = __pyx_v_descr->type_num;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":112
+ * if not hasfields:
+ * t = descr.type_num
+ * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ */
+ switch (__pyx_v_t) {
+ case NPY_BYTE:
+ __pyx_v_f = __pyx_k_3;
+ break;
+ case NPY_UBYTE:
-static PyObject *__pyx_tp_new_2yt_5lagos_16DepthFirstOctree_position(PyTypeObject *t, PyObject *a, PyObject *k) {
- PyObject *o = (*t->tp_alloc)(t, 0);
- if (!o) return 0;
- if (__pyx_pf_2yt_5lagos_16DepthFirstOctree_8position___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
- Py_DECREF(o); o = 0;
- }
- return o;
-}
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":113
+ * t = descr.type_num
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ */
+ __pyx_v_f = __pyx_k_4;
+ break;
+ case NPY_SHORT:
-static void __pyx_tp_dealloc_2yt_5lagos_16DepthFirstOctree_position(PyObject *o) {
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":114
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ */
+ __pyx_v_f = __pyx_k_5;
+ break;
+ case NPY_USHORT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":115
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ */
+ __pyx_v_f = __pyx_k_6;
+ break;
+ case NPY_INT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":116
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ */
+ __pyx_v_f = __pyx_k_7;
+ break;
+ case NPY_UINT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":117
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ */
+ __pyx_v_f = __pyx_k_8;
+ break;
+ case NPY_LONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":118
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ */
+ __pyx_v_f = __pyx_k_9;
+ break;
+ case NPY_ULONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":119
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ */
+ __pyx_v_f = __pyx_k_10;
+ break;
+ case NPY_LONGLONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":120
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ */
+ __pyx_v_f = __pyx_k_11;
+ break;
+ case NPY_ULONGLONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":121
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ */
+ __pyx_v_f = __pyx_k_12;
+ break;
+ case NPY_FLOAT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":122
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ */
+ __pyx_v_f = __pyx_k_13;
+ break;
+ case NPY_DOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":123
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ */
+ __pyx_v_f = __pyx_k_14;
+ break;
+ case NPY_LONGDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":124
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ */
+ __pyx_v_f = __pyx_k_15;
+ break;
+ case NPY_CFLOAT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":125
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ */
+ __pyx_v_f = __pyx_k_16;
+ break;
+ case NPY_CDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":126
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O"
+ */
+ __pyx_v_f = __pyx_k_17;
+ break;
+ case NPY_CLONGDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":127
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ */
+ __pyx_v_f = __pyx_k_18;
+ break;
+ case NPY_OBJECT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":128
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ __pyx_v_f = __pyx_k_19;
+ break;
+ default:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":130
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * info.format = f
+ * return
+ */
+ __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(__pyx_kp_20, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_2, 0, 0);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":131
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":132
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>stdlib.malloc(255) # static size
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ goto __pyx_L12;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":134
+ * return
+ * else:
+ * info.format = <char*>stdlib.malloc(255) # static size # <<<<<<<<<<<<<<
+ * f = info.format
+ * stack = [iter(descr.fields.iteritems())]
+ */
+ __pyx_v_info->format = ((char *)malloc(255));
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":135
+ * else:
+ * info.format = <char*>stdlib.malloc(255) # static size
+ * f = info.format # <<<<<<<<<<<<<<
+ * stack = [iter(descr.fields.iteritems())]
+ *
+ */
+ __pyx_v_f = __pyx_v_info->format;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":136
+ * info.format = <char*>stdlib.malloc(255) # static size
+ * f = info.format
+ * stack = [iter(descr.fields.iteritems())] # <<<<<<<<<<<<<<
+ *
+ * while True:
+ */
+ __pyx_3 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_2 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_2, 0, __pyx_3);
+ __pyx_3 = 0;
+ Py_DECREF(((PyObject *)__pyx_v_stack));
+ __pyx_v_stack = __pyx_2;
+ __pyx_2 = 0;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":138
+ * stack = [iter(descr.fields.iteritems())]
+ *
+ * while True: # <<<<<<<<<<<<<<
+ * iterator = stack[-1]
+ * descr = None
+ */
+ while (1) {
+ __pyx_1 = 1;
+ if (!__pyx_1) break;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":139
+ *
+ * while True:
+ * iterator = stack[-1] # <<<<<<<<<<<<<<
+ * descr = None
+ * while descr is None:
+ */
+ __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_v_iterator);
+ __pyx_v_iterator = __pyx_3;
+ __pyx_3 = 0;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":140
+ * while True:
+ * iterator = stack[-1]
+ * descr = None # <<<<<<<<<<<<<<
+ * while descr is None:
+ * try:
+ */
+ Py_INCREF(Py_None);
+ Py_DECREF(((PyObject *)__pyx_v_descr));
+ __pyx_v_descr = ((PyArray_Descr *)Py_None);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":141
+ * iterator = stack[-1]
+ * descr = None
+ * while descr is None: # <<<<<<<<<<<<<<
+ * try:
+ * descr = iterator.next()[1][0]
+ */
+ while (1) {
+ __pyx_1 = (((PyObject *)__pyx_v_descr) == Py_None);
+ if (!__pyx_1) break;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":142
+ * descr = None
+ * while descr is None:
+ * try: # <<<<<<<<<<<<<<
+ * descr = iterator.next()[1][0]
+ * except StopIteration:
+ */
+ {
+ PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
+ __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
+ /*try:*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":143
+ * while descr is None:
+ * try:
+ * descr = iterator.next()[1][0] # <<<<<<<<<<<<<<
+ * except StopIteration:
+ * stack.pop()
+ */
+ __pyx_2 = PyObject_GetAttr(__pyx_v_iterator, __pyx_kp_next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+ __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = __Pyx_GetItemInt(__pyx_3, 1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
+ Py_DECREF(((PyObject *)__pyx_v_descr));
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_3);
+ __pyx_3 = 0;
+ }
+ Py_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
+ Py_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
+ Py_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
+ goto __pyx_L22_try;
+ __pyx_L17_error:;
+ Py_XDECREF(__pyx_2); __pyx_2 = 0;
+ Py_XDECREF(__pyx_3); __pyx_3 = 0;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":144
+ * try:
+ * descr = iterator.next()[1][0]
+ * except StopIteration: # <<<<<<<<<<<<<<
+ * stack.pop()
+ * if len(stack) > 0:
+ */
+ __pyx_4 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
+ if (__pyx_4) {
+ __Pyx_AddTraceback("numpy.__getbuffer__");
+ if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":145
+ * descr = iterator.next()[1][0]
+ * except StopIteration:
+ * stack.pop() # <<<<<<<<<<<<<<
+ * if len(stack) > 0:
+ * f[0] = 125 #"}"
+ */
+ __pyx_6 = PyObject_GetAttr(((PyObject *)__pyx_v_stack), __pyx_kp_pop); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
+ __pyx_7 = PyObject_Call(__pyx_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_7); __pyx_7 = 0;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":146
+ * except StopIteration:
+ * stack.pop()
+ * if len(stack) > 0: # <<<<<<<<<<<<<<
+ * f[0] = 125 #"}"
+ * f += 1
+ */
+ __pyx_8 = PyObject_Length(((PyObject *)__pyx_v_stack)); if (unlikely(__pyx_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
+ __pyx_1 = (__pyx_8 > 0);
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":147
+ * stack.pop()
+ * if len(stack) > 0:
+ * f[0] = 125 #"}" # <<<<<<<<<<<<<<
+ * f += 1
+ * iterator = stack[-1]
+ */
+ (__pyx_v_f[0]) = 125;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":148
+ * if len(stack) > 0:
+ * f[0] = 125 #"}"
+ * f += 1 # <<<<<<<<<<<<<<
+ * iterator = stack[-1]
+ * else:
+ */
+ __pyx_v_f += 1;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":149
+ * f[0] = 125 #"}"
+ * f += 1
+ * iterator = stack[-1] # <<<<<<<<<<<<<<
+ * else:
+ * f[0] = 0 # Terminate string!
+ */
+ __pyx_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_stack), -1, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
+ Py_DECREF(__pyx_v_iterator);
+ __pyx_v_iterator = __pyx_6;
+ __pyx_6 = 0;
+ goto __pyx_L23;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":151
+ * iterator = stack[-1]
+ * else:
+ * f[0] = 0 # Terminate string! # <<<<<<<<<<<<<<
+ * return
+ *
+ */
+ (__pyx_v_f[0]) = 0;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":152
+ * else:
+ * f[0] = 0 # Terminate string!
+ * return # <<<<<<<<<<<<<<
+ *
+ * hasfields = PyDataType_HASFIELDS(descr)
+ */
+ __pyx_r = 0;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ goto __pyx_L20_except_return;
+ }
+ __pyx_L23:;
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(__pyx_3); __pyx_3 = 0;
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ goto __pyx_L18_exception_handled;
+ }
+ __pyx_L19_except_error:;
+ Py_XDECREF(__pyx_save_exc_type);
+ Py_XDECREF(__pyx_save_exc_value);
+ Py_XDECREF(__pyx_save_exc_tb);
+ goto __pyx_L1_error;
+ __pyx_L20_except_return:;
+ __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
+ goto __pyx_L0;
+ __pyx_L18_exception_handled:;
+ __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
+ __pyx_L22_try:;
+ }
+ }
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":154
+ * return
+ *
+ * hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
+ * if not hasfields:
+ * t = descr.type_num
+ */
+ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":155
+ *
+ * hasfields = PyDataType_HASFIELDS(descr)
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if f - info.format > 240: # this should leave room for "T{" and "}" as well
+ */
+ __pyx_1 = (!__pyx_v_hasfields);
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":156
+ * hasfields = PyDataType_HASFIELDS(descr)
+ * if not hasfields:
+ * t = descr.type_num # <<<<<<<<<<<<<<
+ * if f - info.format > 240: # this should leave room for "T{" and "}" as well
+ * raise RuntimeError("Format string allocated too short.")
+ */
+ __pyx_v_t = __pyx_v_descr->type_num;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":157
+ * if not hasfields:
+ * t = descr.type_num
+ * if f - info.format > 240: # this should leave room for "T{" and "}" as well # <<<<<<<<<<<<<<
+ * raise RuntimeError("Format string allocated too short.")
+ *
+ */
+ __pyx_1 = ((__pyx_v_f - __pyx_v_info->format) > 240);
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":158
+ * t = descr.type_num
+ * if f - info.format > 240: # this should leave room for "T{" and "}" as well
+ * raise RuntimeError("Format string allocated too short.") # <<<<<<<<<<<<<<
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ */
+ __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_INCREF(__pyx_kp_21);
+ PyTuple_SET_ITEM(__pyx_7, 0, __pyx_kp_21);
+ __pyx_6 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_7)); __pyx_7 = 0;
+ __Pyx_Raise(__pyx_6, 0, 0);
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L25;
+ }
+ __pyx_L25:;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":161
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ */
+ switch (__pyx_v_t) {
+ case NPY_BYTE:
+ (__pyx_v_f[0]) = 98;
+ break;
+ case NPY_UBYTE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":162
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ */
+ (__pyx_v_f[0]) = 66;
+ break;
+ case NPY_SHORT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":163
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ */
+ (__pyx_v_f[0]) = 104;
+ break;
+ case NPY_USHORT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":164
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ */
+ (__pyx_v_f[0]) = 72;
+ break;
+ case NPY_INT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":165
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ */
+ (__pyx_v_f[0]) = 105;
+ break;
+ case NPY_UINT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":166
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ */
+ (__pyx_v_f[0]) = 73;
+ break;
+ case NPY_LONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":167
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ */
+ (__pyx_v_f[0]) = 108;
+ break;
+ case NPY_ULONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":168
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ */
+ (__pyx_v_f[0]) = 76;
+ break;
+ case NPY_LONGLONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":169
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ */
+ (__pyx_v_f[0]) = 113;
+ break;
+ case NPY_ULONGLONG:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":170
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ */
+ (__pyx_v_f[0]) = 81;
+ break;
+ case NPY_FLOAT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":171
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ */
+ (__pyx_v_f[0]) = 102;
+ break;
+ case NPY_DOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":172
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1
+ */
+ (__pyx_v_f[0]) = 100;
+ break;
+ case NPY_LONGDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":173
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1
+ */
+ (__pyx_v_f[0]) = 103;
+ break;
+ case NPY_CFLOAT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":174
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
+ */
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 102;
+ __pyx_v_f += 1;
+ break;
+ case NPY_CDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":175
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ */
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 100;
+ __pyx_v_f += 1;
+ break;
+ case NPY_CLONGDOUBLE:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":176
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ */
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 103;
+ __pyx_v_f += 1;
+ break;
+ case NPY_OBJECT:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":177
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1
+ * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ (__pyx_v_f[0]) = 79;
+ break;
+ default:
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":179
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * f += 1
+ * else:
+ */
+ __pyx_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(__pyx_kp_22, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_3, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
+ __Pyx_Raise(__pyx_5, 0, 0);
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ break;
+ }
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":180
+ * else:
+ * raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * f[0] = 84 #"T"
+ */
+ __pyx_v_f += 1;
+ goto __pyx_L24;
+ }
+ /*else*/ {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":182
+ * f += 1
+ * else:
+ * f[0] = 84 #"T" # <<<<<<<<<<<<<<
+ * f[1] = 123 #"{"
+ * f += 2
+ */
+ (__pyx_v_f[0]) = 84;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":183
+ * else:
+ * f[0] = 84 #"T"
+ * f[1] = 123 #"{" # <<<<<<<<<<<<<<
+ * f += 2
+ * stack.append(iter(descr.fields.iteritems()))
+ */
+ (__pyx_v_f[1]) = 123;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":184
+ * f[0] = 84 #"T"
+ * f[1] = 123 #"{"
+ * f += 2 # <<<<<<<<<<<<<<
+ * stack.append(iter(descr.fields.iteritems()))
+ *
+ */
+ __pyx_v_f += 2;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":185
+ * f[1] = 123 #"{"
+ * f += 2
+ * stack.append(iter(descr.fields.iteritems())) # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ __pyx_7 = PyObject_GetAttr(__pyx_v_descr->fields, __pyx_kp_iteritems); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_6 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_7); __pyx_7 = 0;
+ __pyx_2 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ __pyx_4 = PyList_Append(((PyObject *)__pyx_v_stack), __pyx_2); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ }
+ __pyx_L24:;
+ }
+ }
+ __pyx_L12:;
+
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ Py_XDECREF(__pyx_2);
+ Py_XDECREF(__pyx_3);
+ Py_XDECREF(__pyx_5);
+ Py_XDECREF(__pyx_6);
+ Py_XDECREF(__pyx_7);
+ __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
+ __pyx_r = -1;
+ Py_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) { Py_DECREF(Py_None); __pyx_v_info->obj = NULL; }
+ __pyx_L2:;
+ Py_XDECREF(__pyx_v_descr);
+ Py_DECREF(__pyx_v_stack);
+ Py_DECREF(__pyx_v_iterator);
+ return __pyx_r;
+}
+
+/* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":187
+ * stack.append(iter(descr.fields.iteritems()))
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format)
+ */
+
+static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ int __pyx_1;
+ int __pyx_2;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":188
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
+ if (__pyx_1) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":189
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides)
+ */
+ free(__pyx_v_info->format);
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":190
+ * if PyArray_HASFIELDS(self):
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * stdlib.free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ __pyx_2 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
+ if (__pyx_2) {
+
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":191
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * stdlib.free(info.strides) # <<<<<<<<<<<<<<
+ * # info.shape was stored after info.strides in the same block
+ *
+ */
+ free(__pyx_v_info->strides);
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+}
+
+static PyObject *__pyx_tp_new_2yt_5lagos_16DepthFirstOctree_position(PyTypeObject *t, PyObject *a, PyObject *k) {
+ PyObject *o = (*t->tp_alloc)(t, 0);
+ if (!o) return 0;
+ if (__pyx_pf_2yt_5lagos_16DepthFirstOctree_8position___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
+ Py_DECREF(o); o = 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_2yt_5lagos_16DepthFirstOctree_position(PyObject *o) {
(*Py_TYPE(o)->tp_free)(o);
}
@@ -2659,10 +3932,10 @@
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
@@ -2687,7 +3960,7 @@
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_position, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
0, /*tp_doc*/
0, /*tp_traverse*/
0, /*tp_clear*/
@@ -2883,10 +4156,10 @@
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
@@ -2911,7 +4184,7 @@
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_OctreeGrid, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_2yt_5lagos_16DepthFirstOctree_OctreeGrid, /*tp_traverse*/
__pyx_tp_clear_2yt_5lagos_16DepthFirstOctree_OctreeGrid, /*tp_clear*/
@@ -3078,10 +4351,10 @@
#if PY_MAJOR_VERSION < 3
0, /*bf_getcharbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_getbuffer*/
#endif
- #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+ #if PY_VERSION_HEX >= 0x02060000
0, /*bf_releasebuffer*/
#endif
};
@@ -3106,7 +4379,7 @@
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_OctreeGridList, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_2yt_5lagos_16DepthFirstOctree_OctreeGridList, /*tp_traverse*/
__pyx_tp_clear_2yt_5lagos_16DepthFirstOctree_OctreeGridList, /*tp_clear*/
@@ -3157,22 +4430,53 @@
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp___cinit__, __pyx_k___cinit__, sizeof(__pyx_k___cinit__), 0, 1, 1},
- {&__pyx_kp___getitem__, __pyx_k___getitem__, sizeof(__pyx_k___getitem__), 0, 1, 1},
+ {&__pyx_kp___cinit__, __pyx_k___cinit__, sizeof(__pyx_k___cinit__), 1, 1, 1},
+ {&__pyx_kp___getitem__, __pyx_k___getitem__, sizeof(__pyx_k___getitem__), 1, 1, 1},
+ {&__pyx_kp_child_indices, __pyx_k_child_indices, sizeof(__pyx_k_child_indices), 1, 1, 1},
+ {&__pyx_kp_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 1, 1, 1},
+ {&__pyx_kp_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 1, 1, 1},
+ {&__pyx_kp_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 1, 1, 1},
+ {&__pyx_kp_dx, __pyx_k_dx, sizeof(__pyx_k_dx), 1, 1, 1},
+ {&__pyx_kp_level, __pyx_k_level, sizeof(__pyx_k_level), 1, 1, 1},
+ {&__pyx_kp_grids, __pyx_k_grids, sizeof(__pyx_k_grids), 1, 1, 1},
+ {&__pyx_kp_item, __pyx_k_item, sizeof(__pyx_k_item), 1, 1, 1},
+ {&__pyx_kp_i_i, __pyx_k_i_i, sizeof(__pyx_k_i_i), 1, 1, 1},
+ {&__pyx_kp_j_i, __pyx_k_j_i, sizeof(__pyx_k_j_i), 1, 1, 1},
+ {&__pyx_kp_k_i, __pyx_k_k_i, sizeof(__pyx_k_k_i), 1, 1, 1},
+ {&__pyx_kp_i_f, __pyx_k_i_f, sizeof(__pyx_k_i_f), 1, 1, 1},
+ {&__pyx_kp_j_f, __pyx_k_j_f, sizeof(__pyx_k_j_f), 1, 1, 1},
+ {&__pyx_kp_k_f, __pyx_k_k_f, sizeof(__pyx_k_k_f), 1, 1, 1},
+ {&__pyx_kp_curpos, __pyx_k_curpos, sizeof(__pyx_k_curpos), 1, 1, 1},
+ {&__pyx_kp_gi, __pyx_k_gi, sizeof(__pyx_k_gi), 1, 1, 1},
+ {&__pyx_kp_output, __pyx_k_output, sizeof(__pyx_k_output), 1, 1, 1},
+ {&__pyx_kp_refined, __pyx_k_refined, sizeof(__pyx_k_refined), 1, 1, 1},
+ {&__pyx_kp_genealogy, __pyx_k_genealogy, sizeof(__pyx_k_genealogy), 1, 1, 1},
+ {&__pyx_kp_corners, __pyx_k_corners, sizeof(__pyx_k_corners), 1, 1, 1},
{&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
{&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1},
- {&__pyx_kp_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 1},
- {&__pyx_kp_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 1},
- {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 0, 1, 1},
- {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
+ {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 1, 1, 1},
+ {&__pyx_kp_24, __pyx_k_24, sizeof(__pyx_k_24), 1, 1, 1},
+ {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1},
+ {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1},
+ {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1},
+ {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1},
{&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
+ {&__pyx_kp_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 1, 1, 1},
+ {&__pyx_kp_next, __pyx_k_next, sizeof(__pyx_k_next), 1, 1, 1},
+ {&__pyx_kp_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 1, 1, 1},
+ {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1},
+ {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
{&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0},
- {&__pyx_kp_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 0},
+ {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0},
+ {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0},
+ {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0},
+ {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0},
{0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_kp_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
@@ -3197,7 +4501,7 @@
{
PyObject *__pyx_1 = 0;
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Libary function declarations ---*/
+ /*--- Library function declarations ---*/
__pyx_init_filenames();
/*--- Initialize various global constants etc. ---*/
if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -3230,7 +4534,8 @@
if (PyObject_SetAttrString(__pyx_m, "OctreeGridList", (PyObject *)&__pyx_type_2yt_5lagos_16DepthFirstOctree_OctreeGridList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGridList = &__pyx_type_2yt_5lagos_16DepthFirstOctree_OctreeGridList;
/*--- Type import code ---*/
- __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/*--- Function import code ---*/
/*--- Execution code ---*/
@@ -3245,12 +4550,11 @@
if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.9.8.1.1-py2.5-macosx-10.3-ppc.egg/Cython/Includes/numpy.pxd":36
- * # experimental exception made for __getbuffer__ and __releasebuffer__
- * # -- the details of this may change.
- * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
- * # This implementation of getbuffer is geared towards Cython
- * # requirements, and does not yet fullfill the PEP (specifically,
+ /* "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Cython-0.10.3-py2.5-macosx-10.3-ppc.egg/Cython/Includes/stdlib.pxd":2
+ *
+ * cdef extern from "stdlib.h": # <<<<<<<<<<<<<<
+ * ctypedef unsigned long size_t
+ * void free(void *ptr)
*/
#if PY_MAJOR_VERSION < 3
return;
@@ -3276,14 +4580,174 @@
__pyx_f = __pyx_filenames;
}
-static INLINE void __Pyx_SafeReleaseBuffer(PyObject* obj, Py_buffer* info) {
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *number, *more_or_less;
+
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ number = (num_expected == 1) ? "" : "s";
+ PyErr_Format(PyExc_TypeError,
+ #if PY_VERSION_HEX < 0x02050000
+ "%s() takes %s %d positional argument%s (%d given)",
+ #else
+ "%s() takes %s %zd positional argument%s (%zd given)",
+ #endif
+ func_name, more_or_less, num_expected, number, num_found);
+}
+
+static INLINE int __Pyx_CheckKeywordStrings(
+ PyObject *kwdict,
+ const char* function_name,
+ int kw_allowed)
+{
+ PyObject* key = 0;
+ Py_ssize_t pos = 0;
+ while (PyDict_Next(kwdict, &pos, &key, 0)) {
+ #if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
+ #else
+ if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
+ #endif
+ goto invalid_keyword_type;
+ }
+ if ((!kw_allowed) && unlikely(key))
+ goto invalid_keyword;
+ return 1;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%s() keywords must be strings", function_name);
+ return 0;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%s() got an unexpected keyword argument '%s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+ return 0;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AS_STRING(kw_name));
+ #endif
+}
+
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ #if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
+ #else
+ if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
+ #endif
+ goto invalid_keyword_type;
+ } else {
+ name = argnames;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ if (name < first_kw_arg) goto arg_passed_twice;
+ values[name-argnames] = value;
+ } else {
+ for (name = first_kw_arg; *name; name++) {
+ #if PY_MAJOR_VERSION >= 3
+ if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+ PyUnicode_Compare(**name, key) == 0) break;
+ #else
+ if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+ strcmp(PyString_AS_STRING(**name),
+ PyString_AS_STRING(key)) == 0) break;
+ #endif
+ }
+ if (*name) {
+ values[name-argnames] = value;
+ } else {
+ /* unexpected keyword found */
+ for (name=argnames; name != first_kw_arg; name++) {
+ if (**name == key) goto arg_passed_twice;
+ #if PY_MAJOR_VERSION >= 3
+ if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+ PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
+ #else
+ if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+ strcmp(PyString_AS_STRING(**name),
+ PyString_AS_STRING(key)) == 0) goto arg_passed_twice;
+ #endif
+ }
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, **name);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%s() got an unexpected keyword argument '%s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+static INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
if (info->buf == NULL) return;
if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
- __Pyx_ReleaseBuffer(obj, info);
+ __Pyx_ReleaseBuffer(info);
}
static INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
buf->buf = NULL;
+ buf->obj = NULL;
buf->strides = __Pyx_zeros;
buf->shape = __Pyx_zeros;
buf->suboffsets = __Pyx_minusones;
@@ -3292,66 +4756,79 @@
static INLINE const char* __Pyx_ConsumeWhitespace(const char* ts) {
while (1) {
switch (*ts) {
+ case '@':
case 10:
case 13:
case ' ':
++ts;
+ break;
+ case '=':
+ case '<':
+ case '>':
+ case '!':
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition error: Only native byte order, size and alignment supported.");
+ return NULL;
default:
return ts;
}
}
}
-static INLINE const char* __Pyx_BufferTypestringCheckEndian(const char* ts) {
- int num = 1;
- int little_endian = ((char*)&num)[0];
- int ok = 1;
- switch (*ts) {
- case '@':
- case '=':
- ++ts; break;
- case '<':
- if (little_endian) ++ts;
- else ok = 0;
- break;
- case '>':
- case '!':
- if (!little_endian) ++ts;
- else ok = 0;
- break;
- }
- if (!ok) {
- PyErr_Format(PyExc_ValueError, "Buffer has wrong endianness (rejecting on '%s')", ts);
- return NULL;
- }
- return ts;
-}
-
static void __Pyx_BufferNdimError(Py_buffer* buffer, int expected_ndim) {
PyErr_Format(PyExc_ValueError,
"Buffer has wrong number of dimensions (expected %d, got %d)",
expected_ndim, buffer->ndim);
}
-
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_t(const char* ts) {
- int ok;
- if (*ts == '1') ++ts;
+static const char* __Pyx_DescribeTokenInFormatString(const char* ts) {
switch (*ts) {
- case 'b': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(char) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
- case 'h': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(short) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
- case 'i': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(int) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
- case 'l': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
- case 'q': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long long) && (__pyx_t_5numpy_int32_t)-1 < 0); break; default: ok = 0;
+ case 'b': return "char";
+ case 'B': return "unsigned char";
+ case 'h': return "short";
+ case 'H': return "unsigned short";
+ case 'i': return "int";
+ case 'I': return "unsigned int";
+ case 'l': return "long";
+ case 'L': return "unsigned long";
+ case 'q': return "long long";
+ case 'Q': return "unsigned long long";
+ case 'f': return "float";
+ case 'd': return "double";
+ case 'g': return "long double";
+ case 'Z': switch (*(ts+1)) {
+ case 'f': return "complex float";
+ case 'd': return "complex double";
+ case 'g': return "complex long double";
+ default: return "unparseable format string";
+ }
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ default: return "unparseable format string";
}
- if (!ok) {
- PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (rejecting on '%s')", ts);
- return NULL;
- } else return ts + 1;
-
}
-static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
+static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(const char* ts) {
+ int ok;
+ ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
+ if (*ts == '1') ++ts;
+ switch (*ts) {
+ case 'b': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(char) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+ case 'h': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(short) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+ case 'i': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(int) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+ case 'l': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+ case 'q': ok = (sizeof(__pyx_t_5numpy_int32_t) == sizeof(long long) && (__pyx_t_5numpy_int32_t)-1 < 0); break;
+ default: ok = 0;
+ }
+ if (!(ok)) {
+ PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.int32_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
+ return NULL;
+ }
+ ++ts;
+ return ts;
+ }
+
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_int32_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
const char* ts;
if (obj == Py_None) {
__Pyx_ZeroBuffer(buf);
@@ -3363,41 +4840,51 @@
__Pyx_BufferNdimError(buf, nd);
goto fail;
}
- ts = buf->format;
- ts = __Pyx_ConsumeWhitespace(ts);
- ts = __Pyx_BufferTypestringCheckEndian(ts);
- if (!ts) goto fail;
- ts = __Pyx_ConsumeWhitespace(ts);
- ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_int32_t(ts);
- if (!ts) goto fail;
- ts = __Pyx_ConsumeWhitespace(ts);
- if (*ts != 0) {
- PyErr_Format(PyExc_ValueError,
- "Expected non-struct buffer data type (expected end, got '%s')", ts);
- goto fail;
+ if (!cast) {
+ ts = buf->format;
+ ts = __Pyx_ConsumeWhitespace(ts);
+ if (!ts) goto fail;
+ ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_int32_t(ts);
+ if (!ts) goto fail;
+ ts = __Pyx_ConsumeWhitespace(ts);
+ if (!ts) goto fail;
+ if (*ts != 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch (expected end, got %s)",
+ __Pyx_DescribeTokenInFormatString(ts));
+ goto fail;
+ }
+ } else {
+ if (buf->itemsize != sizeof(__pyx_t_5numpy_int32_t)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Attempted cast of buffer to datatype of different size.");
+ goto fail;
+ }
}
if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
return 0;
fail:;
__Pyx_ZeroBuffer(buf);
return -1;
-}
-static const char* __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(const char* ts) {
- int ok;
- if (*ts == '1') ++ts;
- switch (*ts) {
- case 'f': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(float) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
- case 'd': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
- case 'g': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(long double) && (__pyx_t_5numpy_float64_t)-1 < 0); break; default: ok = 0;
- }
- if (!ok) {
- PyErr_Format(PyExc_ValueError, "Buffer datatype mismatch (rejecting on '%s')", ts);
+}static const char* __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(const char* ts) {
+ int ok;
+ ts = __Pyx_ConsumeWhitespace(ts); if (!ts) return NULL;
+ if (*ts == '1') ++ts;
+ switch (*ts) {
+ case 'f': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(float) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
+ case 'd': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
+ case 'g': ok = (sizeof(__pyx_t_5numpy_float64_t) == sizeof(long double) && (__pyx_t_5numpy_float64_t)-1 < 0); break;
+ default: ok = 0;
+ }
+ if (!(ok)) {
+ PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch (expected numpy.float64_t, got %s)", __Pyx_DescribeTokenInFormatString(ts));
return NULL;
- } else return ts + 1;
+ }
+ ++ts;
+ return ts;
+ }
-}
-
-static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd) {
+static int __Pyx_GetBuffer_nn___pyx_t_5numpy_float64_t(PyObject* obj, Py_buffer* buf, int flags, int nd, int cast) {
const char* ts;
if (obj == Py_None) {
__Pyx_ZeroBuffer(buf);
@@ -3409,18 +4896,26 @@
__Pyx_BufferNdimError(buf, nd);
goto fail;
}
- ts = buf->format;
- ts = __Pyx_ConsumeWhitespace(ts);
- ts = __Pyx_BufferTypestringCheckEndian(ts);
- if (!ts) goto fail;
- ts = __Pyx_ConsumeWhitespace(ts);
- ts = __Pyx_BufferTypestringCheck_item_nn___pyx_t_5numpy_float64_t(ts);
- if (!ts) goto fail;
- ts = __Pyx_ConsumeWhitespace(ts);
- if (*ts != 0) {
- PyErr_Format(PyExc_ValueError,
- "Expected non-struct buffer data type (expected end, got '%s')", ts);
- goto fail;
+ if (!cast) {
+ ts = buf->format;
+ ts = __Pyx_ConsumeWhitespace(ts);
+ if (!ts) goto fail;
+ ts = __Pyx_CheckTypestring_nn___pyx_t_5numpy_float64_t(ts);
+ if (!ts) goto fail;
+ ts = __Pyx_ConsumeWhitespace(ts);
+ if (!ts) goto fail;
+ if (*ts != 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch (expected end, got %s)",
+ __Pyx_DescribeTokenInFormatString(ts));
+ goto fail;
+ }
+ } else {
+ if (buf->itemsize != sizeof(__pyx_t_5numpy_float64_t)) {
+ PyErr_SetString(PyExc_ValueError,
+ "Attempted cast of buffer to datatype of different size.");
+ goto fail;
+ }
}
if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
return 0;
@@ -3428,58 +4923,43 @@
__Pyx_ZeroBuffer(buf);
return -1;
}
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+
+
+
static void __Pyx_RaiseBufferFallbackError(void) {
PyErr_Format(PyExc_ValueError,
"Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}
-static INLINE void __Pyx_RaiseArgtupleTooLong(
- Py_ssize_t num_expected,
- Py_ssize_t num_found)
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
{
- const char* error_message =
- #if PY_VERSION_HEX < 0x02050000
- "function takes at most %d positional arguments (%d given)";
- #else
- "function takes at most %zd positional arguments (%zd given)";
- #endif
- PyErr_Format(PyExc_TypeError, error_message, num_expected, num_found);
-}
-
-static int __Pyx_CheckKeywordStrings(
- PyObject *kwdict,
- const char* function_name,
- int kw_allowed)
-{
- PyObject* key = 0;
- Py_ssize_t pos = 0;
- while (PyDict_Next(kwdict, &pos, &key, 0)) {
- #if PY_MAJOR_VERSION < 3
- if (unlikely(!PyString_Check(key))) {
- #else
- if (unlikely(!PyUnicode_Check(key))) {
- #endif
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- return 0;
- }
- }
- if (unlikely(!kw_allowed) && unlikely(key)) {
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "'%s' is an invalid keyword argument for this function",
- PyString_AsString(key));
- #else
- "'%U' is an invalid keyword argument for this function",
- key);
- #endif
- return 0;
- }
- return 1;
-}
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact) {
if (!type) {
PyErr_Format(PyExc_SystemError, "Missing type object");
return 0;
@@ -3497,8 +4977,12 @@
return 0;
}
-#if (PY_MAJOR_VERSION < 3) && !(Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_NEWBUFFER)
+#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
+ #if PY_VERSION_HEX >= 0x02060000
+ if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_HAVE_NEWBUFFER)
+ return PyObject_GetBuffer(obj, view, flags);
+ #endif
if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags);
else {
PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
@@ -3506,8 +4990,13 @@
}
}
-static void __Pyx_ReleaseBuffer(PyObject *obj, Py_buffer *view) {
-
+static void __Pyx_ReleaseBuffer(Py_buffer *view) {
+ PyObject* obj = view->obj;
+ if (obj) {
+if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray___releasebuffer__(obj, view);
+ Py_DECREF(obj);
+ view->obj = NULL;
+ }
}
#endif
@@ -3545,7 +5034,6 @@
return module;
}
-
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (!type) {
PyErr_Format(PyExc_SystemError, "Missing type object");
@@ -3641,6 +5129,30 @@
}
#endif
+static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
+ PyThreadState *tstate = PyThreadState_GET();
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+
+static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
@@ -3696,7 +5208,7 @@
}
#endif
}
- PyErr_Restore(type, value, tb);
+ __Pyx_ErrRestore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
@@ -3705,27 +5217,60 @@
return;
}
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyThreadState *tstate = PyThreadState_GET();
+ __Pyx_ErrFetch(type, value, tb);
+ PyErr_NormalizeException(type, value, tb);
+ if (PyErr_Occurred())
+ goto bad;
+ Py_INCREF(*type);
+ Py_INCREF(*value);
+ Py_INCREF(*tb);
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ /* Make sure tstate is in a consistent state when we XDECREF
+ these objects (XDECREF may run arbitrary code). */
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+ return 0;
+bad:
+ Py_XDECREF(*type);
+ Py_XDECREF(*value);
+ Py_XDECREF(*tb);
+ return -1;
+}
+
+
#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
long size)
{
PyObject *py_module = 0;
PyObject *result = 0;
PyObject *py_name = 0;
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
#if PY_MAJOR_VERSION < 3
- py_name = PyString_FromString(module_name);
+ py_name = PyString_FromString(class_name);
#else
- py_name = PyUnicode_FromString(module_name);
+ py_name = PyUnicode_FromString(class_name);
#endif
if (!py_name)
goto bad;
-
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- result = PyObject_GetAttrString(py_module, class_name);
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
if (!result)
goto bad;
if (!PyType_Check(result)) {
@@ -3742,7 +5287,7 @@
}
return (PyTypeObject *)result;
bad:
- Py_XDECREF(py_name);
+ Py_XDECREF(py_module);
Py_XDECREF(result);
return 0;
}
@@ -3750,7 +5295,7 @@
#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(char *name) {
+static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
PyObject *py_module = 0;
@@ -3832,7 +5377,7 @@
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
- PyThreadState_Get(), /*PyThreadState *tstate,*/
+ PyThreadState_GET(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
Modified: trunk/yt/lagos/DepthFirstOctree.pyx
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.pyx (original)
+++ trunk/yt/lagos/DepthFirstOctree.pyx Tue Feb 10 14:12:34 2009
@@ -131,15 +131,15 @@
cdef int cp
for i_off in range(i_f):
i = i_off + i_i
- cz = (leftedges[2] + k*dx)
+ cx = (leftedges[0] + i*dx)
if i_f > 2: print k, cz
for j_off in range(j_f):
j = j_off + j_i
cy = (leftedges[1] + j*dx)
for k_off in range(k_f):
k = k_off + k_i
+ cz = (leftedges[2] + k*dx)
cp = curpos[level]
- cx = (leftedges[0] + i*dx)
corners[cp, 0] = cx
corners[cp, 1] = cy
corners[cp, 2] = cz
Modified: trunk/yt/lagos/HierarchyType.py
==============================================================================
--- trunk/yt/lagos/HierarchyType.py (original)
+++ trunk/yt/lagos/HierarchyType.py Tue Feb 10 14:12:34 2009
@@ -517,7 +517,7 @@
ff.astype("float64"),
g.LeftEdge.astype('float64'),
g.ActiveDimensions.astype('int32'),
- na.ones(1,dtype='float64') * g.dx, g.Level))
+ na.ones(1,dtype='float64') * g.dds[0], g.Level))
levels_all[g.Level] += g.ActiveDimensions.prod()
levels_finest[g.Level] += g.child_mask.ravel().sum()
g.clear_data()
More information about the yt-svn
mailing list