[Yt-svn] yt-commit r877 - trunk/yt/lagos
mturk at wrangler.dreamhost.com
mturk at wrangler.dreamhost.com
Wed Nov 5 09:40:43 PST 2008
Author: mturk
Date: Wed Nov 5 09:40:43 2008
New Revision: 877
URL: http://yt.spacepope.org/changeset/877
Log:
Changed ordering of grid traversal from k,j,i to i,j,k
Modified:
trunk/yt/lagos/DepthFirstOctree.c
trunk/yt/lagos/DepthFirstOctree.pyx
Modified: trunk/yt/lagos/DepthFirstOctree.c
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.c (original)
+++ trunk/yt/lagos/DepthFirstOctree.c Wed Nov 5 09:40:43 2008
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Thu Oct 23 12:37:16 2008 */
+/* Generated by Cython 0.9.8.1.1 on Wed Nov 5 09:40:16 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -290,12 +290,28 @@
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":30
+ * cimport cython
+ *
+ * cdef class position: # <<<<<<<<<<<<<<
+ * cdef public int output_pos, refined_pos
+ * def __cinit__(self):
+ */
+
struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position {
PyObject_HEAD
int output_pos;
int refined_pos;
};
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":36
+ * self.refined_pos = 0
+ *
+ * cdef class OctreeGrid: # <<<<<<<<<<<<<<
+ * cdef public object child_indices, fields, left_edges, dimensions, dx
+ * cdef public int level
+ */
+
struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid {
PyObject_HEAD
PyObject *child_indices;
@@ -306,6 +322,14 @@
int level;
};
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":53
+ * self.level = level
+ *
+ * cdef class OctreeGridList: # <<<<<<<<<<<<<<
+ * cdef public object grids
+ * def __cinit__(self, grids):
+ */
+
struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList {
PyObject_HEAD
PyObject *grids;
@@ -366,6 +390,14 @@
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)";
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":32
+ * cdef class position:
+ * cdef public int output_pos, refined_pos
+ * def __cinit__(self): # <<<<<<<<<<<<<<
+ * self.output_pos = 0
+ * self.refined_pos = 0
+ */
+
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_8position___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_8position___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
@@ -376,13 +408,37 @@
if (unlikely(__pyx_kwds)) {
if (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
+ * def __cinit__(self):
+ * self.output_pos = 0 # <<<<<<<<<<<<<<
+ * self.refined_pos = 0
+ *
+ */
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position *)__pyx_v_self)->output_pos = 0;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":34
+ * def __cinit__(self):
+ * self.output_pos = 0
+ * self.refined_pos = 0 # <<<<<<<<<<<<<<
+ *
+ * cdef class OctreeGrid:
+ */
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_position *)__pyx_v_self)->refined_pos = 0;
__pyx_r = 0;
return __pyx_r;
}
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":39
+ * cdef public object child_indices, fields, left_edges, dimensions, dx
+ * cdef public int level
+ * def __cinit__(self, # <<<<<<<<<<<<<<
+ * np.ndarray[np.int32_t, ndim=3] child_indices,
+ * np.ndarray[np.float64_t, ndim=4] fields,
+ */
+
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_10OctreeGrid___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_10OctreeGrid___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_child_indices = 0;
@@ -454,21 +510,69 @@
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;}
__pyx_bstride_0_dx = __pyx_bstruct_dx.strides[0];
__pyx_bshape_0_dx = __pyx_bstruct_dx.shape[0];
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":46
+ * np.ndarray[np.float64_t, ndim=1] dx,
+ * int level):
+ * self.child_indices = child_indices # <<<<<<<<<<<<<<
+ * self.fields = fields
+ * self.left_edges = left_edges
+ */
Py_INCREF(((PyObject *)__pyx_v_child_indices));
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->child_indices);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->child_indices = ((PyObject *)__pyx_v_child_indices);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":47
+ * int level):
+ * self.child_indices = child_indices
+ * self.fields = fields # <<<<<<<<<<<<<<
+ * self.left_edges = left_edges
+ * self.dimensions = dimensions
+ */
Py_INCREF(((PyObject *)__pyx_v_fields));
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->fields);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->fields = ((PyObject *)__pyx_v_fields);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":48
+ * self.child_indices = child_indices
+ * self.fields = fields
+ * self.left_edges = left_edges # <<<<<<<<<<<<<<
+ * self.dimensions = dimensions
+ * self.dx = dx
+ */
Py_INCREF(((PyObject *)__pyx_v_left_edges));
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->left_edges);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->left_edges = ((PyObject *)__pyx_v_left_edges);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":49
+ * self.fields = fields
+ * self.left_edges = left_edges
+ * self.dimensions = dimensions # <<<<<<<<<<<<<<
+ * self.dx = dx
+ * self.level = level
+ */
Py_INCREF(((PyObject *)__pyx_v_dimensions));
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dimensions);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dimensions = ((PyObject *)__pyx_v_dimensions);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":50
+ * self.left_edges = left_edges
+ * self.dimensions = dimensions
+ * self.dx = dx # <<<<<<<<<<<<<<
+ * self.level = level
+ *
+ */
Py_INCREF(((PyObject *)__pyx_v_dx));
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dx);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->dx = ((PyObject *)__pyx_v_dx);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":51
+ * self.dimensions = dimensions
+ * self.dx = dx
+ * self.level = level # <<<<<<<<<<<<<<
+ *
+ * cdef class OctreeGridList:
+ */
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_v_self)->level = __pyx_v_level;
__pyx_r = 0;
@@ -495,6 +599,14 @@
return __pyx_r;
}
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":55
+ * cdef class OctreeGridList:
+ * cdef public object grids
+ * def __cinit__(self, grids): # <<<<<<<<<<<<<<
+ * self.grids = grids
+ *
+ */
+
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_grids = 0;
@@ -511,6 +623,14 @@
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__cinit__");
return -1;
__pyx_L4:;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":56
+ * cdef public object grids
+ * def __cinit__(self, grids):
+ * self.grids = grids # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, int item):
+ */
Py_INCREF(__pyx_v_grids);
Py_DECREF(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids);
((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids = __pyx_v_grids;
@@ -519,6 +639,14 @@
return __pyx_r;
}
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":58
+ * self.grids = grids
+ *
+ * def __getitem__(self, int item): # <<<<<<<<<<<<<<
+ * return self.grids[item]
+ *
+ */
+
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item); /*proto*/
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_14OctreeGridList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_item) {
int __pyx_v_item;
@@ -532,6 +660,14 @@
__Pyx_AddTraceback("yt.lagos.DepthFirstOctree.OctreeGridList.__getitem__");
return NULL;
__pyx_L4:;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":59
+ *
+ * def __getitem__(self, int item):
+ * return self.grids[item] # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
__pyx_1 = __Pyx_GetItemInt(((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGridList *)__pyx_v_self)->grids, __pyx_v_item, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
@@ -547,6 +683,14 @@
return __pyx_r;
}
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":62
+ *
+ * @cython.boundscheck(False)
+ * def RecurseOctreeDepthFirst(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
+ * int i_f, int j_f, int k_f,
+ * position curpos, int gi,
+ */
+
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctreeDepthFirst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctreeDepthFirst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_i_i;
@@ -693,11 +837,27 @@
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;}
__pyx_bstride_0_refined = __pyx_bstruct_refined.strides[0];
__pyx_bshape_0_refined = __pyx_bstruct_refined.shape[0];
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":71
+ * cdef int child_i, child_j, child_k
+ * cdef OctreeGrid child_grid
+ * cdef OctreeGrid grid = grids[gi-1] # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ */
__pyx_1 = (__pyx_v_gi - 1);
__pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
__pyx_2 = 0;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":72
+ * cdef OctreeGrid child_grid
+ * cdef OctreeGrid grid = grids[gi-1]
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ */
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)) {
@@ -709,6 +869,14 @@
__pyx_t_1 = 0;
Py_INCREF(__pyx_v_grid->child_indices);
__pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":73
+ * cdef OctreeGrid grid = grids[gi-1]
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ */
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)) {
@@ -720,6 +888,14 @@
__pyx_t_2 = 0;
Py_INCREF(__pyx_v_grid->dimensions);
__pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":74
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ * cdef np.float64_t dx = grid.dx[0]
+ */
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)) {
@@ -731,6 +907,14 @@
__pyx_t_3 = 0;
Py_INCREF(__pyx_v_grid->fields);
__pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":75
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges # <<<<<<<<<<<<<<
+ * cdef np.float64_t dx = grid.dx[0]
+ * cdef np.float64_t child_dx
+ */
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)) {
@@ -742,28 +926,116 @@
__pyx_t_4 = 0;
Py_INCREF(__pyx_v_grid->left_edges);
__pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":76
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ * cdef np.float64_t dx = grid.dx[0] # <<<<<<<<<<<<<<
+ * cdef np.float64_t child_dx
+ * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ */
__pyx_2 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_3 = __pyx_PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_v_dx = __pyx_3;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":80
+ * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ * cdef np.float64_t cx, cy, cz
+ * for k_off in range(k_f): # <<<<<<<<<<<<<<
+ * k = k_off + k_i
+ * cz = (leftedges[2] + k*dx)
+ */
for (__pyx_v_k_off = 0; __pyx_v_k_off < __pyx_v_k_f; __pyx_v_k_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":81
+ * cdef np.float64_t cx, cy, cz
+ * for k_off in range(k_f):
+ * k = k_off + k_i # <<<<<<<<<<<<<<
+ * cz = (leftedges[2] + k*dx)
+ * for j_off in range(j_f):
+ */
__pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":82
+ * for k_off in range(k_f):
+ * k = k_off + k_i
+ * cz = (leftedges[2] + k*dx) # <<<<<<<<<<<<<<
+ * for j_off in range(j_f):
+ * j = j_off + j_i
+ */
__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));
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":83
+ * k = k_off + k_i
+ * cz = (leftedges[2] + k*dx)
+ * for j_off in range(j_f): # <<<<<<<<<<<<<<
+ * j = j_off + j_i
+ * cy = (leftedges[1] + j*dx)
+ */
for (__pyx_v_j_off = 0; __pyx_v_j_off < __pyx_v_j_f; __pyx_v_j_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":84
+ * cz = (leftedges[2] + k*dx)
+ * for j_off in range(j_f):
+ * j = j_off + j_i # <<<<<<<<<<<<<<
+ * cy = (leftedges[1] + j*dx)
+ * for i_off in range(i_f):
+ */
__pyx_v_j = (__pyx_v_j_off + __pyx_v_j_i);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":85
+ * for j_off in range(j_f):
+ * j = j_off + j_i
+ * cy = (leftedges[1] + j*dx) # <<<<<<<<<<<<<<
+ * for i_off in range(i_f):
+ * i = i_off + i_i
+ */
__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));
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":86
+ * j = j_off + j_i
+ * cy = (leftedges[1] + j*dx)
+ * for i_off in range(i_f): # <<<<<<<<<<<<<<
+ * i = i_off + i_i
+ * cx = (leftedges[0] + i*dx)
+ */
for (__pyx_v_i_off = 0; __pyx_v_i_off < __pyx_v_i_f; __pyx_v_i_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":87
+ * cy = (leftedges[1] + j*dx)
+ * for i_off in range(i_f):
+ * i = i_off + i_i # <<<<<<<<<<<<<<
+ * cx = (leftedges[0] + i*dx)
+ * ci = grid.child_indices[i,j,k]
+ */
__pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":88
+ * for i_off in range(i_f):
+ * i = i_off + i_i
+ * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
+ * ci = grid.child_indices[i,j,k]
+ * if ci == -1:
+ */
__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));
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":89
+ * i = i_off + i_i
+ * cx = (leftedges[0] + i*dx)
+ * ci = grid.child_indices[i,j,k] # <<<<<<<<<<<<<<
+ * if ci == -1:
+ * for fi in range(fields.shape[0]):
+ */
__pyx_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_5 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -779,10 +1051,34 @@
__pyx_7 = __pyx_PyInt_int(__pyx_2); if (unlikely((__pyx_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_v_ci = __pyx_7;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":90
+ * cx = (leftedges[0] + i*dx)
+ * ci = grid.child_indices[i,j,k]
+ * if ci == -1: # <<<<<<<<<<<<<<
+ * for fi in range(fields.shape[0]):
+ * output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ */
__pyx_8 = (__pyx_v_ci == -1);
if (__pyx_8) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":91
+ * ci = grid.child_indices[i,j,k]
+ * if ci == -1:
+ * for fi in range(fields.shape[0]): # <<<<<<<<<<<<<<
+ * output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ * refined[curpos.refined_pos] = 0
+ */
__pyx_9 = (__pyx_v_fields->dimensions[0]);
for (__pyx_v_fi = 0; __pyx_v_fi < __pyx_9; __pyx_v_fi+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":92
+ * if ci == -1:
+ * for fi in range(fields.shape[0]):
+ * output[curpos.output_pos,fi] = fields[fi,i,j,k] # <<<<<<<<<<<<<<
+ * refined[curpos.refined_pos] = 0
+ * curpos.output_pos += 1
+ */
__pyx_t_8 = __pyx_v_fi;
__pyx_t_9 = __pyx_v_i;
__pyx_t_10 = __pyx_v_j;
@@ -798,28 +1094,92 @@
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;
}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":93
+ * for fi in range(fields.shape[0]):
+ * output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ * refined[curpos.refined_pos] = 0 # <<<<<<<<<<<<<<
+ * curpos.output_pos += 1
+ * curpos.refined_pos += 1
+ */
__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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":94
+ * output[curpos.output_pos,fi] = fields[fi,i,j,k]
+ * refined[curpos.refined_pos] = 0
+ * curpos.output_pos += 1 # <<<<<<<<<<<<<<
+ * curpos.refined_pos += 1
+ * else:
+ */
__pyx_v_curpos->output_pos += 1;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":95
+ * refined[curpos.refined_pos] = 0
+ * curpos.output_pos += 1
+ * curpos.refined_pos += 1 # <<<<<<<<<<<<<<
+ * else:
+ * refined[curpos.refined_pos] = 1
+ */
__pyx_v_curpos->refined_pos += 1;
goto __pyx_L11;
}
/*else*/ {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":97
+ * curpos.refined_pos += 1
+ * else:
+ * refined[curpos.refined_pos] = 1 # <<<<<<<<<<<<<<
+ * curpos.refined_pos += 1
+ * child_grid = grids[ci-1]
+ */
__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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":98
+ * else:
+ * refined[curpos.refined_pos] = 1
+ * curpos.refined_pos += 1 # <<<<<<<<<<<<<<
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0]
+ */
__pyx_v_curpos->refined_pos += 1;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":99
+ * refined[curpos.refined_pos] = 1
+ * curpos.refined_pos += 1
+ * child_grid = grids[ci-1] # <<<<<<<<<<<<<<
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges
+ */
__pyx_1 = (__pyx_v_ci - 1);
__pyx_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (!(__Pyx_TypeTest(__pyx_4, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_v_child_grid));
__pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_4);
__pyx_4 = 0;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":100
+ * curpos.refined_pos += 1
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0] # <<<<<<<<<<<<<<
+ * child_leftedges = child_grid.left_edges
+ * child_i = int(cx - child_leftedges[0])/child_dx
+ */
__pyx_5 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_3 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_child_dx = __pyx_3;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":101
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges # <<<<<<<<<<<<<<
+ * child_i = int(cx - child_leftedges[0])/child_dx
+ * child_j = int(cy - child_leftedges[1])/child_dx
+ */
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);
@@ -841,6 +1201,14 @@
Py_INCREF(__pyx_v_child_grid->left_edges);
Py_DECREF(((PyObject *)__pyx_v_child_leftedges));
__pyx_v_child_leftedges = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":102
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges
+ * child_i = int(cx - child_leftedges[0])/child_dx # <<<<<<<<<<<<<<
+ * child_j = int(cy - child_leftedges[1])/child_dx
+ * child_k = int(cz - child_leftedges[2])/child_dx
+ */
__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)));
@@ -857,6 +1225,14 @@
__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_v_child_i = __pyx_7;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":103
+ * child_leftedges = child_grid.left_edges
+ * child_i = int(cx - child_leftedges[0])/child_dx
+ * child_j = int(cy - child_leftedges[1])/child_dx # <<<<<<<<<<<<<<
+ * child_k = int(cz - child_leftedges[2])/child_dx
+ * s = RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
+ */
__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)));
@@ -873,6 +1249,14 @@
__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_v_child_j = __pyx_7;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":104
+ * child_i = int(cx - child_leftedges[0])/child_dx
+ * child_j = int(cy - child_leftedges[1])/child_dx
+ * child_k = int(cz - child_leftedges[2])/child_dx # <<<<<<<<<<<<<<
+ * s = RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, refined, grids)
+ */
__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)));
@@ -889,10 +1273,26 @@
__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;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_v_child_k = __pyx_7;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":105
+ * child_j = int(cy - child_leftedges[1])/child_dx
+ * child_k = int(cz - child_leftedges[2])/child_dx
+ * s = RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2, # <<<<<<<<<<<<<<
+ * 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;}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":106
+ * child_k = int(cz - child_leftedges[2])/child_dx
+ * s = RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, refined, grids) # <<<<<<<<<<<<<<
+ * return s
+ *
+ */
__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);
@@ -928,6 +1328,14 @@
}
}
}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":107
+ * s = RecurseOctreeDepthFirst(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, refined, grids)
+ * return s # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
Py_INCREF(__pyx_v_s);
__pyx_r = __pyx_v_s;
goto __pyx_L0;
@@ -974,6 +1382,14 @@
return __pyx_r;
}
+/* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":110
+ *
+ * @cython.boundscheck(False)
+ * def RecurseOctreeByLevels(int i_i, int j_i, int k_i, # <<<<<<<<<<<<<<
+ * int i_f, int j_f, int k_f,
+ * np.ndarray[np.int32_t, ndim=1] curpos,
+ */
+
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctreeByLevels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_2yt_5lagos_16DepthFirstOctree_RecurseOctreeByLevels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_i_i;
@@ -1158,12 +1574,36 @@
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;}
__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];
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":121
+ * cdef int child_i, child_j, child_k
+ * cdef OctreeGrid child_grid
+ * cdef OctreeGrid grid = grids[gi-1] # <<<<<<<<<<<<<<
+ * cdef int level = grid.level
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ */
__pyx_1 = (__pyx_v_gi - 1);
__pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
__pyx_2 = 0;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":122
+ * cdef OctreeGrid child_grid
+ * cdef OctreeGrid grid = grids[gi-1]
+ * cdef int level = grid.level # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ */
__pyx_v_level = __pyx_v_grid->level;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":123
+ * cdef OctreeGrid grid = grids[gi-1]
+ * cdef int level = grid.level
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ */
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)) {
@@ -1175,6 +1615,14 @@
__pyx_t_1 = 0;
Py_INCREF(__pyx_v_grid->child_indices);
__pyx_v_child_indices = ((PyArrayObject *)__pyx_v_grid->child_indices);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":124
+ * cdef int level = grid.level
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ */
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)) {
@@ -1186,6 +1634,14 @@
__pyx_t_2 = 0;
Py_INCREF(__pyx_v_grid->dimensions);
__pyx_v_dimensions = ((PyArrayObject *)__pyx_v_grid->dimensions);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":125
+ * cdef np.ndarray[np.int32_t, ndim=3] child_indices = grid.child_indices
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields # <<<<<<<<<<<<<<
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ * cdef np.float64_t dx = grid.dx[0]
+ */
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)) {
@@ -1197,6 +1653,14 @@
__pyx_t_3 = 0;
Py_INCREF(__pyx_v_grid->fields);
__pyx_v_fields = ((PyArrayObject *)__pyx_v_grid->fields);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":126
+ * cdef np.ndarray[np.int32_t, ndim=1] dimensions = grid.dimensions
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges # <<<<<<<<<<<<<<
+ * cdef np.float64_t dx = grid.dx[0]
+ * cdef np.float64_t child_dx
+ */
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)) {
@@ -1208,16 +1672,56 @@
__pyx_t_4 = 0;
Py_INCREF(__pyx_v_grid->left_edges);
__pyx_v_leftedges = ((PyArrayObject *)__pyx_v_grid->left_edges);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":127
+ * cdef np.ndarray[np.float64_t, ndim=4] fields = grid.fields
+ * cdef np.ndarray[np.float64_t, ndim=1] leftedges = grid.left_edges
+ * cdef np.float64_t dx = grid.dx[0] # <<<<<<<<<<<<<<
+ * cdef np.float64_t child_dx
+ * cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
+ */
__pyx_2 = __Pyx_GetItemInt(__pyx_v_grid->dx, 0, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_3 = __pyx_PyFloat_AsDouble(__pyx_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_v_dx = __pyx_3;
- for (__pyx_v_k_off = 0; __pyx_v_k_off < __pyx_v_k_f; __pyx_v_k_off+=1) {
- __pyx_v_k = (__pyx_v_k_off + __pyx_v_k_i);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":132
+ * cdef np.float64_t cx, cy, cz
+ * cdef int cp
+ * for i_off in range(i_f): # <<<<<<<<<<<<<<
+ * i = i_off + i_i
+ * cz = (leftedges[2] + k*dx)
+ */
+ for (__pyx_v_i_off = 0; __pyx_v_i_off < __pyx_v_i_f; __pyx_v_i_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":133
+ * cdef int cp
+ * for i_off in range(i_f):
+ * i = i_off + i_i # <<<<<<<<<<<<<<
+ * cz = (leftedges[2] + k*dx)
+ * if i_f > 2: print k, cz
+ */
+ __pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
+
+ /* "/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) # <<<<<<<<<<<<<<
+ * if i_f > 2: print k, cz
+ * for j_off in range(j_f):
+ */
__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));
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":135
+ * i = i_off + i_i
+ * cz = (leftedges[2] + k*dx)
+ * if i_f > 2: print k, cz # <<<<<<<<<<<<<<
+ * for j_off in range(j_f):
+ * j = j_off + j_i
+ */
__pyx_4 = (__pyx_v_i_f > 2);
if (__pyx_4) {
__pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -1232,37 +1736,125 @@
goto __pyx_L7;
}
__pyx_L7:;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":136
+ * cz = (leftedges[2] + k*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 (__pyx_v_j_off = 0; __pyx_v_j_off < __pyx_v_j_f; __pyx_v_j_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":137
+ * 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):
+ */
__pyx_v_j = (__pyx_v_j_off + __pyx_v_j_i);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":138
+ * 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
+ */
__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));
- for (__pyx_v_i_off = 0; __pyx_v_i_off < __pyx_v_i_f; __pyx_v_i_off+=1) {
- __pyx_v_i = (__pyx_v_i_off + __pyx_v_i_i);
+
+ /* "/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]
+ */
+ for (__pyx_v_k_off = 0; __pyx_v_k_off < __pyx_v_k_f; __pyx_v_k_off+=1) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":140
+ * cy = (leftedges[1] + j*dx)
+ * for k_off in range(k_f):
+ * k = k_off + k_i # <<<<<<<<<<<<<<
+ * 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)
+ * 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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":142
+ * k = k_off + k_i
+ * cp = curpos[level]
+ * cx = (leftedges[0] + i*dx) # <<<<<<<<<<<<<<
+ * 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));
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":143
+ * cp = curpos[level]
+ * cx = (leftedges[0] + i*dx)
+ * corners[cp, 0] = cx # <<<<<<<<<<<<<<
+ * corners[cp, 1] = cy
+ * corners[cp, 2] = cz
+ */
__pyx_t_9 = __pyx_v_cp;
__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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":144
+ * cx = (leftedges[0] + i*dx)
+ * corners[cp, 0] = cx
+ * corners[cp, 1] = cy # <<<<<<<<<<<<<<
+ * corners[cp, 2] = cz
+ * genealogy[curpos[level], 2] = level
+ */
__pyx_t_11 = __pyx_v_cp;
__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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":145
+ * corners[cp, 0] = cx
+ * corners[cp, 1] = cy
+ * corners[cp, 2] = cz # <<<<<<<<<<<<<<
+ * genealogy[curpos[level], 2] = level
+ * # always output data
+ */
__pyx_t_13 = __pyx_v_cp;
__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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":146
+ * corners[cp, 1] = cy
+ * corners[cp, 2] = cz
+ * genealogy[curpos[level], 2] = level # <<<<<<<<<<<<<<
+ * # always output data
+ * for fi in range(fields.shape[0]):
+ */
__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)));
@@ -1271,8 +1863,24 @@
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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":148
+ * genealogy[curpos[level], 2] = level
+ * # always output data
+ * for fi in range(fields.shape[0]): # <<<<<<<<<<<<<<
+ * 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) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":149
+ * # always output data
+ * for fi in range(fields.shape[0]):
+ * output[cp,fi] = fields[fi,i,j,k] # <<<<<<<<<<<<<<
+ * ci = child_indices[i,j,k]
+ * if ci > -1:
+ */
__pyx_t_18 = __pyx_v_fi;
__pyx_t_19 = __pyx_v_i;
__pyx_t_20 = __pyx_v_j;
@@ -1288,6 +1896,14 @@
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;
}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":150
+ * for fi in range(fields.shape[0]):
+ * output[cp,fi] = fields[fi,i,j,k]
+ * ci = child_indices[i,j,k] # <<<<<<<<<<<<<<
+ * if ci > -1:
+ * child_grid = grids[ci-1]
+ */
__pyx_t_24 = __pyx_v_i;
__pyx_t_25 = __pyx_v_j;
__pyx_t_26 = __pyx_v_k;
@@ -1296,18 +1912,50 @@
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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":151
+ * output[cp,fi] = fields[fi,i,j,k]
+ * ci = child_indices[i,j,k]
+ * if ci > -1: # <<<<<<<<<<<<<<
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0]
+ */
__pyx_4 = (__pyx_v_ci > -1);
if (__pyx_4) {
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":152
+ * ci = child_indices[i,j,k]
+ * if ci > -1:
+ * child_grid = grids[ci-1] # <<<<<<<<<<<<<<
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges
+ */
__pyx_1 = (__pyx_v_ci - 1);
__pyx_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_grids), __pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_2yt_5lagos_16DepthFirstOctree_OctreeGrid))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(((PyObject *)__pyx_v_child_grid));
__pyx_v_child_grid = ((struct __pyx_obj_2yt_5lagos_16DepthFirstOctree_OctreeGrid *)__pyx_2);
__pyx_2 = 0;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":153
+ * if ci > -1:
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0] # <<<<<<<<<<<<<<
+ * child_leftedges = child_grid.left_edges
+ * child_i = int((cx-child_leftedges[0])/child_dx)
+ */
__pyx_5 = __Pyx_GetItemInt(__pyx_v_child_grid->dx, 0, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_3 = __pyx_PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_child_dx = __pyx_3;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":154
+ * child_grid = grids[ci-1]
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges # <<<<<<<<<<<<<<
+ * child_i = int((cx-child_leftedges[0])/child_dx)
+ * child_j = int((cy-child_leftedges[1])/child_dx)
+ */
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);
@@ -1329,6 +1977,14 @@
Py_INCREF(__pyx_v_child_grid->left_edges);
Py_DECREF(((PyObject *)__pyx_v_child_leftedges));
__pyx_v_child_leftedges = ((PyArrayObject *)__pyx_v_child_grid->left_edges);
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":155
+ * child_dx = child_grid.dx[0]
+ * child_leftedges = child_grid.left_edges
+ * child_i = int((cx-child_leftedges[0])/child_dx) # <<<<<<<<<<<<<<
+ * child_j = int((cy-child_leftedges[1])/child_dx)
+ * child_k = int((cz-child_leftedges[2])/child_dx)
+ */
__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)));
@@ -1341,6 +1997,14 @@
__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;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_child_i = __pyx_9;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":156
+ * child_leftedges = child_grid.left_edges
+ * child_i = int((cx-child_leftedges[0])/child_dx)
+ * child_j = int((cy-child_leftedges[1])/child_dx) # <<<<<<<<<<<<<<
+ * child_k = int((cz-child_leftedges[2])/child_dx)
+ * # set current child id to id of next cell to examine
+ */
__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)));
@@ -1353,6 +2017,14 @@
__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;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_child_j = __pyx_9;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":157
+ * child_i = int((cx-child_leftedges[0])/child_dx)
+ * child_j = int((cy-child_leftedges[1])/child_dx)
+ * child_k = int((cz-child_leftedges[2])/child_dx) # <<<<<<<<<<<<<<
+ * # set current child id to id of next cell to examine
+ * genealogy[cp, 0] = curpos[level+1]
+ */
__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)));
@@ -1365,6 +2037,14 @@
__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;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_child_k = __pyx_9;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":159
+ * child_k = int((cz-child_leftedges[2])/child_dx)
+ * # set current child id to id of next cell to examine
+ * genealogy[cp, 0] = curpos[level+1] # <<<<<<<<<<<<<<
+ * # set next parent id to id of current cell
+ * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
+ */
__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)));
@@ -1373,6 +2053,14 @@
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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":161
+ * genealogy[cp, 0] = curpos[level+1]
+ * # set next parent id to id of current cell
+ * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp # <<<<<<<<<<<<<<
+ * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, genealogy,
+ */
__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;
@@ -1393,11 +2081,35 @@
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;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":162
+ * # set next parent id to id of current cell
+ * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
+ * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2, # <<<<<<<<<<<<<<
+ * 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_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;}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":163
+ * genealogy[curpos[level+1]:curpos[level+1]+8, 1] = cp
+ * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, genealogy, # <<<<<<<<<<<<<<
+ * 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;}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":164
+ * s = RecurseOctreeByLevels(child_i, child_j, child_k, 2, 2, 2,
+ * curpos, ci, output, genealogy,
+ * corners, grids) # <<<<<<<<<<<<<<
+ * 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);
@@ -1432,12 +2144,27 @@
goto __pyx_L14;
}
__pyx_L14:;
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":165
+ * curpos, ci, output, genealogy,
+ * corners, grids)
+ * curpos[level] += 1 # <<<<<<<<<<<<<<
+ * return s
+ *
+ */
__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;
}
}
}
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":166
+ * corners, grids)
+ * curpos[level] += 1
+ * return s # <<<<<<<<<<<<<<
+ *
+ */
Py_INCREF(__pyx_v_s);
__pyx_r = __pyx_v_s;
goto __pyx_L0;
@@ -1488,6 +2215,14 @@
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
+ * # 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,
+ */
+
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_t;
@@ -1496,8 +2231,24 @@
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 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":42
+ * # so the flags are not even checked).
+ *
+ * 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")
+ *
+ */
__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
+ *
+ * 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") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
Py_INCREF(__pyx_kp_1);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_1);
@@ -1509,61 +2260,261 @@
goto __pyx_L5;
}
__pyx_L5:;
+
+ /* "/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")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = PyArray_NDIM(self)
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
__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
+ *
+ * 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)
+ */
__pyx_v_info->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":47
+ * 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.suboffsets = NULL
+ */
__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) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
__pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((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":49
+ * 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)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
__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
+ * 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
+ */
__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)
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
__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
+ * 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
+ */
__pyx_1 = (__pyx_v_f == NULL);
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":73
+ *
+ * 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
+ *
+ */
__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;
@@ -1578,6 +2529,14 @@
goto __pyx_L6;
}
__pyx_L6:;
+
+ /* "/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 # <<<<<<<<<<<<<<
+ *
+ *
+ */
__pyx_v_info->format = __pyx_v_f;
__pyx_r = 0;
@@ -2274,9 +3233,25 @@
__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;}
/*--- Function import code ---*/
/*--- Execution code ---*/
+
+ /* "/Users/matthewturk/Development/yt/trunk/yt/lagos/DepthFirstOctree.pyx":26
+ * """
+ *
+ * import numpy as np # <<<<<<<<<<<<<<
+ * cimport numpy as np
+ * cimport cython
+ */
__pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
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,
+ */
#if PY_MAJOR_VERSION < 3
return;
#else
Modified: trunk/yt/lagos/DepthFirstOctree.pyx
==============================================================================
--- trunk/yt/lagos/DepthFirstOctree.pyx (original)
+++ trunk/yt/lagos/DepthFirstOctree.pyx Wed Nov 5 09:40:43 2008
@@ -129,15 +129,15 @@
cdef np.ndarray[np.float64_t, ndim=1] child_leftedges
cdef np.float64_t cx, cy, cz
cdef int cp
- for k_off in range(k_f):
- k = k_off + k_i
+ for i_off in range(i_f):
+ i = i_off + i_i
cz = (leftedges[2] + k*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 i_off in range(i_f):
- i = i_off + i_i
+ for k_off in range(k_f):
+ k = k_off + k_i
cp = curpos[level]
cx = (leftedges[0] + i*dx)
corners[cp, 0] = cx
More information about the yt-svn
mailing list