[Scipy-svn] r4797 - branches/spatial/scipy/spatial

scipy-svn@scip... scipy-svn@scip...
Mon Oct 13 10:58:55 CDT 2008


Author: peridot
Date: 2008-10-13 10:58:54 -0500 (Mon, 13 Oct 2008)
New Revision: 4797

Modified:
   branches/spatial/scipy/spatial/ckdtree.c
   branches/spatial/scipy/spatial/ckdtree.pyx
Log:
Docstring fix and code to avoid freeing 0 if __init__ is never called.


Modified: branches/spatial/scipy/spatial/ckdtree.c
===================================================================
--- branches/spatial/scipy/spatial/ckdtree.c	2008-10-13 15:46:17 UTC (rev 4796)
+++ branches/spatial/scipy/spatial/ckdtree.c	2008-10-13 15:58:54 UTC (rev 4797)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.8.1.1 on Mon Oct 13 11:41:48 2008 */
+/* Generated by Cython 0.9.8.1.1 on Mon Oct 13 11:57:06 2008 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -217,12 +217,6 @@
 
 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
 
-static int __Pyx_Print(PyObject *, int); /*proto*/
-#if PY_MAJOR_VERSION >= 3
-static PyObject* __pyx_print = 0;
-static PyObject* __pyx_print_kwargs = 0;
-#endif
-
 static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
     PyObject *r;
     if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
@@ -427,19 +421,17 @@
 static PyObject *__pyx_kp_empty;
 static char __pyx_k_fill[] = "fill";
 static PyObject *__pyx_kp_fill;
-static char __pyx_k_23[] = "i";
-static PyObject *__pyx_kp_23;
+static char __pyx_k_22[] = "i";
+static PyObject *__pyx_kp_22;
 static PyObject *__pyx_builtin_ValueError;
 static PyObject *__pyx_kp_18;
 static char __pyx_k_18[] = "Heap containing %d items cannot be resized to %d";
 static PyObject *__pyx_kp_19;
 static char __pyx_k_19[] = "leafsize must be at least 1";
 static PyObject *__pyx_kp_20;
-static char __pyx_k_20[] = "freeing cKDTree";
 static PyObject *__pyx_kp_21;
-static PyObject *__pyx_kp_22;
-static char __pyx_k_21[] = "x must consist of vectors of length %d but has shape %s";
-static char __pyx_k_22[] = "Only p-norms with 1<=p<=infinity permitted";
+static char __pyx_k_20[] = "x must consist of vectors of length %d but has shape %s";
+static char __pyx_k_21[] = "Only p-norms with 1<=p<=infinity permitted";
 static char __pyx_k___getbuffer__[] = "__getbuffer__";
 static PyObject *__pyx_kp___getbuffer__;
 static char __pyx_k_RuntimeError[] = "RuntimeError";
@@ -1259,18 +1251,20 @@
 
 static void __pyx_pf_5scipy_7spatial_7ckdtree_7cKDTree___dealloc__(PyObject *__pyx_v_self); /*proto*/
 static void __pyx_pf_5scipy_7spatial_7ckdtree_7cKDTree___dealloc__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_1 = 0;
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_kp_20);
-  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_kp_20);
-  if (__Pyx_Print(((PyObject *)__pyx_1), 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  __pyx_1 = ((struct __pyx_vtabstruct_5scipy_7spatial_7ckdtree_cKDTree *)((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->__pyx_vtab)->__free_tree(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self), ((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->tree); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  __pyx_1 = (((int)((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->tree) == 0);
+  if (__pyx_1) {
+    goto __pyx_L0;
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+  __pyx_2 = ((struct __pyx_vtabstruct_5scipy_7spatial_7ckdtree_cKDTree *)((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->__pyx_vtab)->__free_tree(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self), ((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->tree); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
 
   goto __pyx_L0;
   __pyx_L1_error:;
-  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
   __Pyx_AddTraceback("scipy.spatial.ckdtree.cKDTree.__dealloc__");
   __pyx_L0:;
 }
@@ -1296,9 +1290,9 @@
   PyObject *__pyx_1 = 0;
   int __pyx_2;
   int __pyx_3;
-  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapcreate((&__pyx_v_q), 12); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapcreate((&__pyx_v_q), 12); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapcreate((&__pyx_v_neighbors), __pyx_v_k); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapcreate((&__pyx_v_neighbors), __pyx_v_k); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   __pyx_v_inf = ((struct __pyx_t_5scipy_7spatial_7ckdtree_nodeinfo *)malloc(((sizeof(struct __pyx_t_5scipy_7spatial_7ckdtree_nodeinfo)) + (__pyx_v_self->m * (sizeof(double))))));
   __pyx_v_inf->node = __pyx_v_self->tree;
@@ -1380,14 +1374,14 @@
         if (__pyx_3) {
           __pyx_3 = (__pyx_v_neighbors.n == __pyx_v_k);
           if (__pyx_3) {
-            __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapremove((&__pyx_v_neighbors)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+            __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapremove((&__pyx_v_neighbors)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
             Py_DECREF(__pyx_1); __pyx_1 = 0;
             goto __pyx_L19;
           }
           __pyx_L19:;
           __pyx_v_neighbor.priority = (-__pyx_v_d);
           __pyx_v_neighbor.contents.intdata = (__pyx_v_self->raw_indices[__pyx_v_i]);
-          __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heappush((&__pyx_v_neighbors), __pyx_v_neighbor); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heappush((&__pyx_v_neighbors), __pyx_v_neighbor); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
           Py_DECREF(__pyx_1); __pyx_1 = 0;
           __pyx_3 = (__pyx_v_neighbors.n == __pyx_v_k);
           if (__pyx_3) {
@@ -1464,7 +1458,7 @@
       __pyx_v_it2.priority = __pyx_v_far_min_distance;
       __pyx_3 = (__pyx_v_far_min_distance <= (__pyx_v_distance_upper_bound * __pyx_v_epsfac));
       if (__pyx_3) {
-        __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heappush((&__pyx_v_q), __pyx_v_it2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+        __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heappush((&__pyx_v_q), __pyx_v_it2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
         Py_DECREF(__pyx_1); __pyx_1 = 0;
         goto __pyx_L29;
       }
@@ -1493,9 +1487,9 @@
     }
     __pyx_L32:;
   }
-  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapdestroy((&__pyx_v_q)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapdestroy((&__pyx_v_q)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapdestroy((&__pyx_v_neighbors)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __pyx_f_5scipy_7spatial_7ckdtree_heapdestroy((&__pyx_v_neighbors)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
 
   goto __pyx_L0;
@@ -1506,7 +1500,7 @@
 }
 
 static PyObject *__pyx_pf_5scipy_7spatial_7ckdtree_7cKDTree_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5scipy_7spatial_7ckdtree_7cKDTree_query[] = "query the kd-tree for nearest neighbors\n\n        Parameters:\n        ===========\n\n        x : array-like, last dimension self.m\n            An array of points to query.\n        k : integer\n            The number of nearest neighbors to return.\n        eps : nonnegative float\n            Return approximate nearest neighbors; the kth returned value \n            is guaranteed to be no further than (1+eps) times the \n            distance to the real kth nearest neighbor.\n        p : float, 1<=p<=infinity\n            Which Minkowski p-norm to use. \n            1 is the sum-of-absolute-values \"Manhattan\" distance\n            2 is the usual Euclidean distance\n            infinity is the maximum-coordinate-difference distance\n        distance_upper_bound : nonnegative float\n            Return only neighbors within this distance. This is used to prune\n            tree searches, so if you are doing a series of nearest-neighbor\n            queries, it may help to supply the distance to the nearest neighbor\n            of the most recent point.\n\n        Returns:\n        ========\n        \n        d : array of floats\n            The distances to the nearest neighbors. \n            If x has shape tuple+(self.m,), then d has shape tuple+(k,).\n            Missing neighbors are indicated with infinite distances.\n        i : array of integers\n            The locations of the neighbors in self.data.\n            If x has shape tuple+(self.m,), then i has shape tuple+(k,).\n            Missing neighbors are indicated with self.n+1.\n        ";
+static char __pyx_doc_5scipy_7spatial_7ckdtree_7cKDTree_query[] = "query the kd-tree for nearest neighbors\n\n        Parameters:\n        ===========\n\n        x : array-like, last dimension self.m\n            An array of points to query.\n        k : integer\n            The number of nearest neighbors to return.\n        eps : nonnegative float\n            Return approximate nearest neighbors; the kth returned value \n            is guaranteed to be no further than (1+eps) times the \n            distance to the real kth nearest neighbor.\n        p : float, 1<=p<=infinity\n            Which Minkowski p-norm to use. \n            1 is the sum-of-absolute-values \"Manhattan\" distance\n            2 is the usual Euclidean distance\n            infinity is the maximum-coordinate-difference distance\n        distance_upper_bound : nonnegative float\n            Return only neighbors within this distance. This is used to prune\n            tree searches, so if you are doing a series of nearest-neighbor\n            queries, it may help to supply the distance to the nearest neighbor\n            of the most recent point.\n\n        Returns:\n        ========\n        \n        d : array of floats\n            The distances to the nearest neighbors. \n            If x has shape tuple+(self.m,), then d has shape tuple+(k,).\n            Missing neighbors are indicated with infinite distances.\n        i : array of integers\n            The locations of the neighbors in self.data.\n            If x has shape tuple+(self.m,), then i has shape tuple+(k,).\n            Missing neighbors are indicated with self.n.\n        ";
 static PyObject *__pyx_pf_5scipy_7spatial_7ckdtree_7cKDTree_query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_x = 0;
   int __pyx_v_k;
@@ -1564,20 +1558,20 @@
   if (likely(!__pyx_kwds) && likely(1 <= PyTuple_GET_SIZE(__pyx_args)) && likely(PyTuple_GET_SIZE(__pyx_args) <= 5)) {
     __pyx_v_x = PyTuple_GET_ITEM(__pyx_args, 0);
     if (PyTuple_GET_SIZE(__pyx_args) > 1) {
-      __pyx_v_k = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      __pyx_v_k = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       if (PyTuple_GET_SIZE(__pyx_args) > 2) {
-        __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        __pyx_v_eps = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         if (PyTuple_GET_SIZE(__pyx_args) > 3) {
-          __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __pyx_v_p = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
           if (PyTuple_GET_SIZE(__pyx_args) > 4) {
-            __pyx_v_distance_upper_bound = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+            __pyx_v_distance_upper_bound = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
           }
         }
       }
     }
   }
   else {
-    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|iddd", __pyx_argnames, &__pyx_v_x, &__pyx_v_k, &__pyx_v_eps, &__pyx_v_p, &__pyx_v_distance_upper_bound))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|iddd", __pyx_argnames, &__pyx_v_x, &__pyx_v_k, &__pyx_v_eps, &__pyx_v_p, &__pyx_v_distance_upper_bound))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   }
   goto __pyx_L4;
   __pyx_L3_error:;
@@ -1594,107 +1588,107 @@
   __pyx_v_single = Py_None; Py_INCREF(Py_None);
   __pyx_v_retshape = Py_None; Py_INCREF(Py_None);
   __pyx_v_n = Py_None; Py_INCREF(Py_None);
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_asarray); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_asarray); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_x);
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x);
-  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_astype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_astype); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_float); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_float); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
   __pyx_3 = 0;
-  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   Py_DECREF(__pyx_v_x);
   __pyx_v_x = __pyx_3;
   __pyx_3 = 0;
-  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __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[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_x);
   PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_x);
-  __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-  __pyx_1 = __Pyx_GetItemInt(__pyx_2, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetItemInt(__pyx_2, -1, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
-  __pyx_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   if (__pyx_4) {
-    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_3); __pyx_3 = 0;
-    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_INCREF(__pyx_v_x);
     PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_x);
-    __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
     Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
     PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
     __pyx_1 = 0;
     __pyx_5 = 0;
-    __pyx_3 = PyNumber_Remainder(__pyx_kp_21, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyNumber_Remainder(__pyx_kp_20, ((PyObject *)__pyx_2)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
-    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
     __pyx_3 = 0;
-    __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
     __Pyx_Raise(__pyx_5, 0, 0);
     Py_DECREF(__pyx_5); __pyx_5 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L5;
   }
   __pyx_L5:;
   __pyx_4 = (__pyx_v_p < 1);
   if (__pyx_4) {
-    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    Py_INCREF(__pyx_kp_22);
-    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_22);
-    __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    Py_INCREF(__pyx_kp_21);
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_kp_21);
+    __pyx_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __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[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     goto __pyx_L6;
   }
   __pyx_L6:;
-  __pyx_1 = PyObject_GetAttr(__pyx_v_x, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_6 = PyObject_Length(__pyx_1); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyObject_GetAttr(__pyx_v_x, __pyx_kp_shape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_6 = PyObject_Length(__pyx_1); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   __pyx_4 = (__pyx_6 == 1);
   if (__pyx_4) {
-    __pyx_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_v_single);
     __pyx_v_single = __pyx_5;
     __pyx_5 = 0;
-    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_newaxis); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_newaxis); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_2); __pyx_2 = 0;
-    __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3);
     PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);
     __pyx_3 = 0;
     __pyx_1 = 0;
-    __pyx_2 = PyObject_GetItem(__pyx_v_x, ((PyObject *)__pyx_5)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_2 = PyObject_GetItem(__pyx_v_x, ((PyObject *)__pyx_5)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
     Py_DECREF(__pyx_v_x);
     __pyx_v_x = __pyx_2;
@@ -1702,56 +1696,56 @@
     goto __pyx_L7;
   }
   /*else*/ {
-    __pyx_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     Py_DECREF(__pyx_v_single);
     __pyx_v_single = __pyx_3;
     __pyx_3 = 0;
   }
   __pyx_L7:;
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_shape); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_shape); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_x);
   PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
-  __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_5); __pyx_5 = 0;
   Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
-  __pyx_1 = PySequence_GetSlice(__pyx_3, 0, -1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PySequence_GetSlice(__pyx_3, 0, -1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_3); __pyx_3 = 0;
   Py_DECREF(__pyx_v_retshape);
   __pyx_v_retshape = __pyx_1;
   __pyx_1 = 0;
-  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_prod); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_prod); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_5); __pyx_5 = 0;
-  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_retshape);
   PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_retshape);
-  __pyx_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
   Py_DECREF(__pyx_v_n);
   __pyx_v_n = __pyx_1;
   __pyx_1 = 0;
-  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_reshape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_kp_reshape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_5); __pyx_5 = 0;
-  __pyx_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_n);
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_n);
   PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
   __pyx_3 = 0;
-  __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_x);
   PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_x);
   PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_1));
   __pyx_1 = 0;
-  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-  if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = ((PyArrayObject *)__pyx_3);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_xx, &__pyx_bstruct_xx);
   __pyx_t_2 = __Pyx_GetBuffer_double((PyObject*)__pyx_t_1, &__pyx_bstruct_xx, PyBUF_FORMAT| PyBUF_STRIDES, 2);
@@ -1767,34 +1761,34 @@
   }
   __pyx_bstride_0_xx = __pyx_bstruct_xx.strides[0]; __pyx_bstride_1_xx = __pyx_bstruct_xx.strides[1];
   __pyx_bshape_0_xx = __pyx_bstruct_xx.shape[0]; __pyx_bshape_1_xx = __pyx_bstruct_xx.shape[1];
-  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_1 = 0;
   Py_DECREF(((PyObject *)__pyx_v_xx));
   __pyx_v_xx = ((PyArrayObject *)__pyx_3);
   __pyx_3 = 0;
-  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_5 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __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 = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_n);
   PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_n);
   PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
   __pyx_5 = 0;
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_3));
   __pyx_3 = 0;
-  __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_7 = PyObject_GetAttr(__pyx_3, __pyx_kp_float); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_7 = PyObject_GetAttr(__pyx_3, __pyx_kp_float); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  if (PyDict_SetItem(__pyx_5, __pyx_kp_dtype, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_5, __pyx_kp_dtype, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_7); __pyx_7 = 0;
-  __pyx_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_1), ((PyObject *)__pyx_5)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-  if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_3);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_dd, &__pyx_bstruct_dd);
   __pyx_t_2 = __Pyx_GetBuffer_double((PyObject*)__pyx_t_6, &__pyx_bstruct_dd, PyBUF_FORMAT| PyBUF_STRIDES, 2);
@@ -1810,39 +1804,39 @@
   }
   __pyx_bstride_0_dd = __pyx_bstruct_dd.strides[0]; __pyx_bstride_1_dd = __pyx_bstruct_dd.strides[1];
   __pyx_bshape_0_dd = __pyx_bstruct_dd.shape[0]; __pyx_bshape_1_dd = __pyx_bstruct_dd.shape[1];
-  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = 0;
   Py_DECREF(((PyObject *)__pyx_v_dd));
   __pyx_v_dd = ((PyArrayObject *)__pyx_3);
   __pyx_3 = 0;
-  __pyx_7 = PyObject_GetAttr(((PyObject *)__pyx_v_dd), __pyx_kp_fill); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyFloat_FromDouble(__pyx_v_5scipy_7spatial_7ckdtree_infinity); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_7 = PyObject_GetAttr(((PyObject *)__pyx_v_dd), __pyx_kp_fill); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyFloat_FromDouble(__pyx_v_5scipy_7spatial_7ckdtree_infinity); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
   __pyx_2 = 0;
-  __pyx_5 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_7); __pyx_7 = 0;
   Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
   Py_DECREF(__pyx_5); __pyx_5 = 0;
-  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_empty); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_7 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_7 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_INCREF(__pyx_v_n);
   PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_n);
   PyTuple_SET_ITEM(__pyx_1, 1, __pyx_7);
   __pyx_7 = 0;
-  __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_1));
   __pyx_1 = 0;
-  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_kp_23) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_7 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_5), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_3, __pyx_kp_dtype, __pyx_kp_22) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_7 = PyEval_CallObjectWithKeywords(__pyx_2, ((PyObject *)__pyx_5), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
   Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-  if (!(__Pyx_TypeTest(__pyx_7, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(__Pyx_TypeTest(__pyx_7, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = ((PyArrayObject *)__pyx_7);
   __Pyx_SafeReleaseBuffer((PyObject*)__pyx_v_ii, &__pyx_bstruct_ii);
   __pyx_t_2 = __Pyx_GetBuffer_int((PyObject*)__pyx_t_7, &__pyx_bstruct_ii, PyBUF_FORMAT| PyBUF_STRIDES, 2);
@@ -1858,25 +1852,25 @@
   }
   __pyx_bstride_0_ii = __pyx_bstruct_ii.strides[0]; __pyx_bstride_1_ii = __pyx_bstruct_ii.strides[1];
   __pyx_bshape_0_ii = __pyx_bstruct_ii.shape[0]; __pyx_bshape_1_ii = __pyx_bstruct_ii.shape[1];
-  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_7 = 0;
   Py_DECREF(((PyObject *)__pyx_v_ii));
   __pyx_v_ii = ((PyArrayObject *)__pyx_7);
   __pyx_7 = 0;
-  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ii), __pyx_kp_fill); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_2 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->n); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ii), __pyx_kp_fill); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_2 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->n); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
   __pyx_2 = 0;
-  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
   Py_DECREF(__pyx_3); __pyx_3 = 0;
-  __pyx_8 = __pyx_PyInt_int(__pyx_v_n); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_8 = __pyx_PyInt_int(__pyx_v_n); if (unlikely((__pyx_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   for (__pyx_v_c = 0; __pyx_v_c < __pyx_8; __pyx_v_c+=1) {
     ((struct __pyx_vtabstruct_5scipy_7spatial_7ckdtree_cKDTree *)((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->__pyx_vtab)->__query(((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self), (((double *)__pyx_v_dd->data) + (__pyx_v_c * __pyx_v_k)), (((int *)__pyx_v_ii->data) + (__pyx_v_c * __pyx_v_k)), (((double *)__pyx_v_xx->data) + (__pyx_v_c * ((struct __pyx_obj_5scipy_7spatial_7ckdtree_cKDTree *)__pyx_v_self)->m)), __pyx_v_k, __pyx_v_eps, __pyx_v_p, __pyx_v_distance_upper_bound);
   }
-  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_single); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_single); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   if (__pyx_4) {
     __pyx_4 = (__pyx_v_k == 1);
     if (__pyx_4) {
@@ -1893,10 +1887,10 @@
       } else if (unlikely(__pyx_t_9 >= __pyx_bshape_1_dd)) __pyx_t_2 = 1;
       if (unlikely(__pyx_t_2 != -1)) {
           __Pyx_RaiseBufferIndexError(__pyx_t_2);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       __pyx_9 = *((double *)((double *)__Pyx_BufPtrStrided2d(__pyx_bstruct_dd.buf, __pyx_t_8, __pyx_bstride_0_dd, __pyx_t_9, __pyx_bstride_1_dd)));
-      __pyx_7 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyFloat_FromDouble(__pyx_9); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       __pyx_t_10 = 0;
       __pyx_t_11 = 0;
       __pyx_t_2 = -1;
@@ -1910,11 +1904,11 @@
       } else if (unlikely(__pyx_t_11 >= __pyx_bshape_1_ii)) __pyx_t_2 = 1;
       if (unlikely(__pyx_t_2 != -1)) {
           __Pyx_RaiseBufferIndexError(__pyx_t_2);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       }
       __pyx_8 = *((int *)((int *)__Pyx_BufPtrStrided2d(__pyx_bstruct_ii.buf, __pyx_t_10, __pyx_bstride_0_ii, __pyx_t_11, __pyx_bstride_1_ii)));
-      __pyx_2 = PyInt_FromLong(__pyx_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyInt_FromLong(__pyx_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_1, 0, __pyx_7);
       PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
       __pyx_7 = 0;
@@ -1925,9 +1919,9 @@
       goto __pyx_L11;
     }
     /*else*/ {
-      __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_dd), 0, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_ii), 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_dd), 0, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_ii), 0, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
       PyTuple_SET_ITEM(__pyx_7, 1, __pyx_3);
       __pyx_5 = 0;
@@ -1942,43 +1936,43 @@
   /*else*/ {
     __pyx_4 = (__pyx_v_k == 1);
     if (__pyx_4) {
-      __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_reshape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_kp_reshape); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_2); __pyx_2 = 0;
-      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_INCREF(Py_Ellipsis);
       PyTuple_SET_ITEM(__pyx_5, 0, Py_Ellipsis);
       Py_INCREF(__pyx_int_0);
       PyTuple_SET_ITEM(__pyx_5, 1, __pyx_int_0);
-      __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_dd), ((PyObject *)__pyx_5)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_dd), ((PyObject *)__pyx_5)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_7, 0, __pyx_3);
       Py_INCREF(__pyx_v_retshape);
       PyTuple_SET_ITEM(__pyx_7, 1, __pyx_v_retshape);
       __pyx_3 = 0;
-      __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_7), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_1); __pyx_1 = 0;
       Py_DECREF(((PyObject *)__pyx_7)); __pyx_7 = 0;
-      __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_reshape); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_kp_reshape); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_5); __pyx_5 = 0;
-      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_INCREF(Py_Ellipsis);
       PyTuple_SET_ITEM(__pyx_1, 0, Py_Ellipsis);
       Py_INCREF(__pyx_int_0);
       PyTuple_SET_ITEM(__pyx_1, 1, __pyx_int_0);
-      __pyx_7 = PyObject_GetItem(((PyObject *)__pyx_v_ii), ((PyObject *)__pyx_1)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyObject_GetItem(((PyObject *)__pyx_v_ii), ((PyObject *)__pyx_1)); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
       Py_INCREF(__pyx_v_retshape);
       PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_retshape);
       __pyx_7 = 0;
-      __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_3); __pyx_3 = 0;
       Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyTuple_New(2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_7, 0, __pyx_2);
       PyTuple_SET_ITEM(__pyx_7, 1, __pyx_1);
       __pyx_2 = 0;
@@ -1989,41 +1983,41 @@
       goto __pyx_L12;
     }
     /*else*/ {
-      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_kp_reshape); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_kp_reshape); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_3); __pyx_3 = 0;
-      __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
       __pyx_2 = 0;
-      __pyx_7 = PyNumber_Add(__pyx_v_retshape, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyNumber_Add(__pyx_v_retshape, ((PyObject *)__pyx_1)); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
-      __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_INCREF(((PyObject *)__pyx_v_dd));
       PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_dd));
       PyTuple_SET_ITEM(__pyx_3, 1, __pyx_7);
       __pyx_7 = 0;
-      __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_2 = PyObject_Call(__pyx_5, ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_5); __pyx_5 = 0;
       Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_7 = PyObject_GetAttr(__pyx_1, __pyx_kp_reshape); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_7 = PyObject_GetAttr(__pyx_1, __pyx_kp_reshape); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_1); __pyx_1 = 0;
-      __pyx_5 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __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 = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
       __pyx_5 = 0;
-      __pyx_1 = PyNumber_Add(__pyx_v_retshape, ((PyObject *)__pyx_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyNumber_Add(__pyx_v_retshape, ((PyObject *)__pyx_3)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
-      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_INCREF(((PyObject *)__pyx_v_ii));
       PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ii));
       PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);
       __pyx_1 = 0;
-      __pyx_3 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_3 = PyObject_Call(__pyx_7, ((PyObject *)__pyx_5), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       Py_DECREF(__pyx_7); __pyx_7 = 0;
       Py_DECREF(((PyObject *)__pyx_5)); __pyx_5 = 0;
-      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
       PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
       PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
       __pyx_2 = 0;
@@ -2441,12 +2435,11 @@
   {&__pyx_kp_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 1, 1, 1},
   {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1},
   {&__pyx_kp_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 1, 1, 1},
-  {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0},
+  {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0},
   {&__pyx_kp_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 0},
   {&__pyx_kp_19, __pyx_k_19, sizeof(__pyx_k_19), 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},
   {&__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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0},
@@ -2924,82 +2917,7 @@
     return 0;
 }
 
-#if PY_MAJOR_VERSION < 3
-static PyObject *__Pyx_GetStdout(void) {
-    PyObject *f = PySys_GetObject("stdout");
-    if (!f) {
-        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
-    }
-    return f;
-}
 
-static int __Pyx_Print(PyObject *arg_tuple, int newline) {
-    PyObject *f;
-    PyObject* v;
-    int i;
-    
-    if (!(f = __Pyx_GetStdout()))
-        return -1;
-    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
-        if (PyFile_SoftSpace(f, 1)) {
-            if (PyFile_WriteString(" ", f) < 0)
-                return -1;
-        }
-        v = PyTuple_GET_ITEM(arg_tuple, i);
-        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
-            return -1;
-        if (PyString_Check(v)) {
-            char *s = PyString_AsString(v);
-            Py_ssize_t len = PyString_Size(v);
-            if (len > 0 &&
-                isspace(Py_CHARMASK(s[len-1])) &&
-                s[len-1] != ' ')
-                    PyFile_SoftSpace(f, 0);
-        }
-    }
-    if (newline) {
-        if (PyFile_WriteString("\n", f) < 0)
-            return -1;
-        PyFile_SoftSpace(f, 0);
-    }
-    return 0;
-}
-
-#else /* Python 3 has a print function */
-static int __Pyx_Print(PyObject *arg_tuple, int newline) {
-    PyObject* kwargs = 0;
-    PyObject* result = 0;
-    PyObject* end_string;
-    if (!__pyx_print) {
-        __pyx_print = PyObject_GetAttrString(__pyx_b, "print");
-        if (!__pyx_print)
-            return -1;
-    }
-    if (!newline) {
-        if (!__pyx_print_kwargs) {
-            __pyx_print_kwargs = PyDict_New();
-            if (!__pyx_print_kwargs)
-                return -1;
-            end_string = PyUnicode_FromStringAndSize(" ", 1);
-            if (!end_string)
-                return -1;
-            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
-                Py_DECREF(end_string);
-                return -1;
-            }
-            Py_DECREF(end_string);
-        }
-        kwargs = __pyx_print_kwargs;
-    }
-    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
-    if (!result)
-        return -1;
-    Py_DECREF(result);
-    return 0;
-}
-#endif
-
-
 static void __Pyx_WriteUnraisable(const char *name) {
     PyObject *old_exc, *old_val, *old_tb;
     PyObject *ctx;

Modified: branches/spatial/scipy/spatial/ckdtree.pyx
===================================================================
--- branches/spatial/scipy/spatial/ckdtree.pyx	2008-10-13 15:46:17 UTC (rev 4796)
+++ branches/spatial/scipy/spatial/ckdtree.pyx	2008-10-13 15:58:54 UTC (rev 4797)
@@ -332,6 +332,9 @@
         stdlib.free(node)
 
     def __dealloc__(cKDTree self):
+        if <int>(self.tree) == 0:
+            # should happen only if __init__ was never called
+            return
         self.__free_tree(self.tree)
 
     cdef void __query(cKDTree self, 
@@ -546,7 +549,7 @@
         i : array of integers
             The locations of the neighbors in self.data.
             If x has shape tuple+(self.m,), then i has shape tuple+(k,).
-            Missing neighbors are indicated with self.n+1.
+            Missing neighbors are indicated with self.n.
         """
         cdef np.ndarray[int, ndim=2] ii
         cdef np.ndarray[double, ndim=2] dd



More information about the Scipy-svn mailing list