From scipy-svn at scipy.org Wed Sep 1 16:30:25 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 1 Sep 2010 15:30:25 -0500 (CDT) Subject: [Scipy-svn] r6663 - in trunk/scipy: interpolate interpolate/tests spatial spatial/tests Message-ID: <20100901203025.2198239CC9C@scipy.org> Author: ptvirtan Date: 2010-09-01 15:30:25 -0500 (Wed, 01 Sep 2010) New Revision: 6663 Modified: trunk/scipy/interpolate/interpnd.pyx trunk/scipy/interpolate/tests/test_interpnd.py trunk/scipy/spatial/qhull.pxd trunk/scipy/spatial/qhull.pyx trunk/scipy/spatial/tests/test_qhull.py Log: BUG: spatial/qhull: fix bugs in RidgeIter2D near boundaries Also, expose RidgeIter2D to the Python side, so that it can be tested. Add tests for it. Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-08-31 22:00:43 UTC (rev 6662) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-01 20:30:25 UTC (rev 6663) @@ -394,7 +394,7 @@ # walk over neighbours of given point qhull._RidgeIter2D_init(&it, d, ipoint) - while it.edge != -1: + while it.index != -1: # edge ex = d.points[2*it.vertex2 + 0] - d.points[2*it.vertex + 0] ey = d.points[2*it.vertex2 + 1] - d.points[2*it.vertex + 1] Modified: trunk/scipy/interpolate/tests/test_interpnd.py =================================================================== --- trunk/scipy/interpolate/tests/test_interpnd.py 2010-08-31 22:00:43 UTC (rev 6662) +++ trunk/scipy/interpolate/tests/test_interpnd.py 2010-09-01 20:30:25 UTC (rev 6663) @@ -98,7 +98,8 @@ np.random.seed(1234) if x is None: x = np.array([(0, 0), (0, 1), - (1, 0), (1, 1), (0.25, 0.75), (0.6, 0.8)], + (1, 0), (1, 1), (0.25, 0.75), (0.6, 0.8), + (0.5, 0.2)], dtype=float) ip = interpnd.CloughTocher2DInterpolator(x, func(x[:,0], x[:,1]), @@ -128,7 +129,7 @@ self._check_accuracy(func, tol=1e-13, atol=1e-7, rtol=1e-7, err_msg="Function %d" % j) - def test_quadratic_dense_smoketest(self): + def test_quadratic_smoketest(self): # Should be reasonably accurate for quadratic functions funcs = [ lambda x, y: x**2, @@ -156,7 +157,7 @@ np.random.rand(30*30, 2)] for j, func in enumerate(funcs): - self._check_accuracy(func, x=grid, tol=1e-9, atol=1e-2, rtol=1e-2, + self._check_accuracy(func, x=grid, tol=1e-9, atol=5e-3, rtol=1e-2, err_msg="Function %d" % j) if __name__ == "__main__": Modified: trunk/scipy/spatial/qhull.pxd =================================================================== --- trunk/scipy/spatial/qhull.pxd 2010-08-31 22:00:43 UTC (rev 6662) +++ trunk/scipy/spatial/qhull.pxd 2010-09-01 20:30:25 UTC (rev 6663) @@ -77,12 +77,13 @@ ctypedef struct RidgeIter2D_t: DelaunayInfo_t *info + int index int vertex - int edge int vertex2 int triangle int start_triangle - int start_edge + int start_index + int restart cdef void _RidgeIter2D_init(RidgeIter2D_t *it, DelaunayInfo_t *d, int vertex) nogil Modified: trunk/scipy/spatial/qhull.pyx =================================================================== --- trunk/scipy/spatial/qhull.pyx 2010-08-31 22:00:43 UTC (rev 6662) +++ trunk/scipy/spatial/qhull.pyx 2010-09-01 20:30:25 UTC (rev 6663) @@ -485,19 +485,20 @@ it.vertex = vertex it.triangle = d.vertex_to_simplex[vertex] it.start_triangle = it.triangle + it.restart = 0 if it.triangle != -1: - # find some edge connected to this vertex; start from -1 edges + # find some edge connected to this vertex for k in xrange(3): ivertex = it.info.vertices[it.triangle*3 + k] if ivertex != vertex: it.vertex2 = ivertex - it.edge = k - it.start_edge = k + it.index = k + it.start_index = k break else: - it.start_edge = -1 - it.edge = -1 + it.start_index = -1 + it.index = -1 cdef void _RidgeIter2D_next(RidgeIter2D_t *it) nogil: cdef int itri, k, ivertex @@ -515,27 +516,48 @@ # `+------k # - # jump to the next triangle - itri = it.info.neighbors[it.triangle*3 + it.edge] - - # if it's outside triangulation, restart it to the opposite direction - if itri == -1: - if it.start_edge == -1: + if it.restart: + if it.start_index == -1: # we already did that -> we have iterated over everything - it.edge = -1 + it.index = -1 return + # restart to opposite direction + it.triangle = it.start_triangle for k in xrange(3): ivertex = it.info.vertices[it.triangle*3 + k] - if ivertex != it.vertex and k != it.start_edge: - it.edge = k + if ivertex != it.vertex and k != it.start_index: + it.index = k it.vertex2 = ivertex break + it.start_index = -1 + it.restart = 0 - it.start_edge = -1 + if it.info.neighbors[it.triangle*3 + it.index] == -1: + it.index = -1 + return + else: + _RidgeIter2D_next(it) + if it.index == -1: + return + + # jump to the next triangle + itri = it.info.neighbors[it.triangle*3 + it.index] + + # if it's outside triangulation, take the last edge, and signal + # restart to the opposite direction + if itri == -1: + for k in xrange(3): + ivertex = it.info.vertices[it.triangle*3 + k] + if ivertex != it.vertex and k != it.index: + it.index = k + it.vertex2 = ivertex + break + + it.restart = 1 return - # Find at which edge we are now: + # Find at which index we are now: # # it.vertex # O-------k------. @@ -547,14 +569,14 @@ # # A = it.triangle # B = itri - # E = it.edge + # E = it.index # O = it.vertex # for k in xrange(3): ivertex = it.info.vertices[itri*3 + k] if it.info.neighbors[itri*3 + k] != it.triangle and \ ivertex != it.vertex: - it.edge = k + it.index = k it.vertex2 = ivertex break @@ -562,9 +584,39 @@ # check termination if it.triangle == it.start_triangle: - it.edge = -1 + it.index = -1 return +cdef class RidgeIter2D(object): + cdef RidgeIter2D_t it + cdef object delaunay + cdef DelaunayInfo_t *info + + def __init__(self, delaunay, ivertex): + self.info = NULL + if delaunay.ndim != 2: + raise ValueError("RidgeIter2D supports only 2-D") + self.delaunay = delaunay + self.info = _get_delaunay_info(delaunay, 0, 1) + _RidgeIter2D_init(&self.it, self.info, ivertex) + + def __del__(self): + if self.info != NULL: + free(self.info) + self.info = NULL + self.delaunay = None + + def __iter__(self): + return self + + def __next__(self): + if self.it.index == -1: + raise StopIteration() + ret = (self.it.vertex, self.it.vertex2, self.it.index, self.it.triangle) + _RidgeIter2D_next(&self.it) + return ret + + #------------------------------------------------------------------------------ # Finding simplices #------------------------------------------------------------------------------ Modified: trunk/scipy/spatial/tests/test_qhull.py =================================================================== --- trunk/scipy/spatial/tests/test_qhull.py 2010-08-31 22:00:43 UTC (rev 6662) +++ trunk/scipy/spatial/tests/test_qhull.py 2010-09-01 20:30:25 UTC (rev 6663) @@ -70,7 +70,77 @@ assert_equal(tri.convex_hull, [[1, 2], [3, 2], [1, 0], [3, 0]]) +class TestRidgeIter2D(object): + def _check_ridges(self, tri, vertex, expected): + got = [(v1, v2) for v1, v2, i, t in qhull.RidgeIter2D(tri, vertex)] + got.sort() + expected.sort() + assert_equal(got, expected, err_msg="%d: %r != %r" % ( + vertex, got, expected)) + + def test_triangle(self): + points = np.array([(0,0), (0,1), (1,0)], dtype=np.double) + tri = qhull.Delaunay(points) + + # 1 + # + + # |\ + # | \ + # |0 \ + # +---+ + # 0 2 + + self._check_ridges(tri, 0, [(0, 1), (0, 2)]) + self._check_ridges(tri, 1, [(1, 0), (1, 2)]) + self._check_ridges(tri, 2, [(2, 0), (2, 1)]) + + def test_rectangle(self): + points = np.array([(0,0), (0,1), (1,1), (1,0)], dtype=np.double) + tri = qhull.Delaunay(points) + + # 1 2 + # +---+ + # |\ 0| + # | \ | + # |1 \| + # +---+ + # 0 3 + + self._check_ridges(tri, 0, [(0, 1), (0, 3)]) + self._check_ridges(tri, 1, [(1, 0), (1, 3), (1, 2)]) + self._check_ridges(tri, 2, [(2, 1), (2, 3)]) + self._check_ridges(tri, 3, [(3, 0), (3, 1), (3, 2)]) + + def test_complicated(self): + points = np.array([(0,0), (0,1), (1,1), (1,0), + (0.5, 0.5), (0.9, 0.5)], dtype=np.double) + tri = qhull.Delaunay(points) + + # 1 2 + # +-----------------------+ + # | \- /-|| + # | \- 0 /- /| + # | \- /- / | + # | \- /- | | + # | \-4/- 4 5/ | + # | 1 +-------+ 3| + # | -/ \- 5 \ | + # | --/ \-- \ | + # | --/ 2 \- | | + # | -/ \-\| + # +-----------------------+ + # 0 3 + # + + self._check_ridges(tri, 0, [(0, 1), (0, 3), (0, 4)]) + self._check_ridges(tri, 1, [(1, 0), (1, 2), (1, 4)]) + self._check_ridges(tri, 2, [(2, 1), (2, 4), (2, 5), (2, 3)]) + self._check_ridges(tri, 3, [(3, 0), (3, 4), (3, 5), (3, 2)]) + self._check_ridges(tri, 4, [(4, 0), (4, 1), (4, 2), (4, 3), (4, 5)]) + self._check_ridges(tri, 5, [(5, 2), (5, 3), (5, 4)]) + + class TestTriangulation(object): """ Check that triangulation works. From scipy-svn at scipy.org Wed Sep 1 16:30:46 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 1 Sep 2010 15:30:46 -0500 (CDT) Subject: [Scipy-svn] r6664 - in trunk/scipy: interpolate spatial Message-ID: <20100901203046.5937039CCF3@scipy.org> Author: ptvirtan Date: 2010-09-01 15:30:46 -0500 (Wed, 01 Sep 2010) New Revision: 6664 Modified: trunk/scipy/interpolate/interpnd.c trunk/scipy/spatial/qhull.c Log: GEN: spatial/interpolate: regenerate qhull.c and interpnd.c Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-01 20:30:25 UTC (rev 6663) +++ trunk/scipy/interpolate/interpnd.c 2010-09-01 20:30:46 UTC (rev 6664) @@ -399,12 +399,13 @@ typedef struct { __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *info; + int index; int vertex; - int edge; int vertex2; int triangle; int start_triangle; - int start_edge; + int start_index; + int restart; } __pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t; #ifndef CYTHON_REFNANNY @@ -865,7 +866,6 @@ static char __pyx_k__tri[] = "tri"; static char __pyx_k__base[] = "base"; static char __pyx_k__data[] = "data"; -static char __pyx_k__edge[] = "edge"; static char __pyx_k__grad[] = "grad"; static char __pyx_k__imag[] = "imag"; static char __pyx_k__ndim[] = "ndim"; @@ -877,6 +877,7 @@ static char __pyx_k__dtype[] = "dtype"; static char __pyx_k__empty[] = "empty"; static char __pyx_k__finfo[] = "finfo"; +static char __pyx_k__index[] = "index"; static char __pyx_k__names[] = "names"; static char __pyx_k__numpy[] = "numpy"; static char __pyx_k__qhull[] = "qhull"; @@ -983,7 +984,6 @@ static PyObject *__pyx_n_s__descr; static PyObject *__pyx_n_s__double; static PyObject *__pyx_n_s__dtype; -static PyObject *__pyx_n_s__edge; static PyObject *__pyx_n_s__empty; static PyObject *__pyx_n_s__enumerate; static PyObject *__pyx_n_s__eps; @@ -993,6 +993,7 @@ static PyObject *__pyx_n_s__format; static PyObject *__pyx_n_s__grad; static PyObject *__pyx_n_s__imag; +static PyObject *__pyx_n_s__index; static PyObject *__pyx_n_s__is_complex; static PyObject *__pyx_n_s__issubdtype; static PyObject *__pyx_n_s__itemsize; @@ -3553,7 +3554,7 @@ while (1) { - __pyx_t_7 = (__pyx_v_it.edge != -1); + __pyx_t_7 = (__pyx_v_it.index != -1); if (!__pyx_t_7) break; @@ -7407,7 +7408,6 @@ {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1}, {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1}, {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1}, - {&__pyx_n_s__edge, __pyx_k__edge, sizeof(__pyx_k__edge), 0, 0, 1, 1}, {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1}, {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1}, {&__pyx_n_s__eps, __pyx_k__eps, sizeof(__pyx_k__eps), 0, 0, 1, 1}, @@ -7417,6 +7417,7 @@ {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1}, {&__pyx_n_s__grad, __pyx_k__grad, sizeof(__pyx_k__grad), 0, 0, 1, 1}, {&__pyx_n_s__imag, __pyx_k__imag, sizeof(__pyx_k__imag), 0, 0, 1, 1}, + {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, {&__pyx_n_s__is_complex, __pyx_k__is_complex, sizeof(__pyx_k__is_complex), 0, 0, 1, 1}, {&__pyx_n_s__issubdtype, __pyx_k__issubdtype, sizeof(__pyx_k__issubdtype), 0, 0, 1, 1}, {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1}, Modified: trunk/scipy/spatial/qhull.c =================================================================== --- trunk/scipy/spatial/qhull.c 2010-09-01 20:30:25 UTC (rev 6663) +++ trunk/scipy/spatial/qhull.c 2010-09-01 20:30:46 UTC (rev 6664) @@ -401,14 +401,24 @@ typedef struct { __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *info; + int index; int vertex; - int edge; int vertex2; int triangle; int start_triangle; - int start_edge; + int start_index; + int restart; } __pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t; + + +struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D { + PyObject_HEAD + __pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t it; + PyObject *delaunay; + __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *info; +}; + #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif @@ -758,6 +768,7 @@ +static PyTypeObject *__pyx_ptype_5scipy_7spatial_5qhull_RidgeIter2D = 0; static __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *__pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(PyObject *, int, int); static int __pyx_f_5scipy_7spatial_5qhull__barycentric_inside(int, double *, double *, double *, double); static void __pyx_f_5scipy_7spatial_5qhull__barycentric_coordinate_single(int, double *, double *, double *, int); @@ -781,6 +792,7 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_xrange; +static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_range; static char __pyx_k_1[] = "qhull d Qz Qbb Qt"; static char __pyx_k_2[] = "No points to triangulate"; @@ -789,17 +801,18 @@ static char __pyx_k_5[] = "_qhull_get_facet_array"; static char __pyx_k_6[] = "qhull: did not free %d bytes (%d pieces)"; static char __pyx_k_7[] = "non-simplical facet encountered"; -static char __pyx_k_8[] = "_get_barycentric_transforms"; -static char __pyx_k_10[] = "wrong dimensionality in xi"; -static char __pyx_k_11[] = "xi has different dimensionality than triangulation"; -static char __pyx_k_12[] = "ndarray is not C contiguous"; -static char __pyx_k_13[] = "ndarray is not Fortran contiguous"; -static char __pyx_k_14[] = "Non-native byte order not supported"; -static char __pyx_k_15[] = "unknown dtype code in numpy.pxd (%d)"; -static char __pyx_k_16[] = "Format string allocated too short, see comment in numpy.pxd"; -static char __pyx_k_17[] = "Format string allocated too short."; -static char __pyx_k_18[] = "\nWrappers for Qhull triangulation, plus some additional N-D geometry utilities\n\n.. versionadded:: 0.9\n\n"; -static char __pyx_k_19[] = "\n Delaunay(points)\n\n Delaunay tesselation in N dimensions\n\n .. versionadded:: 0.9\n\n Parameters\n ----------\n points : ndarray of floats, shape (npoints, ndim)\n Coordinates of points to triangulate\n\n Attributes\n ----------\n points : ndarray of double, shape (npoints, ndim)\n Points in the triangulation\n vertices : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of vertices forming simplices in the triangulation\n neighbors : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of neighbor simplices for each simplex.\n The kth neighbor is opposite to the kth vertex.\n For simplices at the boundary, -1 denotes no neighbor.\n equations : ndarray of double, shape (nsimplex, ndim+2)\n [normal, offset] forming the hyperplane equation of the facet\n on the paraboloid. (See [Qhull]_ documentation for more.)\n paraboloid_scale, paraboloid_shift : float\n Scale and shift for the extra paraboloid dimension.\n (See [Qhull]_ documentation for more.)\n transform : ndarray of double, shape (nsimplex, ndim+1, ndim)\n Affine transform from ``x`` to the barycentric coordinates ``c``.\n This is defined by::\n\n T c = x - r\n\n At vertex ``j``, ``c_j = 1`` and the other coordinates zero.\n\n For simplex ``i``, ``transform[i,:ndim,:ndim]`` contains\n inverse of the matrix ``T``, and ``transform[i,ndim,:]``\n contains the vector ``r``.\n vertex_to_simplex : ndarray of int, shape (npoints,)\n Lookup array, from a vertex, to some simplex which it is a part of.\n convex_hull : ndarray of int, shape (nfaces, ndim)\n Vertices of facets forming the convex hull of the point set.\n The array contains the indices of the points belonging to\n the (N-1)-dimensional facets that form the convex hull\n of the triangulation.\n\n Notes\n -----\n The tesselation is computed using the Qhull libary [Qhull]_.\n\n References\n ----------\n\n .. [Qhull] http://www.qhull.org/\n\n "; +static char __pyx_k_8[] = "RidgeIter2D supports only 2-D"; +static char __pyx_k_9[] = "_get_barycentric_transforms"; +static char __pyx_k_11[] = "wrong dimensionality in xi"; +static char __pyx_k_12[] = "xi has different dimensionality than triangulation"; +static char __pyx_k_13[] = "ndarray is not C contiguous"; +static char __pyx_k_14[] = "ndarray is not Fortran contiguous"; +static char __pyx_k_15[] = "Non-native byte order not supported"; +static char __pyx_k_16[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_17[] = "Format string allocated too short, see comment in numpy.pxd"; +static char __pyx_k_18[] = "Format string allocated too short."; +static char __pyx_k_19[] = "\nWrappers for Qhull triangulation, plus some additional N-D geometry utilities\n\n.. versionadded:: 0.9\n\n"; +static char __pyx_k_20[] = "\n Delaunay(points)\n\n Delaunay tesselation in N dimensions\n\n .. versionadded:: 0.9\n\n Parameters\n ----------\n points : ndarray of floats, shape (npoints, ndim)\n Coordinates of points to triangulate\n\n Attributes\n ----------\n points : ndarray of double, shape (npoints, ndim)\n Points in the triangulation\n vertices : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of vertices forming simplices in the triangulation\n neighbors : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of neighbor simplices for each simplex.\n The kth neighbor is opposite to the kth vertex.\n For simplices at the boundary, -1 denotes no neighbor.\n equations : ndarray of double, shape (nsimplex, ndim+2)\n [normal, offset] forming the hyperplane equation of the facet\n on the paraboloid. (See [Qhull]_ documentation for more.)\n paraboloid_scale, paraboloid_shift : float\n Scale and shift for the extra paraboloid dimension.\n (See [Qhull]_ documentation for more.)\n transform : ndarray of double, shape (nsimplex, ndim+1, ndim)\n Affine transform from ``x`` to the barycentric coordinates ``c``.\n This is defined by::\n\n T c = x - r\n\n At vertex ``j``, ``c_j = 1`` and the other coordinates zero.\n\n For simplex ``i``, ``transform[i,:ndim,:ndim]`` contains\n inverse of the matrix ``T``, and ``transform[i,ndim,:]``\n contains the vector ``r``.\n vertex_to_simplex : ndarray of int, shape (npoints,)\n Lookup array, from a vertex, to some simplex which it is a part of.\n convex_hull : ndarray of int, shape (nfaces, ndim)\n Vertices of facets forming the convex hull of the point set.\n The array contains the indices of the points belonging to\n the (N-1)-dimensional facets that form the convex hull\n of the triangulation.\n\n Notes\n -----\n The tesselation is computed using the Qhull libary [Qhull]_.\n\n References\n ----------\n\n .. [Qhull] http://www.qhull.org/\n\n "; static char __pyx_k__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -821,6 +834,7 @@ static char __pyx_k__Zf[] = "Zf"; static char __pyx_k__Zg[] = "Zg"; static char __pyx_k__id[] = "id"; +static char __pyx_k__it[] = "it"; static char __pyx_k__np[] = "np"; static char __pyx_k__xi[] = "xi"; static char __pyx_k__buf[] = "buf"; @@ -836,7 +850,6 @@ static char __pyx_k__axis[] = "axis"; static char __pyx_k__base[] = "base"; static char __pyx_k__data[] = "data"; -static char __pyx_k__edge[] = "edge"; static char __pyx_k__fill[] = "fill"; static char __pyx_k__info[] = "info"; static char __pyx_k__ndim[] = "ndim"; @@ -847,6 +860,7 @@ static char __pyx_k__dtype[] = "dtype"; static char __pyx_k__empty[] = "empty"; static char __pyx_k__finfo[] = "finfo"; +static char __pyx_k__index[] = "index"; static char __pyx_k__names[] = "names"; static char __pyx_k__numpy[] = "numpy"; static char __pyx_k__point[] = "point"; @@ -866,15 +880,18 @@ static char __pyx_k__xrange[] = "xrange"; static char __pyx_k____all__[] = "__all__"; static char __pyx_k__acquire[] = "acquire"; +static char __pyx_k__ivertex[] = "ivertex"; static char __pyx_k__npoints[] = "npoints"; static char __pyx_k__release[] = "release"; static char __pyx_k__reshape[] = "reshape"; +static char __pyx_k__restart[] = "restart"; static char __pyx_k__strides[] = "strides"; static char __pyx_k__tsearch[] = "tsearch"; static char __pyx_k__vertex2[] = "vertex2"; static char __pyx_k__Delaunay[] = "Delaunay"; static char __pyx_k____init__[] = "__init__"; static char __pyx_k____main__[] = "__main__"; +static char __pyx_k__delaunay[] = "delaunay"; static char __pyx_k__facet_id[] = "facet_id"; static char __pyx_k__itemsize[] = "itemsize"; static char __pyx_k__last_low[] = "last_low"; @@ -901,14 +918,15 @@ static char __pyx_k__bruteforce[] = "bruteforce"; static char __pyx_k__facet_list[] = "facet_list"; static char __pyx_k__simplicial[] = "simplicial"; -static char __pyx_k__start_edge[] = "start_edge"; static char __pyx_k__suboffsets[] = "suboffsets"; static char __pyx_k___qhull_lock[] = "_qhull_lock"; static char __pyx_k__convex_hull[] = "convex_hull"; static char __pyx_k__lift_points[] = "lift_points"; +static char __pyx_k__start_index[] = "start_index"; static char __pyx_k__RuntimeError[] = "RuntimeError"; static char __pyx_k__find_simplex[] = "find_simplex"; static char __pyx_k__last_newhigh[] = "last_newhigh"; +static char __pyx_k__StopIteration[] = "StopIteration"; static char __pyx_k__upperdelaunay[] = "upperdelaunay"; static char __pyx_k__plane_distance[] = "plane_distance"; static char __pyx_k__start_triangle[] = "start_triangle"; @@ -918,27 +936,29 @@ static char __pyx_k__vertex_to_simplex[] = "vertex_to_simplex"; static char __pyx_k___vertex_to_simplex[] = "_vertex_to_simplex"; static char __pyx_k___construct_delaunay[] = "_construct_delaunay"; -static PyObject *__pyx_kp_s_10; static PyObject *__pyx_kp_s_11; -static PyObject *__pyx_kp_u_12; +static PyObject *__pyx_kp_s_12; static PyObject *__pyx_kp_u_13; static PyObject *__pyx_kp_u_14; static PyObject *__pyx_kp_u_15; static PyObject *__pyx_kp_u_16; static PyObject *__pyx_kp_u_17; -static PyObject *__pyx_kp_s_19; +static PyObject *__pyx_kp_u_18; static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_20; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_n_s_5; static PyObject *__pyx_kp_s_6; static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s_8; +static PyObject *__pyx_kp_s_8; +static PyObject *__pyx_n_s_9; static PyObject *__pyx_n_s__Delaunay; static PyObject *__pyx_n_s__Lock; static PyObject *__pyx_n_s__NOerrexit; static PyObject *__pyx_n_s__RuntimeError; static PyObject *__pyx_n_s__SCALElast; +static PyObject *__pyx_n_s__StopIteration; static PyObject *__pyx_n_s__ValueError; static PyObject *__pyx_n_s____all__; static PyObject *__pyx_n_s____init__; @@ -958,11 +978,11 @@ static PyObject *__pyx_n_s__byteorder; static PyObject *__pyx_n_s__convex_hull; static PyObject *__pyx_n_s__data; +static PyObject *__pyx_n_s__delaunay; static PyObject *__pyx_n_s__descr; static PyObject *__pyx_n_s__double; static PyObject *__pyx_n_s__dtype; static PyObject *__pyx_n_s__e; -static PyObject *__pyx_n_s__edge; static PyObject *__pyx_n_s__empty; static PyObject *__pyx_n_s__eps; static PyObject *__pyx_n_s__equations; @@ -974,9 +994,12 @@ static PyObject *__pyx_n_s__finfo; static PyObject *__pyx_n_s__format; static PyObject *__pyx_n_s__id; +static PyObject *__pyx_n_s__index; static PyObject *__pyx_n_s__info; static PyObject *__pyx_n_s__int; +static PyObject *__pyx_n_s__it; static PyObject *__pyx_n_s__itemsize; +static PyObject *__pyx_n_s__ivertex; static PyObject *__pyx_n_s__last_high; static PyObject *__pyx_n_s__last_low; static PyObject *__pyx_n_s__last_newhigh; @@ -1012,10 +1035,11 @@ static PyObject *__pyx_n_s__release; static PyObject *__pyx_n_s__reshape; static PyObject *__pyx_n_s__resize; +static PyObject *__pyx_n_s__restart; static PyObject *__pyx_n_s__self; static PyObject *__pyx_n_s__shape; static PyObject *__pyx_n_s__simplicial; -static PyObject *__pyx_n_s__start_edge; +static PyObject *__pyx_n_s__start_index; static PyObject *__pyx_n_s__start_triangle; static PyObject *__pyx_n_s__strides; static PyObject *__pyx_n_s__suboffsets; @@ -1041,7 +1065,7 @@ static PyObject *__pyx_int_neg_1; static PyObject *__pyx_int_10; static PyObject *__pyx_int_15; -static PyObject *__pyx_k_9; +static PyObject *__pyx_k_10; @@ -3065,6 +3089,9 @@ __pyx_v_it->start_triangle = __pyx_v_it->triangle; + __pyx_v_it->restart = 0; + + __pyx_t_1 = (__pyx_v_it->triangle != -1); if (__pyx_t_1) { @@ -3083,10 +3110,10 @@ __pyx_v_it->vertex2 = __pyx_v_ivertex; - __pyx_v_it->edge = __pyx_v_k; + __pyx_v_it->index = __pyx_v_k; - __pyx_v_it->start_edge = __pyx_v_k; + __pyx_v_it->start_index = __pyx_v_k; goto __pyx_L5_break; @@ -3100,10 +3127,10 @@ { - __pyx_v_it->start_edge = -1; + __pyx_v_it->start_index = -1; - __pyx_v_it->edge = -1; + __pyx_v_it->index = -1; } __pyx_L3:; @@ -3121,18 +3148,15 @@ int __pyx_t_4; - __pyx_v_itri = (__pyx_v_it->info->neighbors[((__pyx_v_it->triangle * 3) + __pyx_v_it->edge)]); - - - __pyx_t_1 = (__pyx_v_itri == -1); + __pyx_t_1 = __pyx_v_it->restart; if (__pyx_t_1) { - __pyx_t_1 = (__pyx_v_it->start_edge == -1); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_it->start_index == -1); + if (__pyx_t_2) { - __pyx_v_it->edge = -1; + __pyx_v_it->index = -1; goto __pyx_L0; @@ -3141,24 +3165,27 @@ __pyx_L4:; - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_k = __pyx_t_2; + __pyx_v_it->triangle = __pyx_v_it->start_triangle; + + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_k = __pyx_t_1; + __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_it->triangle * 3) + __pyx_v_k)]); - __pyx_t_1 = (__pyx_v_ivertex != __pyx_v_it->vertex); - if (__pyx_t_1) { - __pyx_t_3 = (__pyx_v_k != __pyx_v_it->start_edge); + __pyx_t_2 = (__pyx_v_ivertex != __pyx_v_it->vertex); + if (__pyx_t_2) { + __pyx_t_3 = (__pyx_v_k != __pyx_v_it->start_index); __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_4 = __pyx_t_1; + __pyx_t_4 = __pyx_t_2; } if (__pyx_t_4) { - __pyx_v_it->edge = __pyx_v_k; + __pyx_v_it->index = __pyx_v_k; __pyx_v_it->vertex2 = __pyx_v_ivertex; @@ -3172,68 +3199,397 @@ __pyx_L6_break:; - __pyx_v_it->start_edge = -1; + __pyx_v_it->start_index = -1; - goto __pyx_L0; + __pyx_v_it->restart = 0; + + + __pyx_t_4 = ((__pyx_v_it->info->neighbors[((__pyx_v_it->triangle * 3) + __pyx_v_it->index)]) == -1); + if (__pyx_t_4) { + + + __pyx_v_it->index = -1; + + + goto __pyx_L0; + goto __pyx_L8; + } + { + + + __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next(__pyx_v_it); + + + __pyx_t_4 = (__pyx_v_it->index == -1); + if (__pyx_t_4) { + + + goto __pyx_L0; + goto __pyx_L9; + } + __pyx_L9:; + } + __pyx_L8:; goto __pyx_L3; } __pyx_L3:; - for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { - __pyx_v_k = __pyx_t_2; + __pyx_v_itri = (__pyx_v_it->info->neighbors[((__pyx_v_it->triangle * 3) + __pyx_v_it->index)]); + + __pyx_t_4 = (__pyx_v_itri == -1); + if (__pyx_t_4) { + + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_k = __pyx_t_1; + + + __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_it->triangle * 3) + __pyx_v_k)]); + + + __pyx_t_4 = (__pyx_v_ivertex != __pyx_v_it->vertex); + if (__pyx_t_4) { + __pyx_t_2 = (__pyx_v_k != __pyx_v_it->index); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_3 = __pyx_t_4; + } + if (__pyx_t_3) { + + + __pyx_v_it->index = __pyx_v_k; + + + __pyx_v_it->vertex2 = __pyx_v_ivertex; + + + goto __pyx_L12_break; + goto __pyx_L13; + } + __pyx_L13:; + } + __pyx_L12_break:; + + + __pyx_v_it->restart = 1; + + + goto __pyx_L0; + goto __pyx_L10; + } + __pyx_L10:; + + + for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { + __pyx_v_k = __pyx_t_1; + + __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_itri * 3) + __pyx_v_k)]); - __pyx_t_4 = ((__pyx_v_it->info->neighbors[((__pyx_v_itri * 3) + __pyx_v_k)]) != __pyx_v_it->triangle); - if (__pyx_t_4) { + __pyx_t_3 = ((__pyx_v_it->info->neighbors[((__pyx_v_itri * 3) + __pyx_v_k)]) != __pyx_v_it->triangle); + if (__pyx_t_3) { - __pyx_t_1 = (__pyx_v_ivertex != __pyx_v_it->vertex); - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = (__pyx_v_ivertex != __pyx_v_it->vertex); + __pyx_t_2 = __pyx_t_4; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { + if (__pyx_t_2) { - __pyx_v_it->edge = __pyx_v_k; + __pyx_v_it->index = __pyx_v_k; __pyx_v_it->vertex2 = __pyx_v_ivertex; - goto __pyx_L9_break; - goto __pyx_L10; + goto __pyx_L15_break; + goto __pyx_L16; } - __pyx_L10:; + __pyx_L16:; } - __pyx_L9_break:; + __pyx_L15_break:; __pyx_v_it->triangle = __pyx_v_itri; - __pyx_t_3 = (__pyx_v_it->triangle == __pyx_v_it->start_triangle); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_it->triangle == __pyx_v_it->start_triangle); + if (__pyx_t_2) { - __pyx_v_it->edge = -1; + __pyx_v_it->index = -1; goto __pyx_L0; - goto __pyx_L11; + goto __pyx_L17; } - __pyx_L11:; + __pyx_L17:; __pyx_L0:; } +static int __pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); +static int __pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_delaunay = 0; + PyObject *__pyx_v_ivertex = 0; + int __pyx_r; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__delaunay,&__pyx_n_s__ivertex,0}; + __Pyx_RefNannySetupContext("__init__"); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__delaunay); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ivertex); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_delaunay = values[0]; + __pyx_v_ivertex = values[1]; + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + __pyx_v_delaunay = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_v_ivertex = PyTuple_GET_ITEM(__pyx_args, 1); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("scipy.spatial.qhull.RidgeIter2D.__init__"); + return -1; + __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_delaunay); + __Pyx_INCREF(__pyx_v_ivertex); + + + ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info = NULL; + + + __pyx_t_1 = PyObject_GetAttr(__pyx_v_delaunay, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_8)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L6; + } + __pyx_L6:; + + + __Pyx_INCREF(__pyx_v_delaunay); + __Pyx_GIVEREF(__pyx_v_delaunay); + __Pyx_GOTREF(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay); + __Pyx_DECREF(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay); + ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay = __pyx_v_delaunay; + + + ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_delaunay, 0, 1); + + + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_ivertex); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init((&((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it), ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info, __pyx_t_4); + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("scipy.spatial.qhull.RidgeIter2D.__init__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_delaunay); + __Pyx_DECREF(__pyx_v_ivertex); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + + +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, PyObject *unused); +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, PyObject *unused) { + PyObject *__pyx_r = NULL; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__del__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); + + + __pyx_t_1 = (((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info != NULL); + if (__pyx_t_1) { + + + free(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info); + + + ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info = NULL; + goto __pyx_L5; + } + __pyx_L5:; + + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay); + __Pyx_DECREF(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay); + ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay = Py_None; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + + +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___iter__(PyObject *__pyx_v_self); +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__iter__"); + + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + + +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___next__(PyObject *__pyx_v_self); +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___next__(PyObject *__pyx_v_self) { + PyObject *__pyx_v_ret; + PyObject *__pyx_r = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__next__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); + __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None); + + + __pyx_t_1 = (((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.index == -1); + if (__pyx_t_1) { + + + __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + goto __pyx_L5; + } + __pyx_L5:; + + + __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.triangle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_v_ret); + __pyx_v_ret = __pyx_t_6; + __pyx_t_6 = 0; + + + __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next((&((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it)); + + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("scipy.spatial.qhull.RidgeIter2D.__next__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_DECREF(__pyx_v_ret); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + + static int __pyx_f_5scipy_7spatial_5qhull__is_point_fully_outside(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *__pyx_v_d, double *__pyx_v_x, double __pyx_v_eps) { int __pyx_v_i; int __pyx_r; @@ -3665,11 +4021,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -3681,7 +4037,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.__init__"); return NULL; @@ -3693,14 +4049,14 @@ __pyx_v_paraboloid_shift = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3730,20 +4086,20 @@ __pyx_v_paraboloid_shift = __pyx_t_6; __pyx_t_6 = 0; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_vertices); __pyx_v_vertices = __pyx_t_2; @@ -3763,87 +4119,87 @@ } - __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -3885,22 +4241,22 @@ __Pyx_INCREF(__pyx_v_self); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -3908,13 +4264,13 @@ __Pyx_GIVEREF(__pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5; } @@ -3922,7 +4278,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -3994,62 +4350,62 @@ __pyx_bstruct_arr.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4066,7 +4422,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_arr)); @@ -4074,9 +4430,9 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4093,7 +4449,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -4101,16 +4457,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nsimplex = __pyx_t_7; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_7; @@ -4138,7 +4494,7 @@ } else if (unlikely(__pyx_t_16 >= __pyx_bshape_1_vertices)) __pyx_t_17 = 1; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_ivertex = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_15, __pyx_bstride_0_vertices, __pyx_t_16, __pyx_bstride_1_vertices)); @@ -4151,7 +4507,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_arr)) __pyx_t_18 = 0; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_17, __pyx_bstride_0_arr)) == -1); if (__pyx_t_2) { @@ -4165,7 +4521,7 @@ } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_arr)) __pyx_t_19 = 0; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_18, __pyx_bstride_0_arr) = __pyx_v_isimplex; goto __pyx_L10; @@ -4179,7 +4535,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4284,9 +4640,9 @@ __pyx_bstruct_vertices.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4303,7 +4659,7 @@ } __pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_neighbors)); @@ -4311,9 +4667,9 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4330,7 +4686,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -4338,16 +4694,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_3; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nsimplex = __pyx_t_3; @@ -4355,16 +4711,16 @@ __pyx_v_msize = 10; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -4372,15 +4728,15 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_1 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -4390,7 +4746,7 @@ __pyx_t_1 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4407,7 +4763,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_INCREF(__pyx_v_out); @@ -4500,7 +4856,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_INCREF(Py_None); @@ -4511,13 +4867,13 @@ __pyx_v_msize = ((2 * __pyx_v_msize) + 1); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -4525,14 +4881,14 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_10 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4549,7 +4905,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_INCREF(__pyx_v_out); @@ -4581,7 +4937,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_INCREF(Py_None); @@ -4589,13 +4945,13 @@ __pyx_v_arr = ((PyArrayObject *)Py_None); - __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); @@ -4603,7 +4959,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4697,7 +5053,7 @@ if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = __pyx_k_9; + values[2] = __pyx_k_10; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -4714,7 +5070,7 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -4723,13 +5079,13 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; __pyx_v_bruteforce = values[2]; } else { - __pyx_v_bruteforce = __pyx_k_9; + __pyx_v_bruteforce = __pyx_k_10; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_bruteforce = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4742,7 +5098,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.find_simplex"); return NULL; @@ -4758,17 +5114,17 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4777,72 +5133,72 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -4850,7 +5206,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4859,37 +5215,37 @@ __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4906,7 +5262,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -4917,66 +5273,66 @@ __pyx_v_start = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_eps = __pyx_t_11; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4986,7 +5342,7 @@ __pyx_t_12 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5003,7 +5359,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5014,7 +5370,7 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 1, 0); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { @@ -5034,7 +5390,7 @@ } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_out_)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out_.buf, __pyx_t_15, __pyx_bstride_0_out_) = __pyx_v_isimplex; } @@ -5059,7 +5415,7 @@ } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_out_)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_) = __pyx_v_isimplex; } @@ -5071,16 +5427,16 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5186,11 +5542,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -5202,7 +5558,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.plane_distance"); return NULL; @@ -5217,72 +5573,72 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_12)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_1; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5290,7 +5646,7 @@ __Pyx_GIVEREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5299,37 +5655,37 @@ __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5346,7 +5702,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -5357,16 +5713,16 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 0, 0); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5374,21 +5730,21 @@ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5398,7 +5754,7 @@ __pyx_t_11 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5415,7 +5771,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bstride_1_out_ = __pyx_bstruct_out_.strides[1]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; __pyx_bshape_1_out_ = __pyx_bstruct_out_.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5449,7 +5805,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_out_)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_, __pyx_t_17, __pyx_bstride_1_out_) = __pyx_f_5scipy_7spatial_5qhull__distplane(__pyx_v_info, __pyx_v_j, __pyx_v_z); } @@ -5460,27 +5816,27 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5555,11 +5911,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_x = values[1]; @@ -5571,7 +5927,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.lift_points"); return NULL; @@ -5579,48 +5935,48 @@ __pyx_v_z = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5630,9 +5986,9 @@ __pyx_t_5 = 0; - __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -5640,23 +5996,23 @@ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -5664,14 +6020,14 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -5679,20 +6035,20 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_2, 0, Py_Ellipsis); @@ -5700,13 +6056,13 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5765,11 +6121,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_xi = values[1]; @@ -5781,7 +6137,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.tsearch"); return NULL; @@ -5789,14 +6145,14 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5895,15 +6251,15 @@ __pyx_bstruct_max_bound.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -5913,15 +6269,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -5931,15 +6287,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_neighbors = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_neighbors.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; } @@ -5949,15 +6305,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_equations, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_equations = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_equations.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_equations = __pyx_bstruct_equations.strides[0]; __pyx_bstride_1_equations = __pyx_bstruct_equations.strides[1]; __pyx_bshape_0_equations = __pyx_bstruct_equations.shape[0]; __pyx_bshape_1_equations = __pyx_bstruct_equations.shape[1]; } @@ -5967,15 +6323,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_min_bound, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_min_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_min_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_min_bound = __pyx_bstruct_min_bound.strides[0]; __pyx_bshape_0_min_bound = __pyx_bstruct_min_bound.shape[0]; } @@ -5985,15 +6341,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_max_bound, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_max_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_max_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_max_bound = __pyx_bstruct_max_bound.strides[0]; __pyx_bshape_0_max_bound = __pyx_bstruct_max_bound.shape[0]; } @@ -6027,16 +6383,16 @@ __pyx_v_info->equations = ((double *)__pyx_v_equations->data); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_scale = __pyx_t_8; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_shift = __pyx_t_8; @@ -6045,9 +6401,9 @@ if (__pyx_t_9) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6064,7 +6420,7 @@ } __pyx_bstride_0_transform = __pyx_bstruct_transform.strides[0]; __pyx_bstride_1_transform = __pyx_bstruct_transform.strides[1]; __pyx_bstride_2_transform = __pyx_bstruct_transform.strides[2]; __pyx_bshape_0_transform = __pyx_bstruct_transform.shape[0]; __pyx_bshape_1_transform = __pyx_bstruct_transform.shape[1]; __pyx_bshape_2_transform = __pyx_bstruct_transform.shape[2]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_transform)); @@ -6087,9 +6443,9 @@ if (__pyx_t_9) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6106,7 +6462,7 @@ } __pyx_bstride_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.strides[0]; __pyx_bshape_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertex_to_simplex)); @@ -6244,9 +6600,9 @@ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_12)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_12)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6272,9 +6628,9 @@ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_14)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_14)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_14)); __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6405,9 +6761,9 @@ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_14)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_14)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_15)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_15)); __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6541,7 +6897,7 @@ __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_15), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6870,9 +7226,9 @@ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_16)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_16)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_17)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_17)); __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -6909,9 +7265,9 @@ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_14)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_14)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_15)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_15)); __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6964,9 +7320,9 @@ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_kp_u_17)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_17)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_17)); + __Pyx_INCREF(((PyObject *)__pyx_kp_u_18)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_18)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_18)); __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -7206,7 +7562,7 @@ { - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_15), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -7335,6 +7691,196 @@ return __pyx_r; } +static PyObject *__pyx_tp_new_5scipy_7spatial_5qhull_RidgeIter2D(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *p; + PyObject *o = (*t->tp_alloc)(t, 0); + if (!o) return 0; + p = ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)o); + p->delaunay = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_5scipy_7spatial_5qhull_RidgeIter2D(PyObject *o) { + struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *p = (struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)o; + Py_XDECREF(p->delaunay); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_5scipy_7spatial_5qhull_RidgeIter2D(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *p = (struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)o; + if (p->delaunay) { + e = (*v)(p->delaunay, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_5scipy_7spatial_5qhull_RidgeIter2D(PyObject *o) { + struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *p = (struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)o; + PyObject* tmp; + tmp = ((PyObject*)p->delaunay); + p->delaunay = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static struct PyMethodDef __pyx_methods_5scipy_7spatial_5qhull_RidgeIter2D[] = { + {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_RidgeIter2D = { + 0, + 0, + 0, + #if PY_MAJOR_VERSION < 3 + 0, + #endif + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + #if PY_MAJOR_VERSION < 3 + 0, + #endif + 0, + #if PY_MAJOR_VERSION >= 3 + 0, + #else + 0, + #endif + 0, + #if PY_MAJOR_VERSION < 3 + 0, + #endif + #if PY_MAJOR_VERSION < 3 + 0, + #endif + 0, + 0, + 0, + #if PY_MAJOR_VERSION < 3 + 0, + #endif + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + 0, + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_RidgeIter2D = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +}; + +static PyMappingMethods __pyx_tp_as_mapping_RidgeIter2D = { + 0, + 0, + 0, +}; + +static PyBufferProcs __pyx_tp_as_buffer_RidgeIter2D = { + #if PY_MAJOR_VERSION < 3 + 0, + #endif + #if PY_MAJOR_VERSION < 3 + 0, + #endif + #if PY_MAJOR_VERSION < 3 + 0, + #endif + #if PY_MAJOR_VERSION < 3 + 0, + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, + #endif +}; + +PyTypeObject __pyx_type_5scipy_7spatial_5qhull_RidgeIter2D = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("scipy.spatial.qhull.RidgeIter2D"), + sizeof(struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D), + 0, + __pyx_tp_dealloc_5scipy_7spatial_5qhull_RidgeIter2D, + 0, + 0, + 0, + 0, + 0, + &__pyx_tp_as_number_RidgeIter2D, + &__pyx_tp_as_sequence_RidgeIter2D, + &__pyx_tp_as_mapping_RidgeIter2D, + 0, + 0, + 0, + 0, + 0, + &__pyx_tp_as_buffer_RidgeIter2D, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + 0, + __pyx_tp_traverse_5scipy_7spatial_5qhull_RidgeIter2D, + __pyx_tp_clear_5scipy_7spatial_5qhull_RidgeIter2D, + 0, + 0, + __pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___iter__, + __pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___next__, + __pyx_methods_5scipy_7spatial_5qhull_RidgeIter2D, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___init__, + 0, + __pyx_tp_new_5scipy_7spatial_5qhull_RidgeIter2D, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + #if PY_VERSION_HEX >= 0x02060000 + 0, + #endif +}; + static struct PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("_construct_delaunay"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull__construct_delaunay, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_7spatial_5qhull__construct_delaunay)}, {__Pyx_NAMESTR("_qhull_get_facet_array"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull__qhull_get_facet_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5scipy_7spatial_5qhull__qhull_get_facet_array)}, @@ -7349,7 +7895,7 @@ static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("qhull"), - __Pyx_DOCSTR(__pyx_k_18), + __Pyx_DOCSTR(__pyx_k_19), -1, __pyx_methods , NULL, @@ -7360,27 +7906,29 @@ #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, - {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0}, + {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0}, {&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0}, {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0}, {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0}, {&__pyx_kp_u_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 1, 0, 0}, - {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, + {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_n_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 1}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1}, + {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, + {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1}, {&__pyx_n_s__Delaunay, __pyx_k__Delaunay, sizeof(__pyx_k__Delaunay), 0, 0, 1, 1}, {&__pyx_n_s__Lock, __pyx_k__Lock, sizeof(__pyx_k__Lock), 0, 0, 1, 1}, {&__pyx_n_s__NOerrexit, __pyx_k__NOerrexit, sizeof(__pyx_k__NOerrexit), 0, 0, 1, 1}, {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__SCALElast, __pyx_k__SCALElast, sizeof(__pyx_k__SCALElast), 0, 0, 1, 1}, + {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1}, {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, @@ -7400,11 +7948,11 @@ {&__pyx_n_s__byteorder, __pyx_k__byteorder, sizeof(__pyx_k__byteorder), 0, 0, 1, 1}, {&__pyx_n_s__convex_hull, __pyx_k__convex_hull, sizeof(__pyx_k__convex_hull), 0, 0, 1, 1}, {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1}, + {&__pyx_n_s__delaunay, __pyx_k__delaunay, sizeof(__pyx_k__delaunay), 0, 0, 1, 1}, {&__pyx_n_s__descr, __pyx_k__descr, sizeof(__pyx_k__descr), 0, 0, 1, 1}, {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1}, {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1}, {&__pyx_n_s__e, __pyx_k__e, sizeof(__pyx_k__e), 0, 0, 1, 1}, - {&__pyx_n_s__edge, __pyx_k__edge, sizeof(__pyx_k__edge), 0, 0, 1, 1}, {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1}, {&__pyx_n_s__eps, __pyx_k__eps, sizeof(__pyx_k__eps), 0, 0, 1, 1}, {&__pyx_n_s__equations, __pyx_k__equations, sizeof(__pyx_k__equations), 0, 0, 1, 1}, @@ -7416,9 +7964,12 @@ {&__pyx_n_s__finfo, __pyx_k__finfo, sizeof(__pyx_k__finfo), 0, 0, 1, 1}, {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1}, {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1}, + {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1}, {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1}, + {&__pyx_n_s__it, __pyx_k__it, sizeof(__pyx_k__it), 0, 0, 1, 1}, {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1}, + {&__pyx_n_s__ivertex, __pyx_k__ivertex, sizeof(__pyx_k__ivertex), 0, 0, 1, 1}, {&__pyx_n_s__last_high, __pyx_k__last_high, sizeof(__pyx_k__last_high), 0, 0, 1, 1}, {&__pyx_n_s__last_low, __pyx_k__last_low, sizeof(__pyx_k__last_low), 0, 0, 1, 1}, {&__pyx_n_s__last_newhigh, __pyx_k__last_newhigh, sizeof(__pyx_k__last_newhigh), 0, 0, 1, 1}, @@ -7454,10 +8005,11 @@ {&__pyx_n_s__release, __pyx_k__release, sizeof(__pyx_k__release), 0, 0, 1, 1}, {&__pyx_n_s__reshape, __pyx_k__reshape, sizeof(__pyx_k__reshape), 0, 0, 1, 1}, {&__pyx_n_s__resize, __pyx_k__resize, sizeof(__pyx_k__resize), 0, 0, 1, 1}, + {&__pyx_n_s__restart, __pyx_k__restart, sizeof(__pyx_k__restart), 0, 0, 1, 1}, {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1}, {&__pyx_n_s__simplicial, __pyx_k__simplicial, sizeof(__pyx_k__simplicial), 0, 0, 1, 1}, - {&__pyx_n_s__start_edge, __pyx_k__start_edge, sizeof(__pyx_k__start_edge), 0, 0, 1, 1}, + {&__pyx_n_s__start_index, __pyx_k__start_index, sizeof(__pyx_k__start_index), 0, 0, 1, 1}, {&__pyx_n_s__start_triangle, __pyx_k__start_triangle, sizeof(__pyx_k__start_triangle), 0, 0, 1, 1}, {&__pyx_n_s__strides, __pyx_k__strides, sizeof(__pyx_k__strides), 0, 0, 1, 1}, {&__pyx_n_s__suboffsets, __pyx_k__suboffsets, sizeof(__pyx_k__suboffsets), 0, 0, 1, 1}, @@ -7480,8 +8032,8 @@ {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 @@ -7489,6 +8041,7 @@ #else __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif + __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -7547,7 +8100,7 @@ #endif #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("qhull"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_18), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("qhull"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_19), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -7580,6 +8133,9 @@ if (__Pyx_ExportFunction("_RidgeIter2D_init", (void (*)(void))__pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init, "void (__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *, __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ExportFunction("_RidgeIter2D_next", (void (*)(void))__pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next, "void (__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "RidgeIter2D", (PyObject *)&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5scipy_7spatial_5qhull_RidgeIter2D = &__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D; __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7626,128 +8182,128 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); - if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Delaunay, "scipy.spatial.qhull"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Delaunay, "scipy.spatial.qhull"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay___init__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay___init__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_k_9 = __pyx_t_2; + __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Delaunay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Delaunay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; From scipy-svn at scipy.org Thu Sep 2 05:00:05 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 2 Sep 2010 04:00:05 -0500 (CDT) Subject: [Scipy-svn] r6665 - trunk/scipy/spatial Message-ID: <20100902090005.5F79439CAEC@scipy.org> Author: ptvirtan Date: 2010-09-02 04:00:05 -0500 (Thu, 02 Sep 2010) New Revision: 6665 Modified: trunk/scipy/spatial/setup.py Log: BUG: spatial: get lapack for qhull build properly Modified: trunk/scipy/spatial/setup.py =================================================================== --- trunk/scipy/spatial/setup.py 2010-09-01 20:30:46 UTC (rev 6664) +++ trunk/scipy/spatial/setup.py 2010-09-02 09:00:05 UTC (rev 6665) @@ -20,11 +20,12 @@ #extra_compiler_args=['-fno-strict-aliasing'], ) - lapack = get_info('lapack_opt') + lapack = dict(get_info('lapack_opt')) + libs = ['qhull'] + lapack.pop('libraries') config.add_extension('qhull', sources=['qhull.c'], - libraries=['qhull'] + lapack['libraries'], - ) + libraries=libs, + **lapack) config.add_extension('ckdtree', sources=['ckdtree.c']) # FIXME: cython From scipy-svn at scipy.org Thu Sep 2 10:56:30 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 2 Sep 2010 09:56:30 -0500 (CDT) Subject: [Scipy-svn] r6667 - trunk/scipy/spatial Message-ID: <20100902145630.6B77A39CD4B@scipy.org> Author: rgommers Date: 2010-09-02 09:56:30 -0500 (Thu, 02 Sep 2010) New Revision: 6667 Modified: trunk/scipy/spatial/SConscript trunk/scipy/spatial/setup.py Log: BUG: fix qhull build errors. Modified: trunk/scipy/spatial/SConscript =================================================================== --- trunk/scipy/spatial/SConscript 2010-09-02 14:55:56 UTC (rev 6666) +++ trunk/scipy/spatial/SConscript 2010-09-02 14:56:30 UTC (rev 6667) @@ -12,10 +12,10 @@ join('src', 'distance.c')]) # Build qhull -src = [pjoin('qhull', 'src', s) for s in [ +src = [join('qhull', 'src', s) for s in [ 'geom.c', 'geom2.c', 'global.c', 'io.c', 'mem.c', 'merge.c', 'poly.c', 'poly2.c', 'qset.c', 'user.c', 'stat.c', 'qhull.c']] qhullsrc = env.DistutilsStaticExtLibrary('qhullsrc', source=src) -env.NumpyPythonExtension('qhull', source = 'qhull.c', LIBS="qhullsrc") +env.NumpyPythonExtension('qhull', source = 'qhull.c', LIBS=qhullsrc) Modified: trunk/scipy/spatial/setup.py =================================================================== --- trunk/scipy/spatial/setup.py 2010-09-02 14:55:56 UTC (rev 6666) +++ trunk/scipy/spatial/setup.py 2010-09-02 14:56:30 UTC (rev 6667) @@ -21,7 +21,10 @@ ) lapack = dict(get_info('lapack_opt')) - libs = ['qhull'] + lapack.pop('libraries') + try: + libs = ['qhull'] + lapack.pop('libraries') + except KeyError: + libs = ['qhull'] config.add_extension('qhull', sources=['qhull.c'], libraries=libs, From scipy-svn at scipy.org Thu Sep 2 10:55:56 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 2 Sep 2010 09:55:56 -0500 (CDT) Subject: [Scipy-svn] r6666 - trunk/scipy/signal Message-ID: <20100902145556.D646239CD46@scipy.org> Author: rgommers Date: 2010-09-02 09:55:56 -0500 (Thu, 02 Sep 2010) New Revision: 6666 Modified: trunk/scipy/signal/filter_design.py trunk/scipy/signal/signaltools.py trunk/scipy/signal/windows.py Log: DOC: merge doc wiki edits for scipy.signal. Modified: trunk/scipy/signal/filter_design.py =================================================================== --- trunk/scipy/signal/filter_design.py 2010-09-02 09:00:05 UTC (rev 6665) +++ trunk/scipy/signal/filter_design.py 2010-09-02 14:55:56 UTC (rev 6666) @@ -94,14 +94,18 @@ b : ndarray numerator of a linear filter a : ndarray - numerator of a linear filter + denominator of a linear filter worN : {None, int}, optional If None, then compute at 512 frequencies around the unit circle. If a single integer, the compute at that many frequencies. Otherwise, compute the response at frequencies given in worN - whole : {0,1}, optional + whole : bool, optional Normally, frequencies are computed from 0 to pi (upper-half of - unit-circle. If whole is non-zero compute frequencies from 0 to 2*pi. + unit-circle. If whole is False, compute frequencies from 0 to 2*pi. + plot : callable + A callable that takes two arguments. If given, the return parameters + `w` and `h` are passed to plot. Useful for plotting the frequency + response inside `freqz`. Returns ------- @@ -110,9 +114,14 @@ h : ndarray The frequency response. + Notes + ----- + Using Matplotlib's "plot" function as the callable for `plot` produces + unexpected results, this plots the real part of the complex transfer + function, not the magnitude. + Examples -------- - >>> b = firwin(80, 0.5, window=('kaiser', 8)) >>> h, w = freqz(b) Modified: trunk/scipy/signal/signaltools.py =================================================================== --- trunk/scipy/signal/signaltools.py 2010-09-02 09:00:05 UTC (rev 6665) +++ trunk/scipy/signal/signaltools.py 2010-09-02 14:55:56 UTC (rev 6666) @@ -244,28 +244,54 @@ """ Perform an order filter on an N-dimensional array. - Description: + Perform an order filter on the array in. The domain argument acts as a + mask centered over each pixel. The non-zero elements of domain are + used to select elements surrounding each input pixel which are placed + in a list. The list is sorted, and the output for that pixel is the + element corresponding to rank in the sorted list. - Perform an order filter on the array in. The domain argument acts as a - mask centered over each pixel. The non-zero elements of domain are - used to select elements surrounding each input pixel which are placed - in a list. The list is sorted, and the output for that pixel is the - element corresponding to rank in the sorted list. - Parameters ---------- - in -- an N-dimensional input array. - domain -- a mask array with the same number of dimensions as in. Each - dimension should have an odd number of elements. - rank -- an non-negative integer which selects the element from the - sorted list (0 corresponds to the largest element, 1 is the - next largest element, etc.) + a : ndarray + The N-dimensional input array. + domain : array_like + A mask array with the same number of dimensions as `in`. + Each dimension should have an odd number of elements. + rank : int + A non-negative integer which selects the element from the + sorted list (0 corresponds to the smallest element, 1 is the + next smallest element, etc.). Returns ------- - out -- the results of the order filter in an array with the same - shape as in. + out : ndarray + The results of the order filter in an array with the same + shape as `in`. + Examples + -------- + >>> import scipy.signal + >>> x = np.arange(25).reshape(5, 5) + >>> domain = np.identity(3) + >>> x + array([[ 0, 1, 2, 3, 4], + [ 5, 6, 7, 8, 9], + [10, 11, 12, 13, 14], + [15, 16, 17, 18, 19], + [20, 21, 22, 23, 24]]) + >>> sp.signal.order_filter(x, domain, 0) + array([[ 0., 0., 0., 0., 0.], + [ 0., 0., 1., 2., 0.], + [ 0., 5., 6., 7., 0.], + [ 0., 10., 11., 12., 0.], + [ 0., 0., 0., 0., 0.]]) + >>> sp.signal.order_filter(x, domain, 2) + array([[ 6., 7., 8., 9., 4.], + [ 11., 12., 13., 14., 9.], + [ 16., 17., 18., 19., 14.], + [ 21., 22., 23., 24., 19.], + [ 20., 21., 22., 23., 24.]]) + """ domain = asarray(domain) size = domain.shape @@ -277,26 +303,28 @@ def medfilt(volume,kernel_size=None): - """Perform a median filter on an N-dimensional array. + """ + Perform a median filter on an N-dimensional array. - Description: - Apply a median filter to the input array using a local window-size given by kernel_size. - Inputs: + Parameters + ---------- + volume : array_like + An N-dimensional input array. + kernel_size : array_like, optional + A scalar or an N-length list giving the size of the median filter + window in each dimension. Elements of `kernel_size` should be odd. + If `kernel_size` is a scalar, then this scalar is used as the size in + each dimension. Default size is 3 for each dimension. - in -- An N-dimensional input array. - kernel_size -- A scalar or an N-length list giving the size of the - median filter window in each dimension. Elements of - kernel_size should be odd. If kernel_size is a scalar, - then this scalar is used as the size in each dimension. + Returns + ------- + out : ndarray + An array the same size as input containing the median filtered + result. - Outputs: (out,) - - out -- An array the same size as input containing the median filtered - result. - """ volume = atleast_1d(volume) if kernel_size is None: @@ -321,24 +349,26 @@ """ Perform a Wiener filter on an N-dimensional array. - Description: + Apply a Wiener filter to the N-dimensional array `im`. - Apply a Wiener filter to the N-dimensional array in. + Parameters + ---------- + im : ndarray + An N-dimensional array. + mysize : int or arraylike, optional + A scalar or an N-length list giving the size of the Wiener filter + window in each dimension. Elements of mysize should be odd. + If mysize is a scalar, then this scalar is used as the size + in each dimension. + noise : float, optional + The noise-power to use. If None, then noise is estimated as the + average of the local variance of the input. - Inputs: + Returns + ------- + out : ndarray + Wiener filtered result with the same shape as `im`. - in -- an N-dimensional array. - kernel_size -- A scalar or an N-length list giving the size of the - Wiener filter window in each dimension. Elements of - kernel_size should be odd. If kernel_size is a scalar, - then this scalar is used as the size in each dimension. - noise -- The noise-power to use. If None, then noise is estimated as - the average of the local variance of the input. - - Outputs: (out,) - - out -- Wiener filtered result with the same shape as in. - """ im = asarray(im) if mysize is None: @@ -456,26 +486,29 @@ return sigtools._convolve2d(in1, in2, 0,val,bval,fillvalue) def medfilt2d(input, kernel_size=3): - """Median filter two 2-dimensional arrays. + """ + Median filter a 2-dimensional array. - Description: - Apply a median filter to the input array using a local window-size given by kernel_size (must be odd). - Inputs: + Parameters + ---------- + input : array_like + A 2-dimensional input array. + kernel_size : array_like, optional + A scalar or a list of length 2, giving the size of the + median filter window in each dimension. Elements of + `kernel_size` should be odd. If `kernel_size` is a scalar, + then this scalar is used as the size in each dimension. + Default is a kernel of size (3, 3). - in -- An 2 dimensional input array. - kernel_size -- A scalar or an length-2 list giving the size of the - median filter window in each dimension. Elements of - kernel_size should be odd. If kernel_size is a scalar, - then this scalar is used as the size in each dimension. + Returns + ------- + out : ndarray + An array the same size as input containing the median filtered + result. - Outputs: (out,) - - out -- An array the same size as input containing the median filtered - result. - """ image = asarray(input) if kernel_size is None: @@ -493,36 +526,86 @@ def remez(numtaps, bands, desired, weight=None, Hz=1, type='bandpass', maxiter=25, grid_density=16): - """Calculate the minimax optimal filter using Remez exchange algorithm. + """ + Calculate the minimax optimal filter using the Remez exchange algorithm. - Description: - Calculate the filter-coefficients for the finite impulse response (FIR) filter whose transfer function minimizes the maximum error - between the desired gain and the realized gain in the specified bands - using the remez exchange algorithm. + between the desired gain and the realized gain in the specified + frequency bands using the Remez exchange algorithm. - Inputs: + Parameters + ---------- + numtaps : int + The desired number of taps in the filter. The number of taps is + the number of terms in the filter, or the filter order plus one. + bands : array_like + A monotonic sequence containing the band edges in Hz. + All elements must be non-negative and less than half the sampling + frequency as given by `Hz`. + desired : array_like + A sequence half the size of bands containing the desired gain + in each of the specified bands. + weight : array_like, optional + A relative weighting to give to each band region. The length of + `weight` has to be half the length of `bands`. + Hz : scalar, optional + The sampling frequency in Hz. Default is 1. + type : {'bandpass', 'differentiator', 'hilbert'}, optional + The type of filter: - numtaps -- The desired number of taps in the filter. - bands -- A montonic sequence containing the band edges. All elements - must be non-negative and less than 1/2 the sampling frequency - as given by Hz. - desired -- A sequency half the size of bands containing the desired gain - in each of the specified bands - weight -- A relative weighting to give to each band region. - type --- The type of filter: - 'bandpass' : flat response in bands. - 'differentiator' : frequency proportional response in bands. - 'hilbert' : filter with odd symmetry, that is, type III - (for even order) or type IV (for odd order) - linear phase filters + 'bandpass' : flat response in bands. This is the default. - Outputs: (out,) + 'differentiator' : frequency proportional response in bands. - out -- A rank-1 array containing the coefficients of the optimal - (in a minimax sense) filter. + 'hilbert' : filter with odd symmetry, that is, type III + (for even order) or type IV (for odd order) + linear phase filters. + maxiter : int, optional + Maximum number of iterations of the algorithm. Default is 25. + grid_density : int, optional + Grid density. The dense grid used in `remez` is of size + ``(numtaps + 1) * grid_density``. Default is 16. + + Returns + ------- + out : ndarray + A rank-1 array containing the coefficients of the optimal + (in a minimax sense) filter. + + See Also + -------- + freqz : Compute the frequency response of a digital filter. + + References + ---------- + .. [1] J. H. McClellan and T. W. Parks, "A unified approach to the + design of optimum FIR linear phase digital filters", + IEEE Trans. Circuit Theory, vol. CT-20, pp. 697-701, 1973. + .. [2] J. H. McClellan, T. W. Parks and L. R. Rabiner, "A Computer + Program for Designing Optimum FIR Linear Phase Digital + Filters", IEEE Trans. Audio Electroacoust., vol. AU-21, + pp. 506-525, 1973. + + Examples + -------- + We want to construct a filter with a passband at 0.2-0.4 Hz, and + stop bands at 0-0.1 Hz and 0.45-0.5 Hz. Note that this means that the + behavior in the frequency ranges between those bands is unspecified and + may overshoot. + + >>> bpass = sp.signal.remez(72, [0, 0.1, 0.2, 0.4, 0.45, 0.5], [0, 1, 0]) + >>> freq, response = sp.signal.freqz(bpass) + >>> ampl = np.abs(response) + + >>> import matplotlib.pyplot as plt + >>> fig = plt.figure() + >>> ax1 = fig.add_subplot(111) + >>> ax1.semilogy(freq/(2*np.pi), ampl, 'b-') # freq in Hz + [] + >>> plt.show() + """ # Convert type try: @@ -680,23 +763,24 @@ def hilbert(x, N=None, axis=-1): - """Compute the analytic signal. + """ + Compute the analytic signal. The transformation is done along the last axis by default. Parameters ---------- - x : array-like + x : array_like Signal data N : int, optional - Number of Fourier components. Default: ``x.shape[axis]`` + Number of Fourier components. Default: ``x.shape[axis]`` axis : int, optional - + Axis along which to do the transformation. Default: -1. Returns ------- xa : ndarray - Analytic signal of `x`, of each 1d array along axis + Analytic signal of `x`, of each 1-D array along `axis` Notes ----- @@ -705,9 +789,9 @@ x_a = F^{-1}(F(x) 2U) = x + i y where ``F`` is the Fourier transform, ``U`` the unit step function, - and ``y`` the Hilbert transform of ``x``. [1] + and ``y`` the Hilbert transform of ``x``. [1]_ - changes in scipy 0.8.0: new axis argument, new default axis=-1 + `axis` argument is new in scipy 0.8.0. References ---------- @@ -806,20 +890,46 @@ return take(p,indx,0), indx def unique_roots(p,tol=1e-3,rtype='min'): - """Determine the unique roots and their multiplicities in two lists + """ + Determine unique roots and their multiplicities from a list of roots. - Inputs: + Parameters + ---------- + p : array_like + The list of roots. + tol : float, optional + The tolerance for two roots to be considered equal. Default is 1e-3. + rtype : {'max', 'min, 'avg'}, optional + How to determine the returned root if multiple roots are within + `tol` of each other. - p -- The list of roots - tol --- The tolerance for two roots to be considered equal. - rtype --- How to determine the returned root from the close - ones: 'max': pick the maximum - 'min': pick the minimum - 'avg': average roots - Outputs: (pout, mult) + - 'max': pick the maximum of those roots. + - 'min': pick the minimum of those roots. + - 'avg': take the average of those roots. - pout -- The list of sorted roots - mult -- The multiplicity of each root + Returns + ------- + pout : ndarray + The list of unique roots, sorted from low to high. + mult : ndarray + The multiplicity of each root. + + Notes + ----- + This utility function is not specific to roots but can be used for any + sequence of values for which uniqueness and multiplicity has to be + determined. For a more general routine, see `numpy.unique`. + + Examples + -------- + >>> vals = [0, 1.3, 1.31, 2.8, 1.25, 2.2, 10.3] + >>> uniq, mult = sp.signal.unique_roots(vals, tol=2e-2, rtype='avg') + + Check which roots have multiplicity larger than 1: + + >>> uniq[mult > 1] + array([ 1.305]) + """ if rtype in ['max','maximum']: comproot = np.maximum @@ -905,20 +1015,22 @@ return b, a def residue(b,a,tol=1e-3,rtype='avg'): - """Compute partial-fraction expansion of b(s) / a(s). + """ + Compute partial-fraction expansion of b(s) / a(s). - If M = len(b) and N = len(a) + If ``M = len(b)`` and ``N = len(a)``, then the partial-fraction + expansion H(s) is defined as:: - b(s) b[0] s**(M-1) + b[1] s**(M-2) + ... + b[M-1] - H(s) = ------ = ---------------------------------------------- - a(s) a[0] s**(N-1) + a[1] s**(N-2) + ... + a[N-1] + b(s) b[0] s**(M-1) + b[1] s**(M-2) + ... + b[M-1] + H(s) = ------ = ---------------------------------------------- + a(s) a[0] s**(N-1) + a[1] s**(N-2) + ... + a[N-1] - r[0] r[1] r[-1] - = -------- + -------- + ... + --------- + k(s) - (s-p[0]) (s-p[1]) (s-p[-1]) + r[0] r[1] r[-1] + = -------- + -------- + ... + --------- + k(s) + (s-p[0]) (s-p[1]) (s-p[-1]) - If there are any repeated roots (closer than tol), then the partial - fraction expansion has terms like + If there are any repeated roots (closer together than `tol`), then H(s) + has terms like:: r[i] r[i+1] r[i+n-1] -------- + ----------- + ... + ----------- @@ -927,15 +1039,15 @@ Returns ------- r : ndarray - Residues + Residues. p : ndarray - Poles + Poles. k : ndarray Coefficients of the direct polynomial term. See Also -------- - invres, poly, polyval, unique_roots + invres, numpy.poly, unique_roots """ @@ -1090,56 +1202,63 @@ def resample(x,num,t=None,axis=0,window=None): - """Resample to num samples using Fourier method along the given axis. + """ + Resample `x` to `num` samples using Fourier method along the given axis. - The resampled signal starts at the same value of x but is sampled - with a spacing of len(x) / num * (spacing of x). Because a + The resampled signal starts at the same value as `x` but is sampled + with a spacing of `len(x) / num * (spacing of x)`. Because a Fourier method is used, the signal is assumed periodic. - Window controls a Fourier-domain window that tapers the Fourier - spectrum before zero-padding to alleviate ringing in the resampled - values for sampled signals you didn't intend to be interpreted as - band-limited. + Parameters + ---------- + x : array_like + The data to be resampled. + num : int + The number of samples in the resampled signal. + t : array_like, optional + If `t` is given, it is assumed to be the sample positions + associated with the signal data in `x`. + axis : int, optional + The axis of `x` that is resampled. Default is 0. + window : array_like, callable, string, float, or tuple, optional + Specifies the window applied to the signal in the Fourier + domain. See below for details. - If window is a function, then it is called with a vector of inputs - indicating the frequency bins (i.e. fftfreq(x.shape[axis]) ) + Returns + ------- - If window is an array of the same length as x.shape[axis] it is + resampled_x or (resampled_x, resampled_t) + Either the resampled array, or, if `t` was given, a tuple + containing the resampled array and the corresponding resampled + positions. + + Notes + ----- + The argument `window` controls a Fourier-domain window that tapers + the Fourier spectrum before zero-padding to alleviate ringing in + the resampled values for sampled signals you didn't intend to be + interpreted as band-limited. + + If `window` is a function, then it is called with a vector of inputs + indicating the frequency bins (i.e. fftfreq(x.shape[axis]) ). + + If `window` is an array of the same length as `x.shape[axis]` it is assumed to be the window to be applied directly in the Fourier domain (with dc and low-frequency first). - If window is a string then use the named window. If window is a - float, then it represents a value of beta for a kaiser window. If - window is a tuple, then the first component is a string - representing the window, and the next arguments are parameters for - that window. - - Possible windows are: - 'flattop' -- 'flat', 'flt' - 'boxcar' -- 'ones', 'box' - 'triang' -- 'traing', 'tri' - 'parzen' -- 'parz', 'par' - 'bohman' -- 'bman', 'bmn' - 'blackmanharris' -- 'blackharr', 'bkh' - 'nuttall', -- 'nutl', 'nut' - 'barthann' -- 'brthan', 'bth' - 'blackman' -- 'black', 'blk' - 'hamming' -- 'hamm', 'ham' - 'bartlett' -- 'bart', 'brt' - 'hanning' -- 'hann', 'han' - ('kaiser', beta) -- 'ksr' - ('gaussian', std) -- 'gauss', 'gss' - ('general gauss', power, width) -- 'general', 'ggs' - ('slepian', width) -- 'slep', 'optimal', 'dss' + For any other type of `window`, the function `scipy.signal.get_window` + is called to generate the window. The first sample of the returned vector is the same as the first - sample of the input vector, the spacing between samples is changed - from dx to + sample of the input vector. The spacing between samples is changed + from dx to: dx * len(x) / num - If t is not None, then it represents the old sample positions, and the new - sample positions will be returned as well as the new samples. + If `t` is not None, then it represents the old sample positions, + and the new sample positions will be returned as well as the new + samples. + """ x = asarray(x) X = fft(x,axis=axis) @@ -1176,13 +1295,40 @@ return y, new_t def detrend(data, axis=-1, type='linear', bp=0): - """Remove linear trend along axis from data. + """ + Remove linear trend along axis from data. - If type is 'constant' then remove mean only. + Parameters + ---------- + data : array_like + The input data. + axis : int, optional + The axis along which to detrend the data. By default this is the + last axis (-1). + type : {'linear', 'constant'}, optional + The type of detrending. If ``type == 'linear'`` (default), + the result of a linear least-squares fit to `data` is subtracted + from `data`. + If ``type == 'constant'``, only the mean of `data` is subtracted. + bp : array_like of ints, optional + A sequence of break points. If given, an individual linear fit is + performed for each part of `data` between two break points. + Break points are specified as indices into `data`. - If bp is given, then it is a sequence of points at which to - break a piecewise-linear fit to the data. + Returns + ------- + ret : ndarray + The detrended input data. + Examples + -------- + >>> randgen = np.random.RandomState(9) + >>> npoints = 1e3 + >>> noise = randgen.randn(npoints) + >>> x = 3 + 2*np.linspace(0, 1, npoints) + noise + >>> (sp.signal.detrend(x) - noise).max() < 0.01 + True + """ if type not in ['linear','l','constant','c']: raise ValueError, "Trend type must be linear or constant" Modified: trunk/scipy/signal/windows.py =================================================================== --- trunk/scipy/signal/windows.py 2010-09-02 09:00:05 UTC (rev 6665) +++ trunk/scipy/signal/windows.py 2010-09-02 14:55:56 UTC (rev 6666) @@ -368,23 +368,54 @@ def get_window(window, Nx, fftbins=True): - """Return a window of length Nx and type window. + """ + Return a window of length `Nx` and type `window`. - If fftbins is True, create a "periodic" window ready to use with ifftshift - and be multiplied by the result of an fft (SEE ALSO fftfreq). + Parameters + ---------- + window : string, float, or tuple + The type of window to create. See below for more details. + Nx : int + The number of samples in the window. + fftbins : bool, optional + If True, create a "periodic" window ready to use with ifftshift + and be multiplied by the result of an fft (SEE ALSO fftfreq). - Window types: boxcar, triang, blackman, hamming, hanning, bartlett, - parzen, bohman, blackmanharris, nuttall, barthann, - kaiser (needs beta), gaussian (needs std), - general_gaussian (needs power, width), - slepian (needs width), chebwin (needs attenuation) + Notes + ----- + Window types: - If the window requires no parameters, then it can be a string. - If the window requires parameters, the window argument should be a tuple - with the first argument the string name of the window, and the next - arguments the needed parameters. - If window is a floating point number, it is interpreted as the beta - parameter of the kaiser window. + boxcar, triang, blackman, hamming, hanning, bartlett, + parzen, bohman, blackmanharris, nuttall, barthann, + kaiser (needs beta), gaussian (needs std), + general_gaussian (needs power, width), + slepian (needs width), chebwin (needs attenuation) + + + If the window requires no parameters, then `window` can be a string. + + If the window requires parameters, then `window` must be a tuple + with the first argument the string name of the window, and the next + arguments the needed parameters. + + If `window` is a floating point number, it is interpreted as the beta + parameter of the kaiser window. + + Each of the window types listed above is also the name of + a function that can be called directly to create a window of + that type. + + Examples + -------- + >>> get_window('triang', 7) + array([ 0.25, 0.5 , 0.75, 1. , 0.75, 0.5 , 0.25]) + >>> get_window(('kaiser', 4.0), 9) + array([ 0.08848053, 0.32578323, 0.63343178, 0.89640418, 1. , + 0.89640418, 0.63343178, 0.32578323, 0.08848053]) + >>> get_window(4.0, 9) + array([ 0.08848053, 0.32578323, 0.63343178, 0.89640418, 1. , + 0.89640418, 0.63343178, 0.32578323, 0.08848053]) + """ sym = not fftbins From scipy-svn at scipy.org Thu Sep 2 16:06:17 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 2 Sep 2010 15:06:17 -0500 (CDT) Subject: [Scipy-svn] r6668 - in trunk/scipy: interpolate spatial Message-ID: <20100902200617.1157C39CD41@scipy.org> Author: ptvirtan Date: 2010-09-02 15:06:16 -0500 (Thu, 02 Sep 2010) New Revision: 6668 Modified: trunk/scipy/interpolate/interpnd.pyx trunk/scipy/spatial/qhull.pyx Log: BUG: spatial/interpolate: use correct integer types in qhull/interpnd on 64-bit systems Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-09-02 14:56:30 UTC (rev 6667) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-02 20:06:16 UTC (rev 6668) @@ -199,7 +199,7 @@ cdef np.ndarray[np.${DTYPE}_t, ndim=2] values = self.values cdef np.ndarray[np.${DTYPE}_t, ndim=2] out cdef np.ndarray[np.double_t, ndim=2] points = self.points - cdef np.ndarray[np.int_t, ndim=2] vertices = self.tri.vertices + cdef np.ndarray[np.npy_int, ndim=2] vertices = self.tri.vertices cdef double c[NPY_MAXDIMS] cdef ${CDTYPE} fill_value cdef int i, j, k, m, ndim, isimplex, inside, start, nvalues @@ -812,7 +812,7 @@ cdef np.ndarray[np.${DTYPE}_t, ndim=3] grad = self.grad cdef np.ndarray[np.${DTYPE}_t, ndim=2] out cdef np.ndarray[np.double_t, ndim=2] points = self.points - cdef np.ndarray[np.int_t, ndim=2] vertices = self.tri.vertices + cdef np.ndarray[np.npy_int, ndim=2] vertices = self.tri.vertices cdef double c[NPY_MAXDIMS] cdef ${CDTYPE} f[NPY_MAXDIMS+1] cdef ${CDTYPE} df[2*NPY_MAXDIMS+2] Modified: trunk/scipy/spatial/qhull.pyx =================================================================== --- trunk/scipy/spatial/qhull.pyx 2010-09-02 14:56:30 UTC (rev 6667) +++ trunk/scipy/spatial/qhull.pyx 2010-09-02 20:06:16 UTC (rev 6668) @@ -212,12 +212,12 @@ cdef facetT* neighbor cdef vertexT *vertex cdef int i, j, point - cdef np.ndarray[np.int_t, ndim=2] vertices - cdef np.ndarray[np.int_t, ndim=2] neighbors + cdef np.ndarray[np.npy_int, ndim=2] vertices + cdef np.ndarray[np.npy_int, ndim=2] neighbors cdef np.ndarray[np.double_t, ndim=2] equations - cdef np.ndarray[np.int_t, ndim=1] id_map + cdef np.ndarray[np.npy_int, ndim=1] id_map - id_map = np.empty((qh_qh.facet_id,), dtype=np.int) + id_map = np.empty((qh_qh.facet_id,), dtype=np.intc) id_map.fill(-1) # Compute facet indices @@ -230,8 +230,8 @@ facet = facet.next # Allocate output - vertices = np.zeros((j, ndim+1), dtype=np.int) - neighbors = np.zeros((j, ndim+1), dtype=np.int) + vertices = np.zeros((j, ndim+1), dtype=np.intc) + neighbors = np.zeros((j, ndim+1), dtype=np.intc) equations = np.zeros((j, ndim+2), dtype=np.double) # Retrieve facet information @@ -273,7 +273,7 @@ @cython.boundscheck(False) def _get_barycentric_transforms(np.ndarray[np.double_t, ndim=2] points, - np.ndarray[np.int_t, ndim=2] vertices): + np.ndarray[np.npy_int, ndim=2] vertices): """ Compute barycentric affine coordinate transformations for given simplices. @@ -913,6 +913,7 @@ """ def __init__(self, points): + points = np.ascontiguousarray(points).astype(np.double) vertices, neighbors, equations, paraboloid_scale, paraboloid_shift = \ _construct_delaunay(points) @@ -961,11 +962,11 @@ :type: ndarray of int, shape (npoints,) """ cdef int isimplex, k, ivertex, nsimplex, ndim - cdef np.ndarray[np.int_t, ndim=2] vertices - cdef np.ndarray[np.int_t, ndim=1] arr + cdef np.ndarray[np.npy_int, ndim=2] vertices + cdef np.ndarray[np.npy_int, ndim=1] arr if self._vertex_to_simplex is None: - self._vertex_to_simplex = np.empty((self.npoints,), dtype=int) + self._vertex_to_simplex = np.empty((self.npoints,), dtype=np.intc) self._vertex_to_simplex.fill(-1) arr = self._vertex_to_simplex @@ -996,9 +997,9 @@ """ cdef int isimplex, k, j, ndim, nsimplex, m, msize - cdef np.ndarray[np.int_t, ndim=2] arr - cdef np.ndarray[np.int_t, ndim=2] neighbors - cdef np.ndarray[np.int_t, ndim=2] vertices + cdef np.ndarray[np.npy_int, ndim=2] arr + cdef np.ndarray[np.npy_int, ndim=2] neighbors + cdef np.ndarray[np.npy_int, ndim=2] vertices neighbors = self.neighbors vertices = self.vertices @@ -1006,7 +1007,7 @@ nsimplex = self.nsimplex msize = 10 - out = np.empty((msize, ndim), dtype=int) + out = np.empty((msize, ndim), dtype=np.intc) arr = out m = 0 @@ -1067,7 +1068,7 @@ cdef int start cdef int k cdef np.ndarray[np.double_t, ndim=2] x - cdef np.ndarray[np.int_t, ndim=1] out_ + cdef np.ndarray[np.npy_int, ndim=1] out_ xi = np.asanyarray(xi) @@ -1081,7 +1082,7 @@ start = 0 eps = np.finfo(np.double).eps * 10 - out = np.zeros((xi.shape[0],), dtype=np.int) + out = np.zeros((xi.shape[0],), dtype=np.intc) out_ = out info = _get_delaunay_info(self, 1, 0) @@ -1178,10 +1179,10 @@ int compute_vertex_to_simplex): cdef DelaunayInfo_t *info cdef np.ndarray[np.double_t, ndim=3] transform - cdef np.ndarray[np.int_t, ndim=1] vertex_to_simplex + cdef np.ndarray[np.npy_int, ndim=1] vertex_to_simplex cdef np.ndarray[np.double_t, ndim=2] points = obj.points - cdef np.ndarray[np.int_t, ndim=2] vertices = obj.vertices - cdef np.ndarray[np.int_t, ndim=2] neighbors = obj.neighbors + cdef np.ndarray[np.npy_int, ndim=2] vertices = obj.vertices + cdef np.ndarray[np.npy_int, ndim=2] neighbors = obj.neighbors cdef np.ndarray[np.double_t, ndim=2] equations = obj.equations cdef np.ndarray[np.double_t, ndim=1] min_bound = obj.min_bound cdef np.ndarray[np.double_t, ndim=1] max_bound = obj.max_bound From scipy-svn at scipy.org Thu Sep 2 16:06:46 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 2 Sep 2010 15:06:46 -0500 (CDT) Subject: [Scipy-svn] r6669 - in trunk/scipy: interpolate spatial Message-ID: <20100902200646.65D0639CD37@scipy.org> Author: ptvirtan Date: 2010-09-02 15:06:46 -0500 (Thu, 02 Sep 2010) New Revision: 6669 Modified: trunk/scipy/interpolate/interpnd.c trunk/scipy/spatial/qhull.c Log: GEN: spatial/interpolate: regenerate qhull.c and interpnd.c Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-02 20:06:16 UTC (rev 6668) +++ trunk/scipy/interpolate/interpnd.c 2010-09-02 20:06:46 UTC (rev 6669) @@ -787,7 +787,7 @@ static double __pyx_f_8interpnd__clough_tocher_2d_single_double(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int, double *, double *, double *); static __pyx_t_double_complex __pyx_f_8interpnd__clough_tocher_2d_single_complex(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int, double *, __pyx_t_double_complex *, __pyx_t_double_complex *); static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "numpy.double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "numpy.int_t", NULL, sizeof(__pyx_t_5numpy_int_t), 'I' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "numpy.npy_int", NULL, sizeof(npy_int), 'I' }; static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), 'R' }; static __Pyx_StructField __Pyx_StructFields_nn___pyx_t_5numpy_complex_t[] = { {&__Pyx_TypeInfo_double, "real", offsetof(__pyx_t_5numpy_complex_t, real)}, @@ -2718,7 +2718,7 @@ __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; @@ -2913,7 +2913,7 @@ __pyx_t_26 = __pyx_v_j; if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_vertices; if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_1_vertices; - __pyx_v_m = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_25, __pyx_bstride_0_vertices, __pyx_t_26, __pyx_bstride_1_vertices)); + __pyx_v_m = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_25, __pyx_bstride_0_vertices, __pyx_t_26, __pyx_bstride_1_vertices)); __pyx_t_27 = __pyx_v_m; @@ -3184,7 +3184,7 @@ __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; @@ -3393,7 +3393,7 @@ __pyx_t_31 = __pyx_v_j; if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_0_vertices; if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_bshape_1_vertices; - __pyx_v_m = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_30, __pyx_bstride_0_vertices, __pyx_t_31, __pyx_bstride_1_vertices)); + __pyx_v_m = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_30, __pyx_bstride_0_vertices, __pyx_t_31, __pyx_bstride_1_vertices)); __pyx_t_32 = __pyx_v_m; @@ -5159,16 +5159,16 @@ int __pyx_t_23; int __pyx_t_24; int __pyx_t_25; - __pyx_t_5numpy_int_t __pyx_t_26; + npy_int __pyx_t_26; int __pyx_t_27; int __pyx_t_28; int __pyx_t_29; - __pyx_t_5numpy_int_t __pyx_t_30; + npy_int __pyx_t_30; int __pyx_t_31; long __pyx_t_32; int __pyx_t_33; int __pyx_t_34; - __pyx_t_5numpy_int_t __pyx_t_35; + npy_int __pyx_t_35; int __pyx_t_36; long __pyx_t_37; int __pyx_t_38; @@ -5296,7 +5296,7 @@ __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; @@ -5478,7 +5478,7 @@ __pyx_t_25 = __pyx_v_j; if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_vertices; if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_1_vertices; - __pyx_t_26 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_24, __pyx_bstride_0_vertices, __pyx_t_25, __pyx_bstride_1_vertices)); + __pyx_t_26 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_24, __pyx_bstride_0_vertices, __pyx_t_25, __pyx_bstride_1_vertices)); __pyx_t_27 = __pyx_v_k; if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_values; if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_1_values; @@ -5489,7 +5489,7 @@ __pyx_t_29 = __pyx_v_j; if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_0_vertices; if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_1_vertices; - __pyx_t_30 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_28, __pyx_bstride_0_vertices, __pyx_t_29, __pyx_bstride_1_vertices)); + __pyx_t_30 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_28, __pyx_bstride_0_vertices, __pyx_t_29, __pyx_bstride_1_vertices)); __pyx_t_31 = __pyx_v_k; __pyx_t_32 = 0; if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_0_grad; @@ -5502,7 +5502,7 @@ __pyx_t_34 = __pyx_v_j; if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_bshape_0_vertices; if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_bshape_1_vertices; - __pyx_t_35 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_33, __pyx_bstride_0_vertices, __pyx_t_34, __pyx_bstride_1_vertices)); + __pyx_t_35 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_33, __pyx_bstride_0_vertices, __pyx_t_34, __pyx_bstride_1_vertices)); __pyx_t_36 = __pyx_v_k; __pyx_t_37 = 1; if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_bshape_0_grad; @@ -5675,30 +5675,30 @@ int __pyx_t_26; int __pyx_t_27; int __pyx_t_28; - __pyx_t_5numpy_int_t __pyx_t_29; + npy_int __pyx_t_29; int __pyx_t_30; int __pyx_t_31; int __pyx_t_32; - __pyx_t_5numpy_int_t __pyx_t_33; + npy_int __pyx_t_33; int __pyx_t_34; int __pyx_t_35; int __pyx_t_36; - __pyx_t_5numpy_int_t __pyx_t_37; + npy_int __pyx_t_37; int __pyx_t_38; long __pyx_t_39; int __pyx_t_40; int __pyx_t_41; - __pyx_t_5numpy_int_t __pyx_t_42; + npy_int __pyx_t_42; int __pyx_t_43; long __pyx_t_44; int __pyx_t_45; int __pyx_t_46; - __pyx_t_5numpy_int_t __pyx_t_47; + npy_int __pyx_t_47; int __pyx_t_48; long __pyx_t_49; int __pyx_t_50; int __pyx_t_51; - __pyx_t_5numpy_int_t __pyx_t_52; + npy_int __pyx_t_52; int __pyx_t_53; long __pyx_t_54; int __pyx_t_55; @@ -5828,7 +5828,7 @@ __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; @@ -6017,7 +6017,7 @@ __pyx_t_28 = __pyx_v_j; if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_vertices; if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_1_vertices; - __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_27, __pyx_bstride_0_vertices, __pyx_t_28, __pyx_bstride_1_vertices)); + __pyx_t_29 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_27, __pyx_bstride_0_vertices, __pyx_t_28, __pyx_bstride_1_vertices)); __pyx_t_30 = __pyx_v_k; if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_0_values; if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_1_values; @@ -6028,7 +6028,7 @@ __pyx_t_32 = __pyx_v_j; if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_bshape_0_vertices; if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_bshape_1_vertices; - __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_31, __pyx_bstride_0_vertices, __pyx_t_32, __pyx_bstride_1_vertices)); + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_31, __pyx_bstride_0_vertices, __pyx_t_32, __pyx_bstride_1_vertices)); __pyx_t_34 = __pyx_v_k; if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_bshape_0_values; if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_bshape_1_values; @@ -6039,7 +6039,7 @@ __pyx_t_36 = __pyx_v_j; if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_bshape_0_vertices; if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_bshape_1_vertices; - __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_35, __pyx_bstride_0_vertices, __pyx_t_36, __pyx_bstride_1_vertices)); + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_35, __pyx_bstride_0_vertices, __pyx_t_36, __pyx_bstride_1_vertices)); __pyx_t_38 = __pyx_v_k; __pyx_t_39 = 0; if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_bshape_0_grad; @@ -6052,7 +6052,7 @@ __pyx_t_41 = __pyx_v_j; if (__pyx_t_40 < 0) __pyx_t_40 += __pyx_bshape_0_vertices; if (__pyx_t_41 < 0) __pyx_t_41 += __pyx_bshape_1_vertices; - __pyx_t_42 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_40, __pyx_bstride_0_vertices, __pyx_t_41, __pyx_bstride_1_vertices)); + __pyx_t_42 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_40, __pyx_bstride_0_vertices, __pyx_t_41, __pyx_bstride_1_vertices)); __pyx_t_43 = __pyx_v_k; __pyx_t_44 = 0; if (__pyx_t_42 < 0) __pyx_t_42 += __pyx_bshape_0_grad; @@ -6065,7 +6065,7 @@ __pyx_t_46 = __pyx_v_j; if (__pyx_t_45 < 0) __pyx_t_45 += __pyx_bshape_0_vertices; if (__pyx_t_46 < 0) __pyx_t_46 += __pyx_bshape_1_vertices; - __pyx_t_47 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_45, __pyx_bstride_0_vertices, __pyx_t_46, __pyx_bstride_1_vertices)); + __pyx_t_47 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_45, __pyx_bstride_0_vertices, __pyx_t_46, __pyx_bstride_1_vertices)); __pyx_t_48 = __pyx_v_k; __pyx_t_49 = 1; if (__pyx_t_47 < 0) __pyx_t_47 += __pyx_bshape_0_grad; @@ -6078,7 +6078,7 @@ __pyx_t_51 = __pyx_v_j; if (__pyx_t_50 < 0) __pyx_t_50 += __pyx_bshape_0_vertices; if (__pyx_t_51 < 0) __pyx_t_51 += __pyx_bshape_1_vertices; - __pyx_t_52 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_50, __pyx_bstride_0_vertices, __pyx_t_51, __pyx_bstride_1_vertices)); + __pyx_t_52 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_50, __pyx_bstride_0_vertices, __pyx_t_51, __pyx_bstride_1_vertices)); __pyx_t_53 = __pyx_v_k; __pyx_t_54 = 1; if (__pyx_t_52 < 0) __pyx_t_52 += __pyx_bshape_0_grad; Modified: trunk/scipy/spatial/qhull.c =================================================================== --- trunk/scipy/spatial/qhull.c 2010-09-02 20:06:16 UTC (rev 6668) +++ trunk/scipy/spatial/qhull.c 2010-09-02 20:06:46 UTC (rev 6669) @@ -782,7 +782,7 @@ static void __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init(__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *, __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int); static void __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next(__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *); static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "numpy.double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "numpy.int_t", NULL, sizeof(__pyx_t_5numpy_int_t), 'I' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "numpy.npy_int", NULL, sizeof(npy_int), 'I' }; #define __Pyx_MODULE_NAME "scipy.spatial.qhull" int __pyx_module_is_main_scipy__spatial__qhull = 0; @@ -839,7 +839,6 @@ static char __pyx_k__xi[] = "xi"; static char __pyx_k__buf[] = "buf"; static char __pyx_k__eps[] = "eps"; -static char __pyx_k__int[] = "int"; static char __pyx_k__max[] = "max"; static char __pyx_k__min[] = "min"; static char __pyx_k__nan[] = "nan"; @@ -852,6 +851,7 @@ static char __pyx_k__data[] = "data"; static char __pyx_k__fill[] = "fill"; static char __pyx_k__info[] = "info"; +static char __pyx_k__intc[] = "intc"; static char __pyx_k__ndim[] = "ndim"; static char __pyx_k__next[] = "next"; static char __pyx_k__prod[] = "prod"; @@ -996,7 +996,7 @@ static PyObject *__pyx_n_s__id; static PyObject *__pyx_n_s__index; static PyObject *__pyx_n_s__info; -static PyObject *__pyx_n_s__int; +static PyObject *__pyx_n_s__intc; static PyObject *__pyx_n_s__it; static PyObject *__pyx_n_s__itemsize; static PyObject *__pyx_n_s__ivertex; @@ -1690,7 +1690,7 @@ __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1705,10 +1705,10 @@ { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_id_map); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_id_map, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_id_map, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_id_map, (PyObject*)__pyx_v_id_map, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_id_map, (PyObject*)__pyx_v_id_map, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { @@ -1770,7 +1770,7 @@ __Pyx_RaiseBufferIndexError(__pyx_t_7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_id_map.buf, __pyx_t_13, __pyx_bstride_0_id_map) = __pyx_v_j; + *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_id_map.buf, __pyx_t_13, __pyx_bstride_0_id_map) = __pyx_v_j; __pyx_v_j += 1; @@ -1809,7 +1809,7 @@ __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1824,10 +1824,10 @@ { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vertices); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); __Pyx_RaiseBufferFallbackError(); } else { @@ -1870,7 +1870,7 @@ __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1885,10 +1885,10 @@ { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_neighbors); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_v_neighbors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_v_neighbors, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { @@ -2040,7 +2040,7 @@ __Pyx_RaiseBufferIndexError(__pyx_t_21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_19, __pyx_bstride_0_vertices, __pyx_t_20, __pyx_bstride_1_vertices) = __pyx_v_point; + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_19, __pyx_bstride_0_vertices, __pyx_t_20, __pyx_bstride_1_vertices) = __pyx_v_point; } @@ -2074,7 +2074,7 @@ __Pyx_RaiseBufferIndexError(__pyx_t_24); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_neighbors.buf, __pyx_t_21, __pyx_bstride_0_neighbors, __pyx_t_23, __pyx_bstride_1_neighbors) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_id_map.buf, __pyx_t_22, __pyx_bstride_0_id_map)); + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_neighbors.buf, __pyx_t_21, __pyx_bstride_0_neighbors, __pyx_t_23, __pyx_bstride_1_neighbors) = (*__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_id_map.buf, __pyx_t_22, __pyx_bstride_0_id_map)); } @@ -2244,27 +2244,27 @@ int __pyx_t_14; int __pyx_t_15; long __pyx_t_16; - __pyx_t_5numpy_int_t __pyx_t_17; + npy_int __pyx_t_17; long __pyx_t_18; int __pyx_t_19; long __pyx_t_20; - __pyx_t_5numpy_int_t __pyx_t_21; + npy_int __pyx_t_21; long __pyx_t_22; int __pyx_t_23; long __pyx_t_24; - __pyx_t_5numpy_int_t __pyx_t_25; + npy_int __pyx_t_25; long __pyx_t_26; int __pyx_t_27; long __pyx_t_28; - __pyx_t_5numpy_int_t __pyx_t_29; + npy_int __pyx_t_29; long __pyx_t_30; int __pyx_t_31; long __pyx_t_32; - __pyx_t_5numpy_int_t __pyx_t_33; + npy_int __pyx_t_33; long __pyx_t_34; int __pyx_t_35; long __pyx_t_36; - __pyx_t_5numpy_int_t __pyx_t_37; + npy_int __pyx_t_37; long __pyx_t_38; int __pyx_t_39; long __pyx_t_40; @@ -2288,7 +2288,7 @@ int __pyx_t_58; int __pyx_t_59; int __pyx_t_60; - __pyx_t_5numpy_int_t __pyx_t_61; + npy_int __pyx_t_61; int __pyx_t_62; int __pyx_t_63; int __pyx_t_64; @@ -2297,7 +2297,7 @@ int __pyx_t_67; int __pyx_t_68; int __pyx_t_69; - __pyx_t_5numpy_int_t __pyx_t_70; + npy_int __pyx_t_70; int __pyx_t_71; int __pyx_t_72; int __pyx_t_73; @@ -2370,7 +2370,7 @@ __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; @@ -2532,7 +2532,7 @@ __pyx_t_16 = 0; if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_vertices; if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_1_vertices; - __pyx_t_17 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_15, __pyx_bstride_0_vertices, __pyx_t_16, __pyx_bstride_1_vertices)); + __pyx_t_17 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_15, __pyx_bstride_0_vertices, __pyx_t_16, __pyx_bstride_1_vertices)); __pyx_t_18 = 0; if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_0_points; if (__pyx_t_18 < 0) __pyx_t_18 += __pyx_bshape_1_points; @@ -2543,7 +2543,7 @@ __pyx_t_20 = 1; if (__pyx_t_19 < 0) __pyx_t_19 += __pyx_bshape_0_vertices; if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_1_vertices; - __pyx_t_21 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_19, __pyx_bstride_0_vertices, __pyx_t_20, __pyx_bstride_1_vertices)); + __pyx_t_21 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_19, __pyx_bstride_0_vertices, __pyx_t_20, __pyx_bstride_1_vertices)); __pyx_t_22 = 0; if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_points; if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_1_points; @@ -2554,7 +2554,7 @@ __pyx_t_24 = 2; if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_0_vertices; if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_1_vertices; - __pyx_t_25 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_23, __pyx_bstride_0_vertices, __pyx_t_24, __pyx_bstride_1_vertices)); + __pyx_t_25 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_23, __pyx_bstride_0_vertices, __pyx_t_24, __pyx_bstride_1_vertices)); __pyx_t_26 = 0; if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_points; if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_1_points; @@ -2565,7 +2565,7 @@ __pyx_t_28 = 0; if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_vertices; if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_1_vertices; - __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_27, __pyx_bstride_0_vertices, __pyx_t_28, __pyx_bstride_1_vertices)); + __pyx_t_29 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_27, __pyx_bstride_0_vertices, __pyx_t_28, __pyx_bstride_1_vertices)); __pyx_t_30 = 1; if (__pyx_t_29 < 0) __pyx_t_29 += __pyx_bshape_0_points; if (__pyx_t_30 < 0) __pyx_t_30 += __pyx_bshape_1_points; @@ -2576,7 +2576,7 @@ __pyx_t_32 = 1; if (__pyx_t_31 < 0) __pyx_t_31 += __pyx_bshape_0_vertices; if (__pyx_t_32 < 0) __pyx_t_32 += __pyx_bshape_1_vertices; - __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_31, __pyx_bstride_0_vertices, __pyx_t_32, __pyx_bstride_1_vertices)); + __pyx_t_33 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_31, __pyx_bstride_0_vertices, __pyx_t_32, __pyx_bstride_1_vertices)); __pyx_t_34 = 1; if (__pyx_t_33 < 0) __pyx_t_33 += __pyx_bshape_0_points; if (__pyx_t_34 < 0) __pyx_t_34 += __pyx_bshape_1_points; @@ -2587,7 +2587,7 @@ __pyx_t_36 = 2; if (__pyx_t_35 < 0) __pyx_t_35 += __pyx_bshape_0_vertices; if (__pyx_t_36 < 0) __pyx_t_36 += __pyx_bshape_1_vertices; - __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_35, __pyx_bstride_0_vertices, __pyx_t_36, __pyx_bstride_1_vertices)); + __pyx_t_37 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_35, __pyx_bstride_0_vertices, __pyx_t_36, __pyx_bstride_1_vertices)); __pyx_t_38 = 1; if (__pyx_t_37 < 0) __pyx_t_37 += __pyx_bshape_0_points; if (__pyx_t_38 < 0) __pyx_t_38 += __pyx_bshape_1_points; @@ -2708,7 +2708,7 @@ __pyx_t_60 = __pyx_v_ndim; if (__pyx_t_59 < 0) __pyx_t_59 += __pyx_bshape_0_vertices; if (__pyx_t_60 < 0) __pyx_t_60 += __pyx_bshape_1_vertices; - __pyx_t_61 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_59, __pyx_bstride_0_vertices, __pyx_t_60, __pyx_bstride_1_vertices)); + __pyx_t_61 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_59, __pyx_bstride_0_vertices, __pyx_t_60, __pyx_bstride_1_vertices)); __pyx_t_62 = __pyx_v_i; if (__pyx_t_61 < 0) __pyx_t_61 += __pyx_bshape_0_points; if (__pyx_t_62 < 0) __pyx_t_62 += __pyx_bshape_1_points; @@ -2730,7 +2730,7 @@ __pyx_t_69 = __pyx_v_j; if (__pyx_t_68 < 0) __pyx_t_68 += __pyx_bshape_0_vertices; if (__pyx_t_69 < 0) __pyx_t_69 += __pyx_bshape_1_vertices; - __pyx_t_70 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_68, __pyx_bstride_0_vertices, __pyx_t_69, __pyx_bstride_1_vertices)); + __pyx_t_70 = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_68, __pyx_bstride_0_vertices, __pyx_t_69, __pyx_bstride_1_vertices)); __pyx_t_71 = __pyx_v_i; if (__pyx_t_70 < 0) __pyx_t_70 += __pyx_bshape_0_points; if (__pyx_t_71 < 0) __pyx_t_71 += __pyx_bshape_1_points; @@ -4042,6 +4042,7 @@ __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.__init__"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF(__pyx_v_points); __pyx_v_vertices = Py_None; __Pyx_INCREF(Py_None); __pyx_v_neighbors = Py_None; __Pyx_INCREF(Py_None); __pyx_v_equations = Py_None; __Pyx_INCREF(Py_None); @@ -4049,33 +4050,69 @@ __pyx_v_paraboloid_shift = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_points); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_points); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_points); + __pyx_v_points = __pyx_t_2; + __pyx_t_2 = 0; + + + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_points); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_points); + __Pyx_GIVEREF(__pyx_v_points); + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 5)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 5)) { + PyObject* tuple = __pyx_t_1; + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = PyTuple_GET_ITEM(tuple, 4); __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_vertices); - __pyx_v_vertices = __pyx_t_2; + __pyx_v_vertices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_neighbors); + __pyx_v_neighbors = __pyx_t_2; __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_neighbors); - __pyx_v_neighbors = __pyx_t_1; - __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_equations); __pyx_v_equations = __pyx_t_4; __pyx_t_4 = 0; @@ -4086,27 +4123,27 @@ __pyx_v_paraboloid_shift = __pyx_t_6; __pyx_t_6 = 0; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_vertices); - __pyx_v_vertices = __pyx_t_2; + __pyx_v_vertices = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_neighbors); + __pyx_v_neighbors = __pyx_t_2; __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_neighbors); - __pyx_v_neighbors = __pyx_t_1; - __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_equations); __pyx_v_equations = __pyx_t_4; __pyx_t_4 = 0; @@ -4119,87 +4156,87 @@ } - __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -4219,6 +4256,7 @@ __Pyx_DECREF(__pyx_v_equations); __Pyx_DECREF(__pyx_v_paraboloid_scale); __Pyx_DECREF(__pyx_v_paraboloid_shift); + __Pyx_DECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4241,22 +4279,22 @@ __Pyx_INCREF(__pyx_v_self); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -4264,13 +4302,13 @@ __Pyx_GIVEREF(__pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5; } @@ -4278,7 +4316,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -4327,20 +4365,21 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyArrayObject *__pyx_t_6 = NULL; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_6 = NULL; + PyArrayObject *__pyx_t_7 = NULL; + int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyArrayObject *__pyx_t_11 = NULL; - int __pyx_t_12; - long __pyx_t_13; - int __pyx_t_14; + PyObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + long __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_t_17; int __pyx_t_18; int __pyx_t_19; + int __pyx_t_20; __Pyx_RefNannySetupContext("vertex_to_simplex"); __pyx_self = __pyx_self; __Pyx_INCREF(__pyx_v_self); @@ -4350,180 +4389,186 @@ __pyx_bstruct_arr.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__intc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11); } } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_6 = 0; + __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = ((PyArrayObject *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vertices); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_7 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { + PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9); + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8); + PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9); } } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_11 = 0; + __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); __pyx_v_vertices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_nsimplex = __pyx_t_7; + __pyx_v_nsimplex = __pyx_t_8; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ndim = __pyx_t_7; + __pyx_v_ndim = __pyx_t_8; - __pyx_t_7 = __pyx_v_nsimplex; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) { - __pyx_v_isimplex = __pyx_t_12; + __pyx_t_8 = __pyx_v_nsimplex; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) { + __pyx_v_isimplex = __pyx_t_13; - __pyx_t_13 = (__pyx_v_ndim + 1); - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_k = __pyx_t_14; + __pyx_t_14 = (__pyx_v_ndim + 1); + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_k = __pyx_t_15; - __pyx_t_15 = __pyx_v_isimplex; - __pyx_t_16 = __pyx_v_k; - __pyx_t_17 = -1; - if (__pyx_t_15 < 0) { - __pyx_t_15 += __pyx_bshape_0_vertices; - if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0; - } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_vertices)) __pyx_t_17 = 0; + __pyx_t_16 = __pyx_v_isimplex; + __pyx_t_17 = __pyx_v_k; + __pyx_t_18 = -1; if (__pyx_t_16 < 0) { - __pyx_t_16 += __pyx_bshape_1_vertices; - if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1; - } else if (unlikely(__pyx_t_16 >= __pyx_bshape_1_vertices)) __pyx_t_17 = 1; - if (unlikely(__pyx_t_17 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_ivertex = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_15, __pyx_bstride_0_vertices, __pyx_t_16, __pyx_bstride_1_vertices)); - - - __pyx_t_17 = __pyx_v_ivertex; - __pyx_t_18 = -1; + __pyx_t_16 += __pyx_bshape_0_vertices; + if (unlikely(__pyx_t_16 < 0)) __pyx_t_18 = 0; + } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_vertices)) __pyx_t_18 = 0; if (__pyx_t_17 < 0) { - __pyx_t_17 += __pyx_bshape_0_arr; - if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 0; - } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_arr)) __pyx_t_18 = 0; + __pyx_t_17 += __pyx_bshape_1_vertices; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_vertices)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_17, __pyx_bstride_0_arr)) == -1); + __pyx_v_ivertex = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_16, __pyx_bstride_0_vertices, __pyx_t_17, __pyx_bstride_1_vertices)); + + + __pyx_t_18 = __pyx_v_ivertex; + __pyx_t_19 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_bshape_0_arr; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_arr)) __pyx_t_19 = 0; + if (unlikely(__pyx_t_19 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_19); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_18, __pyx_bstride_0_arr)) == -1); if (__pyx_t_2) { - __pyx_t_18 = __pyx_v_ivertex; - __pyx_t_19 = -1; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_bshape_0_arr; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 0; - } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_arr)) __pyx_t_19 = 0; - if (unlikely(__pyx_t_19 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_19); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = __pyx_v_ivertex; + __pyx_t_20 = -1; + if (__pyx_t_19 < 0) { + __pyx_t_19 += __pyx_bshape_0_arr; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 0; + } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_arr)) __pyx_t_20 = 0; + if (unlikely(__pyx_t_20 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_20); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_18, __pyx_bstride_0_arr) = __pyx_v_isimplex; + *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_19, __pyx_bstride_0_arr) = __pyx_v_isimplex; goto __pyx_L10; } __pyx_L10:; @@ -4535,7 +4580,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4548,6 +4593,7 @@ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); @@ -4611,15 +4657,15 @@ PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyArrayObject *__pyx_t_11 = NULL; - int __pyx_t_12; - long __pyx_t_13; - int __pyx_t_14; + PyObject *__pyx_t_11 = NULL; + PyArrayObject *__pyx_t_12 = NULL; + int __pyx_t_13; + long __pyx_t_14; int __pyx_t_15; int __pyx_t_16; int __pyx_t_17; - long __pyx_t_18; - int __pyx_t_19; + int __pyx_t_18; + long __pyx_t_19; int __pyx_t_20; int __pyx_t_21; int __pyx_t_22; @@ -4627,7 +4673,8 @@ int __pyx_t_24; int __pyx_t_25; int __pyx_t_26; - long __pyx_t_27; + int __pyx_t_27; + long __pyx_t_28; __Pyx_RefNannySetupContext("convex_hull"); __pyx_self = __pyx_self; __Pyx_INCREF(__pyx_v_self); @@ -4640,17 +4687,17 @@ __pyx_bstruct_vertices.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_neighbors); - __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_3 < 0)) { PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_v_neighbors, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_v_neighbors, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); __Pyx_RaiseBufferFallbackError(); } else { @@ -4659,7 +4706,7 @@ } __pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_neighbors)); @@ -4667,17 +4714,17 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vertices); - __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_3 < 0)) { PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); __Pyx_RaiseBufferFallbackError(); } else { @@ -4686,7 +4733,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -4694,16 +4741,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_3; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nsimplex = __pyx_t_3; @@ -4711,16 +4758,16 @@ __pyx_v_msize = 10; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -4728,33 +4775,39 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_1 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyInt_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_out); - __pyx_v_out = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_out = __pyx_t_11; + __pyx_t_11 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = ((PyArrayObject *)__pyx_v_out); + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); - __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_3 < 0)) { PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); __Pyx_RaiseBufferFallbackError(); } else { @@ -4763,9 +4816,9 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_11 = 0; + __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)__pyx_v_out); @@ -4775,58 +4828,58 @@ __pyx_t_3 = __pyx_v_nsimplex; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_3; __pyx_t_12+=1) { - __pyx_v_isimplex = __pyx_t_12; + for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_3; __pyx_t_13+=1) { + __pyx_v_isimplex = __pyx_t_13; - __pyx_t_13 = (__pyx_v_ndim + 1); - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { - __pyx_v_k = __pyx_t_14; + __pyx_t_14 = (__pyx_v_ndim + 1); + for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) { + __pyx_v_k = __pyx_t_15; - __pyx_t_15 = __pyx_v_isimplex; - __pyx_t_16 = __pyx_v_k; - if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_neighbors; - if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_1_neighbors; - __pyx_t_17 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_neighbors.buf, __pyx_t_15, __pyx_bstride_0_neighbors, __pyx_t_16, __pyx_bstride_1_neighbors)) == -1); - if (__pyx_t_17) { + __pyx_t_16 = __pyx_v_isimplex; + __pyx_t_17 = __pyx_v_k; + if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_neighbors; + if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_1_neighbors; + __pyx_t_18 = ((*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_neighbors.buf, __pyx_t_16, __pyx_bstride_0_neighbors, __pyx_t_17, __pyx_bstride_1_neighbors)) == -1); + if (__pyx_t_18) { - __pyx_t_18 = (__pyx_v_ndim + 1); - for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { - __pyx_v_j = __pyx_t_19; + __pyx_t_19 = (__pyx_v_ndim + 1); + for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) { + __pyx_v_j = __pyx_t_20; - __pyx_t_17 = (__pyx_v_j < __pyx_v_k); - if (__pyx_t_17) { + __pyx_t_18 = (__pyx_v_j < __pyx_v_k); + if (__pyx_t_18) { - __pyx_t_20 = __pyx_v_isimplex; - __pyx_t_21 = __pyx_v_j; - if (__pyx_t_20 < 0) __pyx_t_20 += __pyx_bshape_0_vertices; - if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_1_vertices; - __pyx_t_22 = __pyx_v_m; - __pyx_t_23 = __pyx_v_j; - if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_0_arr; - if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_1_arr; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_22, __pyx_bstride_0_arr, __pyx_t_23, __pyx_bstride_1_arr) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_20, __pyx_bstride_0_vertices, __pyx_t_21, __pyx_bstride_1_vertices)); + __pyx_t_21 = __pyx_v_isimplex; + __pyx_t_22 = __pyx_v_j; + if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_vertices; + if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_1_vertices; + __pyx_t_23 = __pyx_v_m; + __pyx_t_24 = __pyx_v_j; + if (__pyx_t_23 < 0) __pyx_t_23 += __pyx_bshape_0_arr; + if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_1_arr; + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_23, __pyx_bstride_0_arr, __pyx_t_24, __pyx_bstride_1_arr) = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_21, __pyx_bstride_0_vertices, __pyx_t_22, __pyx_bstride_1_vertices)); goto __pyx_L12; } - __pyx_t_17 = (__pyx_v_j > __pyx_v_k); - if (__pyx_t_17) { + __pyx_t_18 = (__pyx_v_j > __pyx_v_k); + if (__pyx_t_18) { - __pyx_t_24 = __pyx_v_isimplex; - __pyx_t_25 = __pyx_v_j; - if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_vertices; - if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_1_vertices; - __pyx_t_26 = __pyx_v_m; - __pyx_t_27 = (__pyx_v_j - 1); - if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_arr; - if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_1_arr; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_arr.buf, __pyx_t_26, __pyx_bstride_0_arr, __pyx_t_27, __pyx_bstride_1_arr) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int_t *, __pyx_bstruct_vertices.buf, __pyx_t_24, __pyx_bstride_0_vertices, __pyx_t_25, __pyx_bstride_1_vertices)); + __pyx_t_25 = __pyx_v_isimplex; + __pyx_t_26 = __pyx_v_j; + if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_0_vertices; + if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_1_vertices; + __pyx_t_27 = __pyx_v_m; + __pyx_t_28 = (__pyx_v_j - 1); + if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_0_arr; + if (__pyx_t_28 < 0) __pyx_t_28 += __pyx_bshape_1_arr; + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_27, __pyx_bstride_0_arr, __pyx_t_28, __pyx_bstride_1_arr) = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_25, __pyx_bstride_0_vertices, __pyx_t_26, __pyx_bstride_1_vertices)); goto __pyx_L12; } __pyx_L12:; @@ -4836,18 +4889,18 @@ __pyx_v_m += 1; - __pyx_t_17 = (__pyx_v_m >= __pyx_v_msize); - if (__pyx_t_17) { + __pyx_t_18 = (__pyx_v_m >= __pyx_v_msize); + if (__pyx_t_18) { - __pyx_t_11 = ((PyArrayObject *)Py_None); + __pyx_t_12 = ((PyArrayObject *)Py_None); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); - __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_19 < 0)) { + __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_20 < 0)) { PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); __Pyx_RaiseBufferFallbackError(); } else { @@ -4856,9 +4909,9 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_11 = 0; + __pyx_t_12 = 0; __Pyx_INCREF(Py_None); __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)Py_None); @@ -4867,13 +4920,13 @@ __pyx_v_msize = ((2 * __pyx_v_msize) + 1); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -4881,22 +4934,22 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_10 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_11 = ((PyArrayObject *)__pyx_v_out); + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); - __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); - if (unlikely(__pyx_t_19 < 0)) { + __pyx_t_20 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + if (unlikely(__pyx_t_20 < 0)) { PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); __Pyx_RaiseBufferFallbackError(); } else { @@ -4905,9 +4958,9 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_11 = 0; + __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)__pyx_v_out); @@ -4921,14 +4974,14 @@ } - __pyx_t_11 = ((PyArrayObject *)Py_None); + __pyx_t_12 = ((PyArrayObject *)Py_None); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr); - __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); + __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_3 < 0)) { PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); __Pyx_RaiseBufferFallbackError(); } else { @@ -4937,33 +4990,33 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_11 = 0; + __pyx_t_12 = 0; __Pyx_INCREF(Py_None); __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)Py_None); - __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); __pyx_t_8 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11 = 0; + __pyx_t_11 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_r); @@ -4978,6 +5031,7 @@ __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_neighbors); @@ -5070,7 +5124,7 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -5079,7 +5133,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -5098,7 +5152,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.find_simplex"); return NULL; @@ -5114,17 +5168,17 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5133,72 +5187,72 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5206,7 +5260,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5215,37 +5269,37 @@ __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5262,7 +5316,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -5273,66 +5327,66 @@ __pyx_v_start = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_eps = __pyx_t_11; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5342,15 +5396,15 @@ __pyx_t_12 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out_); - __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_out_, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_out_, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); if (unlikely(__pyx_t_7 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out_, (PyObject*)__pyx_v_out_, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out_, (PyObject*)__pyx_v_out_, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); __Pyx_RaiseBufferFallbackError(); } else { @@ -5359,7 +5413,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5370,7 +5424,7 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 1, 0); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { @@ -5390,9 +5444,9 @@ } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_out_)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out_.buf, __pyx_t_15, __pyx_bstride_0_out_) = __pyx_v_isimplex; + *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_out_.buf, __pyx_t_15, __pyx_bstride_0_out_) = __pyx_v_isimplex; } goto __pyx_L7; } @@ -5415,9 +5469,9 @@ } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_out_)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_) = __pyx_v_isimplex; + *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_) = __pyx_v_isimplex; } } __pyx_L7:; @@ -5427,16 +5481,16 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5542,11 +5596,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -5558,7 +5612,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.plane_distance"); return NULL; @@ -5573,72 +5627,72 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_12)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_1; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5646,7 +5700,7 @@ __Pyx_GIVEREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5655,37 +5709,37 @@ __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5702,7 +5756,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -5713,16 +5767,16 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 0, 0); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5730,21 +5784,21 @@ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5754,7 +5808,7 @@ __pyx_t_11 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5771,7 +5825,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bstride_1_out_ = __pyx_bstruct_out_.strides[1]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; __pyx_bshape_1_out_ = __pyx_bstruct_out_.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5805,7 +5859,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_out_)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_, __pyx_t_17, __pyx_bstride_1_out_) = __pyx_f_5scipy_7spatial_5qhull__distplane(__pyx_v_info, __pyx_v_j, __pyx_v_z); } @@ -5816,27 +5870,27 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5911,11 +5965,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_x = values[1]; @@ -5927,7 +5981,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.lift_points"); return NULL; @@ -5935,48 +5989,48 @@ __pyx_v_z = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5986,9 +6040,9 @@ __pyx_t_5 = 0; - __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -5996,23 +6050,23 @@ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -6020,14 +6074,14 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -6035,20 +6089,20 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_2, 0, Py_Ellipsis); @@ -6056,13 +6110,13 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6121,11 +6175,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_xi = values[1]; @@ -6137,7 +6191,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.tsearch"); return NULL; @@ -6145,14 +6199,14 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6251,15 +6305,15 @@ __pyx_bstruct_max_bound.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -6269,15 +6323,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -6287,15 +6341,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_neighbors = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_neighbors.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; } @@ -6305,15 +6359,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_equations, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_equations = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_equations.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_equations = __pyx_bstruct_equations.strides[0]; __pyx_bstride_1_equations = __pyx_bstruct_equations.strides[1]; __pyx_bshape_0_equations = __pyx_bstruct_equations.shape[0]; __pyx_bshape_1_equations = __pyx_bstruct_equations.shape[1]; } @@ -6323,15 +6377,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_min_bound, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_min_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_min_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_min_bound = __pyx_bstruct_min_bound.strides[0]; __pyx_bshape_0_min_bound = __pyx_bstruct_min_bound.shape[0]; } @@ -6341,15 +6395,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_max_bound, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_max_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_max_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_max_bound = __pyx_bstruct_max_bound.strides[0]; __pyx_bshape_0_max_bound = __pyx_bstruct_max_bound.shape[0]; } @@ -6383,16 +6437,16 @@ __pyx_v_info->equations = ((double *)__pyx_v_equations->data); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_scale = __pyx_t_8; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_shift = __pyx_t_8; @@ -6401,9 +6455,9 @@ if (__pyx_t_9) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6420,7 +6474,7 @@ } __pyx_bstride_0_transform = __pyx_bstruct_transform.strides[0]; __pyx_bstride_1_transform = __pyx_bstruct_transform.strides[1]; __pyx_bstride_2_transform = __pyx_bstruct_transform.strides[2]; __pyx_bshape_0_transform = __pyx_bstruct_transform.shape[0]; __pyx_bshape_1_transform = __pyx_bstruct_transform.shape[1]; __pyx_bshape_2_transform = __pyx_bstruct_transform.shape[2]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_transform)); @@ -6443,17 +6497,17 @@ if (__pyx_t_9) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vertex_to_simplex); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_v_vertex_to_simplex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_v_vertex_to_simplex, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); __Pyx_RaiseBufferFallbackError(); } else { @@ -6462,7 +6516,7 @@ } __pyx_bstride_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.strides[0]; __pyx_bshape_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertex_to_simplex)); @@ -7966,7 +8020,7 @@ {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1}, {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1}, - {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1}, + {&__pyx_n_s__intc, __pyx_k__intc, sizeof(__pyx_k__intc), 0, 0, 1, 1}, {&__pyx_n_s__it, __pyx_k__it, sizeof(__pyx_k__it), 0, 0, 1, 1}, {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1}, {&__pyx_n_s__ivertex, __pyx_k__ivertex, sizeof(__pyx_k__ivertex), 0, 0, 1, 1}, @@ -8033,7 +8087,7 @@ }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 @@ -8204,104 +8258,104 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Delaunay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; From scipy-svn at scipy.org Fri Sep 3 16:04:50 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 3 Sep 2010 15:04:50 -0500 (CDT) Subject: [Scipy-svn] r6670 - trunk/doc/frontpage/_templates Message-ID: <20100903200450.1DBCF39CD44@scipy.org> Author: ptvirtan Date: 2010-09-03 15:04:47 -0500 (Fri, 03 Sep 2010) New Revision: 6670 Modified: trunk/doc/frontpage/_templates/indexcontent.html Log: DOC: frontpage: add links to Numpy 1.5 docs Modified: trunk/doc/frontpage/_templates/indexcontent.html =================================================================== --- trunk/doc/frontpage/_templates/indexcontent.html 2010-09-02 20:06:46 UTC (rev 6669) +++ trunk/doc/frontpage/_templates/indexcontent.html 2010-09-03 20:04:47 UTC (rev 6670) @@ -28,6 +28,13 @@

Releases:

@@ -30,6 +30,7 @@
+

Numpy 1.5 Reference Guide, + [HTML+zip], + [PDF] +

+

Numpy 1.5 User Guide (DRAFT), + [PDF] +

Numpy 1.4 Reference Guide, [HTML+zip], [PDF] From scipy-svn at scipy.org Sat Sep 4 05:23:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 04:23:31 -0500 (CDT) Subject: [Scipy-svn] r6671 - trunk/scipy/ndimage Message-ID: <20100904092331.E7EEC39CB4B@scipy.org> Author: rgommers Date: 2010-09-04 04:23:31 -0500 (Sat, 04 Sep 2010) New Revision: 6671 Modified: trunk/scipy/ndimage/measurements.py trunk/scipy/ndimage/setup.py Log: BUG: remove gcc-specific compile arg from ndimage/setup.py. This breaks the build on Solaris, thanks to Bryan Hodgson for pointing this out. Also remove an unused import. Modified: trunk/scipy/ndimage/measurements.py =================================================================== --- trunk/scipy/ndimage/measurements.py 2010-09-03 20:04:47 UTC (rev 6670) +++ trunk/scipy/ndimage/measurements.py 2010-09-04 09:23:31 UTC (rev 6671) @@ -35,7 +35,6 @@ import _ni_support import _nd_image import morphology -import time def label(input, structure = None, output = None): """ @@ -192,7 +191,7 @@ func will be called with linear indices as a second argument if pass_positions is True. ''' - + as_scalar = numpy.isscalar(index) input = numpy.asarray(input) @@ -240,13 +239,13 @@ input = input[label_order] if pass_positions: positions = positions[label_order] - + index_order = index.argsort() sorted_index = index[index_order] def do_map(inputs, output): '''labels must be sorted''' - + nlabels = labels.size nidx = sorted_index.size @@ -254,13 +253,13 @@ # This could be faster, but we already paid N log N to sort labels. lo = numpy.searchsorted(labels, sorted_index, side='left') hi = numpy.searchsorted(labels, sorted_index, side='right') - + for i, l, h in zip(range(nidx), lo, hi): if l == h: continue idx = sorted_index[i] output[i] = func(*[inp[l:h] for inp in inputs]) - + temp = numpy.empty(index.shape, out_dtype) temp[:] = default if not pass_positions: @@ -283,7 +282,7 @@ return vals.size, vals.sum(), (vals * vals.conjugate()).sum() else: return vals.size, vals.sum() - + if labels is None: return single_group(input) @@ -298,7 +297,7 @@ # remap labels to unique integers if necessary, or if the largest # label is larger than the number of values. - if ((not numpy.issubdtype(labels.dtype, numpy.int)) or + if ((not numpy.issubdtype(labels.dtype, numpy.int)) or (labels.min() < 0) or (labels.max() > labels.size)): unique_labels, new_labels = numpy.unique1d(labels, return_inverse=True) @@ -329,12 +328,12 @@ sums = sums[idxs] sums[~ found] = 0 if not do_sum2: - return (counts, sums) + return (counts, sums) sums2 = sums2[idxs] sums2[~ found] = 0 return (counts, sums, sums2) - + def sum(input, labels = None, index = None): """ Calculate the sum of the values of the array. @@ -393,7 +392,7 @@ def variance(input, labels = None, index = None): """Calculate the variance of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. @@ -408,7 +407,7 @@ def standard_deviation(input, labels = None, index = None): """Calculate the standard deviation of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. @@ -436,7 +435,7 @@ if find_max_positions: result += [positions[vals == vals.max()][0]] return result - + if labels is None: return single_group(input, positions) @@ -465,7 +464,7 @@ # remap labels to unique integers if necessary, or if the largest # label is larger than the number of values. - if ((not numpy.issubdtype(labels.dtype, numpy.int)) or + if ((not numpy.issubdtype(labels.dtype, numpy.int)) or (labels.min() < 0) or (labels.max() > labels.size)): # remap labels, and indexes unique_labels, labels = numpy.unique1d(labels, return_inverse=True) @@ -478,7 +477,7 @@ # labels are an integer type, and there aren't too many. idxs = numpy.asanyarray(index, numpy.int).copy() found = (idxs >= 0) & (idxs <= labels.max()) - + idxs[~ found] = labels.max() + 1 result = [] @@ -648,12 +647,12 @@ def minimum_position(input, labels = None, index = None): """Find the positions of the minimums of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. """ - + dims = numpy.array(numpy.asarray(input).shape) # see numpy.unravel_index to understand this line. dim_prod = numpy.cumprod([1] + list(dims[:0:-1]))[::-1] @@ -668,12 +667,12 @@ def maximum_position(input, labels = None, index = None): """Find the positions of the maximums of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. """ - + dims = numpy.array(numpy.asarray(input).shape) # see numpy.unravel_index to understand this line. dim_prod = numpy.cumprod([1] + list(dims[:0:-1]))[::-1] @@ -689,20 +688,20 @@ """Calculate the minimums and maximums of the values of an array at labels, along with their positions. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. - + Returns: minimums, maximums, min_positions, max_positions """ - + dims = numpy.array(numpy.asarray(input).shape) # see numpy.unravel_index to understand this line. dim_prod = numpy.cumprod([1] + list(dims[:0:-1]))[::-1] - minimums, min_positions, maximums, max_positions = _select(input, labels, index, - find_min=True, find_max=True, + minimums, min_positions, maximums, max_positions = _select(input, labels, index, + find_min=True, find_max=True, find_min_positions=True, find_max_positions=True) @@ -717,7 +716,7 @@ def center_of_mass(input, labels = None, index = None): """Calculate the center of mass of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. @@ -727,7 +726,7 @@ grids = numpy.ogrid[[slice(0, i) for i in input.shape]] results = [sum(input * grids[dir].astype(float), labels, index) / normalizer for dir in range(input.ndim)] - + if numpy.isscalar(results[0]): return tuple(results) @@ -736,7 +735,7 @@ def histogram(input, min, max, bins, labels = None, index = None): """Calculate the histogram of the values of an array at labels. - Labels must be None or an array of the same dimensions as the input. + Labels must be None or an array of the same dimensions as the input. The histograms are defined by the minimum and maximum values and the number of bins. @@ -744,7 +743,7 @@ Index must be None, a single label or sequence of labels. If none, all values where label is greater than zero are used. """ - + _bins = numpy.linspace(min, max, bins + 1) def _hist(vals): Modified: trunk/scipy/ndimage/setup.py =================================================================== --- trunk/scipy/ndimage/setup.py 2010-09-03 20:04:47 UTC (rev 6670) +++ trunk/scipy/ndimage/setup.py 2010-09-04 09:23:31 UTC (rev 6671) @@ -12,7 +12,6 @@ "src/ni_measure.c", "src/ni_morphology.c","src/ni_support.c"], include_dirs=['src']+[get_include()], - extra_compile_args=['-Wall'], ) config.add_data_dir('tests') From scipy-svn at scipy.org Sat Sep 4 13:45:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 12:45:31 -0500 (CDT) Subject: [Scipy-svn] r6672 - trunk/doc/frontpage/_templates Message-ID: <20100904174531.29F4739CCC0@scipy.org> Author: ptvirtan Date: 2010-09-04 12:45:31 -0500 (Sat, 04 Sep 2010) New Revision: 6672 Modified: trunk/doc/frontpage/_templates/indexcontent.html Log: DOC: frontpage: add links to Numpy & Scipy release CHM files Modified: trunk/doc/frontpage/_templates/indexcontent.html =================================================================== --- trunk/doc/frontpage/_templates/indexcontent.html 2010-09-04 09:23:31 UTC (rev 6671) +++ trunk/doc/frontpage/_templates/indexcontent.html 2010-09-04 17:45:31 UTC (rev 6672) @@ -20,7 +20,7 @@

Numpy 1.5 Reference Guide, [HTML+zip], + [CHM], [PDF]

Numpy 1.5 User Guide (DRAFT), @@ -44,6 +45,7 @@

Scipy 0.8 Reference Guide, [HTML+zip], + [CHM], [PDF]

Numpy 1.3 Reference Guide, From scipy-svn at scipy.org Sat Sep 4 16:54:05 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 15:54:05 -0500 (CDT) Subject: [Scipy-svn] r6673 - in trunk/scipy/optimize: . tests Message-ID: <20100904205405.B947B39CCFF@scipy.org> Author: ptvirtan Date: 2010-09-04 15:54:05 -0500 (Sat, 04 Sep 2010) New Revision: 6673 Added: trunk/scipy/optimize/tests/test_linesearch.py Modified: trunk/scipy/optimize/linesearch.py trunk/scipy/optimize/optimize.py trunk/scipy/optimize/tests/test_optimize.py Log: ENH: optimize: refactor line searches to scalar search + line wrapper; move to linesearch.py Each of the existing line search functions f(x + s*p) -> suitable minimum is split to a scalar search function phi(s) -> suitable minimum and a wrapper phi_p(s) = f(x + s*p) that makes it a line search. This refactoring makes the logic in the functions slightly clearer, and makes reusing them in large-scale non-linear equation solvers (which only need 1-d searches) more straightforward. New tests for line searches are also added. These basically check that they do what they promise, for a couple of problems. Modified: trunk/scipy/optimize/linesearch.py =================================================================== --- trunk/scipy/optimize/linesearch.py 2010-09-04 17:45:31 UTC (rev 6672) +++ trunk/scipy/optimize/linesearch.py 2010-09-04 20:54:05 UTC (rev 6673) @@ -1,53 +1,593 @@ - from scipy.optimize import minpack2 -import numpy +import numpy as np -import __builtin__ -pymin = __builtin__.min +__all__ = ['line_search_wolfe1', 'line_search_wolfe2', + 'scalar_search_wolfe1', 'scalar_search_wolfe2', + 'line_search_armijo'] -def line_search(f, myfprime, xk, pk, gfk, old_fval, old_old_fval, - args=(), c1=1e-4, c2=0.9, amax=50): +#------------------------------------------------------------------------------ +# Minpack's Wolfe line and scalar searches +#------------------------------------------------------------------------------ - fc = 0 - gc = 0 - phi0 = old_fval - derphi0 = numpy.dot(gfk,pk) - alpha1 = pymin(1.0,1.01*2*(phi0-old_old_fval)/derphi0) +def line_search_wolfe1(f, fprime, xk, pk, gfk=None, + old_fval=None, old_old_fval=None, + args=(), c1=1e-4, c2=0.9, amax=50, amin=1e-8, + xtol=1e-14): + """ + As `scalar_search_wolfe1` but do a line search to direction `pk` - if isinstance(myfprime,type(())): - eps = myfprime[1] - fprime = myfprime[0] - newargs = (f,eps) + args + Parameters + ---------- + f : callable + Function `f(x)` + fprime : callable + Gradient of `f` + xk : array-like + Current point + pk : array-like + Search direction + + gfk : array-like, optional + Gradient of `f` at point `xk` + old_fval : float, optional + Value of `f` at point `xk` + old_old_fval : float, optional + Value of `f` at point preceding `xk` + + The rest of the parameters are the same as for `scalar_search_wolfe1`. + + Returns + ------- + stp, f_count, g_count, fval, old_fval + As in `line_search_wolfe1` + gval : array + Gradient of `f` at the final point + + """ + if gfk is None: + gfk = fprime(xk) + + if isinstance(fprime, tuple): + eps = fprime[1] + fprime = fprime[0] + newargs = (f, eps) + args gradient = False else: - fprime = myfprime newargs = args gradient = True - xtol = 1e-14 - amin = 1e-8 - isave = numpy.zeros((2,), numpy.intc) - dsave = numpy.zeros((13,), float) + gval = [gfk] + gc = [0] + fc = [0] + + def phi(s): + fc[0] += 1 + return f(xk + s*pk, *args) + + def derphi(s): + gval[0] = fprime(xk + s*pk, *newargs) + if gradient: + gc[0] += 1 + else: + fc[0] += len(xk) + 1 + return np.dot(gval[0], pk) + + derphi0 = np.dot(gfk, pk) + + stp, fval, old_fval = scalar_search_wolfe1( + phi, derphi, old_fval, old_old_fval, derphi0, + c1=c1, c2=c2, amax=amax, amin=amin, xtol=xtol) + + return stp, fc[0], gc[0], fval, old_fval, gval[0] + + +def scalar_search_wolfe1(phi, derphi, phi0=None, old_phi0=None, derphi0=None, + c1=1e-4, c2=0.9, + amax=50, amin=1e-8, xtol=1e-14): + """ + Scalar function search for alpha that satisfies strong Wolfe conditions + + alpha > 0 is assumed to be a descent direction. + + Parameters + ---------- + phi : callable phi(alpha) + Function at point `alpha` + derphi : callable dphi(alpha) + Derivative `d phi(alpha)/ds`. Returns a scalar. + + phi0 : float, optional + Value of `f` at 0 + old_phi0 : float, optional + Value of `f` at the previous point + derphi0 : float, optional + Value `derphi` at 0 + amax : float, optional + Maximum step size + c1, c2 : float, optional + Wolfe parameters + + Returns + ------- + alpha : float + Step size, or None if no suitable step was found + phi : float + Value of `phi` at the new point `alpha` + phi0 : float + Value of `phi` at `alpha=0` + + Notes + ----- + Uses routine DCSRCH from MINPACK. + + """ + + if phi0 is None: + phi0 = phi(0.) + if derphi0 is None: + derphi0 = derphi(0.) + + if old_phi0 is not None: + alpha1 = min(1.0, 1.01*2*(phi0 - old_phi0)/derphi0) + if alpha1 < 0: + alpha1 = 1.0 + else: + alpha1 = 1.0 + + phi1 = phi0 + derphi1 = derphi0 + isave = np.zeros((2,), np.intc) + dsave = np.zeros((13,), float) task = 'START' - fval = old_fval - gval = gfk while 1: - stp,fval,derphi,task = minpack2.dcsrch(alpha1, phi0, derphi0, c1, c2, - xtol, task, amin, amax,isave,dsave) - + stp, phi1, derphi1, task = minpack2.dcsrch(alpha1, phi1, derphi1, + c1, c2, xtol, task, + amin, amax, isave, dsave) if task[:2] == 'FG': alpha1 = stp - fval = f(xk+stp*pk,*args) - fc += 1 - gval = fprime(xk+stp*pk,*newargs) - if gradient: gc += 1 - else: fc += len(xk) + 1 - phi0 = fval - derphi0 = numpy.dot(gval,pk) + phi1 = phi(stp) + derphi1 = derphi(stp) else: break - if task[:5] == 'ERROR' or task[1:4] == 'WARN': + if task[:5] == 'ERROR': stp = None # failed - return stp, fc, gc, fval, old_fval, gval + + return stp, phi1, phi0 + +line_search = line_search_wolfe1 + +#------------------------------------------------------------------------------ +# Pure-Python Wolfe line and scalar searches +#------------------------------------------------------------------------------ + +def line_search_wolfe2(f, myfprime, xk, pk, gfk=None, old_fval=None, + old_old_fval=None, args=(), c1=1e-4, c2=0.9, amax=50): + """Find alpha that satisfies strong Wolfe conditions. + + Parameters + ---------- + f : callable f(x,*args) + Objective function. + myfprime : callable f'(x,*args) + Objective function gradient (can be None). + xk : ndarray + Starting point. + pk : ndarray + Search direction. + gfk : ndarray, optional + Gradient value for x=xk (xk being the current parameter + estimate). Will be recomputed if omitted. + old_fval : float, optional + Function value for x=xk. Will be recomputed if omitted. + old_old_fval : float, optional + Function value for the point preceding x=xk + args : tuple, optional + Additional arguments passed to objective function. + c1 : float, optional + Parameter for Armijo condition rule. + c2 : float, optional + Parameter for curvature condition rule. + + Returns + ------- + alpha0 : float + Alpha for which ``x_new = x0 + alpha * pk``. + fc : int + Number of function evaluations made. + gc : int + Number of gradient evaluations made. + + Notes + ----- + Uses the line search algorithm to enforce strong Wolfe + conditions. See Wright and Nocedal, 'Numerical Optimization', + 1999, pg. 59-60. + + For the zoom phase it uses an algorithm by [...]. + + """ + fc = [0] + gc = [0] + gval = [None] + + def phi(alpha): + fc[0] += 1 + return f(xk + alpha * pk, *args) + + if isinstance(myfprime, tuple): + def derphi(alpha): + fc[0] += len(xk)+1 + eps = myfprime[1] + fprime = myfprime[0] + newargs = (f,eps) + args + gval[0] = fprime(xk+alpha*pk, *newargs) # store for later use + return np.dot(gval[0], pk) + else: + fprime = myfprime + def derphi(alpha): + gc[0] += 1 + gval[0] = fprime(xk+alpha*pk, *args) # store for later use + return np.dot(gval[0], pk) + + derphi0 = np.dot(gfk, pk) + + alpha_star, phi_star, old_fval, derphi_star = \ + scalar_search_wolfe2(phi, derphi, old_fval, old_old_fval, + derphi0, c1, c2, amax) + + if derphi_star is not None: + # derphi_star is a number (derphi) -- so use the most recently + # calculated gradient used in computing it derphi = gfk*pk + # this is the gradient at the next step no need to compute it + # again in the outer loop. + derphi_star = gval[0] + + return alpha_star, fc[0], gc[0], phi_star, old_fval, derphi_star + + +def scalar_search_wolfe2(phi, derphi=None, phi0=None, + old_phi0=None, derphi0=None, + c1=1e-4, c2=0.9, amax=50): + """Find alpha that satisfies strong Wolfe conditions. + + alpha > 0 is assumed to be a descent direction. + + Parameters + ---------- + phi : callable f(x,*args) + Objective scalar function. + + derphi : callable f'(x,*args), optional + Objective function derivative (can be None) + phi0 : float, optional + Value of phi at s=0 + old_phi0 : float, optional + Value of phi at previous point + derphi0 : float, optional + Value of derphi at s=0 + args : tuple + Additional arguments passed to objective function. + c1 : float + Parameter for Armijo condition rule. + c2 : float + Parameter for curvature condition rule. + + Returns + ------- + alpha_star : float + Best alpha + phi_star + phi at alpha_star + phi0 + phi at 0 + derphi_star + derphi at alpha_star + + Notes + ----- + Uses the line search algorithm to enforce strong Wolfe + conditions. See Wright and Nocedal, 'Numerical Optimization', + 1999, pg. 59-60. + + For the zoom phase it uses an algorithm by [...]. + + """ + + if phi0 is None: + phi0 = phi(0.) + + if derphi0 is None and derphi is not None: + derphi0 = derphi(0.) + + alpha0 = 0 + if old_phi0 is not None: + alpha1 = min(1.0, 1.01*2*(phi0 - old_phi0)/derphi0) + else: + alpha1 = 1.0 + + if alpha1 < 0: + alpha1 = 1.0 + + if alpha1 == 0: + # This shouldn't happen. Perhaps the increment has slipped below + # machine precision? For now, set the return variables skip the + # useless while loop, and raise warnflag=2 due to possible imprecision. + alpha_star = None + phi_star = phi0 + phi0 = old_phi0 + derphi_star = None + + phi_a1 = phi(alpha1) + #derphi_a1 = derphi(alpha1) evaluated below + + phi_a0 = phi0 + derphi_a0 = derphi0 + + i = 1 + maxiter = 10 + while 1: # bracketing phase + if alpha1 == 0: + break + if (phi_a1 > phi0 + c1*alpha1*derphi0) or \ + ((phi_a1 >= phi_a0) and (i > 1)): + alpha_star, phi_star, derphi_star = \ + _zoom(alpha0, alpha1, phi_a0, + phi_a1, derphi_a0, phi, derphi, + phi0, derphi0, c1, c2) + break + + derphi_a1 = derphi(alpha1) + if (abs(derphi_a1) <= -c2*derphi0): + alpha_star = alpha1 + phi_star = phi_a1 + derphi_star = derphi_a1 + break + + if (derphi_a1 >= 0): + alpha_star, phi_star, derphi_star = \ + _zoom(alpha1, alpha0, phi_a1, + phi_a0, derphi_a1, phi, derphi, + phi0, derphi0, c1, c2) + break + + alpha2 = 2 * alpha1 # increase by factor of two on each iteration + i = i + 1 + alpha0 = alpha1 + alpha1 = alpha2 + phi_a0 = phi_a1 + phi_a1 = phi(alpha1) + derphi_a0 = derphi_a1 + + # stopping test if lower function not found + if i > maxiter: + alpha_star = alpha1 + phi_star = phi_a1 + derphi_star = None + break + + return alpha_star, phi_star, phi0, derphi_star + + +def _cubicmin(a,fa,fpa,b,fb,c,fc): + """ + Finds the minimizer for a cubic polynomial that goes through the + points (a,fa), (b,fb), and (c,fc) with derivative at a of fpa. + + If no minimizer can be found return None + + """ + # f(x) = A *(x-a)^3 + B*(x-a)^2 + C*(x-a) + D + + C = fpa + D = fa + db = b-a + dc = c-a + if (db == 0) or (dc == 0) or (b==c): return None + denom = (db*dc)**2 * (db-dc) + d1 = np.empty((2,2)) + d1[0,0] = dc**2 + d1[0,1] = -db**2 + d1[1,0] = -dc**3 + d1[1,1] = db**3 + [A,B] = np.dot(d1, np.asarray([fb-fa-C*db,fc-fa-C*dc]).flatten()) + A /= denom + B /= denom + radical = B*B-3*A*C + if radical < 0: return None + if (A == 0): return None + xmin = a + (-B + np.sqrt(radical))/(3*A) + return xmin + + +def _quadmin(a,fa,fpa,b,fb): + """ + Finds the minimizer for a quadratic polynomial that goes through + the points (a,fa), (b,fb) with derivative at a of fpa, + + """ + # f(x) = B*(x-a)^2 + C*(x-a) + D + D = fa + C = fpa + db = b-a*1.0 + if (db==0): return None + B = (fb-D-C*db)/(db*db) + if (B <= 0): return None + xmin = a - C / (2.0*B) + return xmin + +def _zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, + phi, derphi, phi0, derphi0, c1, c2): + """ + Part of the optimization algorithm in `scalar_search_wolfe2`. + """ + + maxiter = 10 + i = 0 + delta1 = 0.2 # cubic interpolant check + delta2 = 0.1 # quadratic interpolant check + phi_rec = phi0 + a_rec = 0 + while 1: + # interpolate to find a trial step length between a_lo and + # a_hi Need to choose interpolation here. Use cubic + # interpolation and then if the result is within delta * + # dalpha or outside of the interval bounded by a_lo or a_hi + # then use quadratic interpolation, if the result is still too + # close, then use bisection + + dalpha = a_hi-a_lo; + if dalpha < 0: a,b = a_hi,a_lo + else: a,b = a_lo, a_hi + + # minimizer of cubic interpolant + # (uses phi_lo, derphi_lo, phi_hi, and the most recent value of phi) + # + # if the result is too close to the end points (or out of the + # interval) then use quadratic interpolation with phi_lo, + # derphi_lo and phi_hi if the result is stil too close to the + # end points (or out of the interval) then use bisection + + if (i > 0): + cchk = delta1*dalpha + a_j = _cubicmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi, a_rec, phi_rec) + if (i==0) or (a_j is None) or (a_j > b-cchk) or (a_j < a+cchk): + qchk = delta2*dalpha + a_j = _quadmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi) + if (a_j is None) or (a_j > b-qchk) or (a_j < a+qchk): + a_j = a_lo + 0.5*dalpha + + # Check new value of a_j + + phi_aj = phi(a_j) + if (phi_aj > phi0 + c1*a_j*derphi0) or (phi_aj >= phi_lo): + phi_rec = phi_hi + a_rec = a_hi + a_hi = a_j + phi_hi = phi_aj + else: + derphi_aj = derphi(a_j) + if abs(derphi_aj) <= -c2*derphi0: + a_star = a_j + val_star = phi_aj + valprime_star = derphi_aj + break + if derphi_aj*(a_hi - a_lo) >= 0: + phi_rec = phi_hi + a_rec = a_hi + a_hi = a_lo + phi_hi = phi_lo + else: + phi_rec = phi_lo + a_rec = a_lo + a_lo = a_j + phi_lo = phi_aj + derphi_lo = derphi_aj + i += 1 + if (i > maxiter): + a_star = a_j + val_star = phi_aj + valprime_star = None + break + return a_star, val_star, valprime_star + + +#------------------------------------------------------------------------------ +# Armijo line and scalar searches +#------------------------------------------------------------------------------ + +def line_search_armijo(f, xk, pk, gfk, old_fval, args=(), c1=1e-4, alpha0=1): + """Minimize over alpha, the function ``f(xk+alpha pk)``. + + Uses the interpolation algorithm (Armijo backtracking) as suggested by + Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57 + + Returns + ------- + alpha + f_count + f_val_at_alpha + + """ + xk = np.atleast_1d(xk) + fc = [0] + + def phi(alpha1): + fc[0] += 1 + return f(xk + alpha1*pk, *args) + + if old_fval is None: + phi0 = phi(0.) + else: + phi0 = old_fval # compute f(xk) -- done in past loop + + derphi0 = np.dot(gfk, pk) + alpha, phi1 = scalar_search_armijo(phi, phi0, derphi0, c1=c1, alpha0=alpha0) + return alpha, fc[0], phi1 + +def line_search_BFGS(f, xk, pk, gfk, old_fval, args=(), c1=1e-4, alpha0=1): + """ + Compatibility wrapper for `line_search_armijo` + """ + r = line_search_armijo(f, xk, pk, gfk, old_fval, args=args, c1=c1, + alpha0=alpha0) + return r[0], r[1], 0, r[2] + +def scalar_search_armijo(phi, phi0, derphi0, c1=1e-4, alpha0=1, amin=0): + """Minimize over alpha, the function ``phi(alpha)``. + + Uses the interpolation algorithm (Armijo backtracking) as suggested by + Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57 + + alpha > 0 is assumed to be a descent direction. + + Returns + ------- + alpha + phi1 + + """ + phi_a0 = phi(alpha0) + if phi_a0 <= phi0 + c1*alpha0*derphi0: + return alpha0, phi_a0 + + # Otherwise compute the minimizer of a quadratic interpolant: + + alpha1 = -(derphi0) * alpha0**2 / 2.0 / (phi_a0 - phi0 - derphi0 * alpha0) + phi_a1 = phi(alpha1) + + if (phi_a1 <= phi0 + c1*alpha1*derphi0): + return alpha1, phi_a1 + + # Otherwise loop with cubic interpolation until we find an alpha which + # satifies the first Wolfe condition (since we are backtracking, we will + # assume that the value of alpha is not too small and satisfies the second + # condition. + + while alpha1 > amin: # we are assuming alpha>0 is a descent direction + factor = alpha0**2 * alpha1**2 * (alpha1-alpha0) + a = alpha0**2 * (phi_a1 - phi0 - derphi0*alpha1) - \ + alpha1**2 * (phi_a0 - phi0 - derphi0*alpha0) + a = a / factor + b = -alpha0**3 * (phi_a1 - phi0 - derphi0*alpha1) + \ + alpha1**3 * (phi_a0 - phi0 - derphi0*alpha0) + b = b / factor + + alpha2 = (-b + np.sqrt(abs(b**2 - 3 * a * derphi0))) / (3.0*a) + phi_a2 = phi(alpha2) + + if (phi_a2 <= phi0 + c1*alpha2*derphi0): + return alpha2, phi_a2 + + if (alpha1 - alpha2) > alpha1 / 2.0 or (1 - alpha2/alpha1) < 0.96: + alpha2 = alpha1 / 2.0 + + alpha0 = alpha1 + alpha1 = alpha2 + phi_a0 = phi_a1 + phi_a1 = phi_a2 + + # Failed to find a suitable step length + return None, phi_a1 + Modified: trunk/scipy/optimize/optimize.py =================================================================== --- trunk/scipy/optimize/optimize.py 2010-09-04 17:45:31 UTC (rev 6672) +++ trunk/scipy/optimize/optimize.py 2010-09-04 20:54:05 UTC (rev 6673) @@ -25,7 +25,9 @@ import numpy from numpy import atleast_1d, eye, mgrid, argmin, zeros, shape, empty, \ squeeze, vectorize, asarray, absolute, sqrt, Inf, asfarray, isinf -import linesearch +from linesearch import \ + line_search_BFGS, line_search_wolfe1, line_search_wolfe2, \ + line_search_wolfe2 as line_search # These have been copied from Numeric's MLab.py # I don't think they made the transition to scipy_core @@ -294,324 +296,6 @@ return retlist - -def _cubicmin(a,fa,fpa,b,fb,c,fc): - # finds the minimizer for a cubic polynomial that goes through the - # points (a,fa), (b,fb), and (c,fc) with derivative at a of fpa. - # - # if no minimizer can be found return None - # - # f(x) = A *(x-a)^3 + B*(x-a)^2 + C*(x-a) + D - - C = fpa - D = fa - db = b-a - dc = c-a - if (db == 0) or (dc == 0) or (b==c): return None - denom = (db*dc)**2 * (db-dc) - d1 = empty((2,2)) - d1[0,0] = dc**2 - d1[0,1] = -db**2 - d1[1,0] = -dc**3 - d1[1,1] = db**3 - [A,B] = numpy.dot(d1,asarray([fb-fa-C*db,fc-fa-C*dc]).flatten()) - A /= denom - B /= denom - radical = B*B-3*A*C - if radical < 0: return None - if (A == 0): return None - xmin = a + (-B + sqrt(radical))/(3*A) - return xmin - - -def _quadmin(a,fa,fpa,b,fb): - # finds the minimizer for a quadratic polynomial that goes through - # the points (a,fa), (b,fb) with derivative at a of fpa - # f(x) = B*(x-a)^2 + C*(x-a) + D - D = fa - C = fpa - db = b-a*1.0 - if (db==0): return None - B = (fb-D-C*db)/(db*db) - if (B <= 0): return None - xmin = a - C / (2.0*B) - return xmin - -def zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, - phi, derphi, phi0, derphi0, c1, c2): - maxiter = 10 - i = 0 - delta1 = 0.2 # cubic interpolant check - delta2 = 0.1 # quadratic interpolant check - phi_rec = phi0 - a_rec = 0 - while 1: - # interpolate to find a trial step length between a_lo and - # a_hi Need to choose interpolation here. Use cubic - # interpolation and then if the result is within delta * - # dalpha or outside of the interval bounded by a_lo or a_hi - # then use quadratic interpolation, if the result is still too - # close, then use bisection - - dalpha = a_hi-a_lo; - if dalpha < 0: a,b = a_hi,a_lo - else: a,b = a_lo, a_hi - - # minimizer of cubic interpolant - # (uses phi_lo, derphi_lo, phi_hi, and the most recent value of phi) - # if the result is too close to the end points (or out of - # the interval) then use quadratic interpolation with - # phi_lo, derphi_lo and phi_hi - # if the result is stil too close to the end points (or - # out of the interval) then use bisection - - if (i > 0): - cchk = delta1*dalpha - a_j = _cubicmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi, a_rec, phi_rec) - if (i==0) or (a_j is None) or (a_j > b-cchk) or (a_j < a+cchk): - qchk = delta2*dalpha - a_j = _quadmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi) - if (a_j is None) or (a_j > b-qchk) or (a_j < a+qchk): - a_j = a_lo + 0.5*dalpha -# print "Using bisection." -# else: print "Using quadratic." -# else: print "Using cubic." - - # Check new value of a_j - - phi_aj = phi(a_j) - if (phi_aj > phi0 + c1*a_j*derphi0) or (phi_aj >= phi_lo): - phi_rec = phi_hi - a_rec = a_hi - a_hi = a_j - phi_hi = phi_aj - else: - derphi_aj = derphi(a_j) - if abs(derphi_aj) <= -c2*derphi0: - a_star = a_j - val_star = phi_aj - valprime_star = derphi_aj - break - if derphi_aj*(a_hi - a_lo) >= 0: - phi_rec = phi_hi - a_rec = a_hi - a_hi = a_lo - phi_hi = phi_lo - else: - phi_rec = phi_lo - a_rec = a_lo - a_lo = a_j - phi_lo = phi_aj - derphi_lo = derphi_aj - i += 1 - if (i > maxiter): - a_star = a_j - val_star = phi_aj - valprime_star = None - break - return a_star, val_star, valprime_star - -def line_search(f, myfprime, xk, pk, gfk, old_fval, old_old_fval, - args=(), c1=1e-4, c2=0.9, amax=50): - """Find alpha that satisfies strong Wolfe conditions. - - Parameters - ---------- - f : callable f(x,*args) - Objective function. - myfprime : callable f'(x,*args) - Objective function gradient (can be None). - xk : ndarray - Starting point. - pk : ndarray - Search direction. - gfk : ndarray - Gradient value for x=xk (xk being the current parameter - estimate). - args : tuple - Additional arguments passed to objective function. - c1 : float - Parameter for Armijo condition rule. - c2 : float - Parameter for curvature condition rule. - - Returns - ------- - alpha0 : float - Alpha for which ``x_new = x0 + alpha * pk``. - fc : int - Number of function evaluations made. - gc : int - Number of gradient evaluations made. - - Notes - ----- - Uses the line search algorithm to enforce strong Wolfe - conditions. See Wright and Nocedal, 'Numerical Optimization', - 1999, pg. 59-60. - - For the zoom phase it uses an algorithm by [...]. - - """ - - global _ls_fc, _ls_gc, _ls_ingfk - _ls_fc = 0 - _ls_gc = 0 - _ls_ingfk = None - def phi(alpha): - global _ls_fc - _ls_fc += 1 - return f(xk+alpha*pk,*args) - - if isinstance(myfprime,type(())): - def phiprime(alpha): - global _ls_fc, _ls_ingfk - _ls_fc += len(xk)+1 - eps = myfprime[1] - fprime = myfprime[0] - newargs = (f,eps) + args - _ls_ingfk = fprime(xk+alpha*pk,*newargs) # store for later use - return numpy.dot(_ls_ingfk,pk) - else: - fprime = myfprime - def phiprime(alpha): - global _ls_gc, _ls_ingfk - _ls_gc += 1 - _ls_ingfk = fprime(xk+alpha*pk,*args) # store for later use - return numpy.dot(_ls_ingfk,pk) - - alpha0 = 0 - phi0 = old_fval - derphi0 = numpy.dot(gfk,pk) - - alpha1 = pymin(1.0,1.01*2*(phi0-old_old_fval)/derphi0) - - if alpha1 == 0: - # This shouldn't happen. Perhaps the increment has slipped below - # machine precision? For now, set the return variables skip the - # useless while loop, and raise warnflag=2 due to possible imprecision. - alpha_star = None - fval_star = old_fval - old_fval = old_old_fval - fprime_star = None - - phi_a1 = phi(alpha1) - #derphi_a1 = phiprime(alpha1) evaluated below - - phi_a0 = phi0 - derphi_a0 = derphi0 - - i = 1 - maxiter = 10 - while 1: # bracketing phase - if alpha1 == 0: - break - if (phi_a1 > phi0 + c1*alpha1*derphi0) or \ - ((phi_a1 >= phi_a0) and (i > 1)): - alpha_star, fval_star, fprime_star = \ - zoom(alpha0, alpha1, phi_a0, - phi_a1, derphi_a0, phi, phiprime, - phi0, derphi0, c1, c2) - break - - derphi_a1 = phiprime(alpha1) - if (abs(derphi_a1) <= -c2*derphi0): - alpha_star = alpha1 - fval_star = phi_a1 - fprime_star = derphi_a1 - break - - if (derphi_a1 >= 0): - alpha_star, fval_star, fprime_star = \ - zoom(alpha1, alpha0, phi_a1, - phi_a0, derphi_a1, phi, phiprime, - phi0, derphi0, c1, c2) - break - - alpha2 = 2 * alpha1 # increase by factor of two on each iteration - i = i + 1 - alpha0 = alpha1 - alpha1 = alpha2 - phi_a0 = phi_a1 - phi_a1 = phi(alpha1) - derphi_a0 = derphi_a1 - - # stopping test if lower function not found - if (i > maxiter): - alpha_star = alpha1 - fval_star = phi_a1 - fprime_star = None - break - - if fprime_star is not None: - # fprime_star is a number (derphi) -- so use the most recently - # calculated gradient used in computing it derphi = gfk*pk - # this is the gradient at the next step no need to compute it - # again in the outer loop. - fprime_star = _ls_ingfk - - return alpha_star, _ls_fc, _ls_gc, fval_star, old_fval, fprime_star - - -def line_search_BFGS(f, xk, pk, gfk, old_fval, args=(), c1=1e-4, alpha0=1): - """Minimize over alpha, the function ``f(xk+alpha pk)``. - - Uses the interpolation algorithm (Armiijo backtracking) as suggested by - Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57 - - :Returns: (alpha, fc, gc) - - """ - - xk = atleast_1d(xk) - fc = 0 - phi0 = old_fval # compute f(xk) -- done in past loop - phi_a0 = f(*((xk+alpha0*pk,)+args)) - fc = fc + 1 - derphi0 = numpy.dot(gfk,pk) - - if (phi_a0 <= phi0 + c1*alpha0*derphi0): - return alpha0, fc, 0, phi_a0 - - # Otherwise compute the minimizer of a quadratic interpolant: - - alpha1 = -(derphi0) * alpha0**2 / 2.0 / (phi_a0 - phi0 - derphi0 * alpha0) - phi_a1 = f(*((xk+alpha1*pk,)+args)) - fc = fc + 1 - - if (phi_a1 <= phi0 + c1*alpha1*derphi0): - return alpha1, fc, 0, phi_a1 - - # Otherwise loop with cubic interpolation until we find an alpha which - # satifies the first Wolfe condition (since we are backtracking, we will - # assume that the value of alpha is not too small and satisfies the second - # condition. - - while 1: # we are assuming pk is a descent direction - factor = alpha0**2 * alpha1**2 * (alpha1-alpha0) - a = alpha0**2 * (phi_a1 - phi0 - derphi0*alpha1) - \ - alpha1**2 * (phi_a0 - phi0 - derphi0*alpha0) - a = a / factor - b = -alpha0**3 * (phi_a1 - phi0 - derphi0*alpha1) + \ - alpha1**3 * (phi_a0 - phi0 - derphi0*alpha0) - b = b / factor - - alpha2 = (-b + numpy.sqrt(abs(b**2 - 3 * a * derphi0))) / (3.0*a) - phi_a2 = f(*((xk+alpha2*pk,)+args)) - fc = fc + 1 - - if (phi_a2 <= phi0 + c1*alpha2*derphi0): - return alpha2, fc, 0, phi_a2 - - if (alpha1 - alpha2) > alpha1 / 2.0 or (1 - alpha2/alpha1) < 0.96: - alpha2 = alpha1 / 2.0 - - alpha0 = alpha1 - alpha1 = alpha2 - phi_a0 = phi_a1 - phi_a1 = phi_a2 - - def approx_fprime(xk,f,epsilon,*args): f0 = f(*((xk,)+args)) grad = numpy.zeros((len(xk),), float) @@ -723,12 +407,12 @@ while (gnorm > gtol) and (k < maxiter): pk = -numpy.dot(Hk,gfk) alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ - linesearch.line_search(f,myfprime,xk,pk,gfk, - old_fval,old_old_fval) + line_search_wolfe1(f,myfprime,xk,pk,gfk, + old_fval,old_old_fval) if alpha_k is None: # line search failed try different one. alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ - line_search(f,myfprime,xk,pk,gfk, - old_fval,old_old_fval) + line_search_wolfe2(f,myfprime,xk,pk,gfk, + old_fval,old_old_fval) if alpha_k is None: # This line search also failed to find a better solution. warnflag = 2 @@ -894,12 +578,12 @@ old_old_fval_backup = old_old_fval alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ - linesearch.line_search(f,myfprime,xk,pk,gfk,old_fval, + line_search_wolfe1(f,myfprime,xk,pk,gfk,old_fval, old_old_fval,c2=0.4) if alpha_k is None: # line search failed -- use different one. alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ - line_search(f,myfprime,xk,pk,gfk, - old_fval_backup,old_old_fval_backup) + line_search_wolfe2(f,myfprime,xk,pk,gfk, + old_fval_backup,old_old_fval_backup) if alpha_k is None or alpha_k == 0: # This line search also failed to find a better solution. warnflag = 2 Added: trunk/scipy/optimize/tests/test_linesearch.py =================================================================== --- trunk/scipy/optimize/tests/test_linesearch.py (rev 0) +++ trunk/scipy/optimize/tests/test_linesearch.py 2010-09-04 20:54:05 UTC (rev 6673) @@ -0,0 +1,234 @@ +""" +Tests for line search routines +""" + +from numpy.testing import * +import scipy.optimize.linesearch as ls +import numpy as np + +def assert_wolfe(s, phi, derphi, c1=1e-4, c2=0.9, err_msg=""): + """ + Check that strong Wolfe conditions apply + """ + phi1 = phi(s) + phi0 = phi(0) + derphi0 = derphi(0) + derphi1 = derphi(s) + msg = "s = %s; phi(0) = %s; phi(s) = %s; phi'(0) = %s; phi'(s) = %s; %s" % ( + s, phi0, phi1, derphi0, derphi1, err_msg) + + assert_(phi1 <= phi0 + c1*s*derphi0, "Wolfe 1 failed: "+ msg) + assert_(abs(derphi1) <= abs(c2*derphi0), "Wolfe 2 failed: "+ msg) + +def assert_armijo(s, phi, c1=1e-4, err_msg=""): + """ + Check that Armijo condition applies + """ + phi1 = phi(s) + phi0 = phi(0) + msg = "s = %s; phi(0) = %s; phi(s) = %s; %s" % (s, phi0, phi1, err_msg) + assert_(phi1 <= (1 - c1*s)*phi0, msg) + +def assert_line_wolfe(x, p, s, f, fprime, **kw): + assert_wolfe(s, phi=lambda sp: f(x + p*sp), + derphi=lambda sp: np.dot(fprime(x + p*sp), p), **kw) + +def assert_line_armijo(x, p, s, f, **kw): + assert_armijo(s, phi=lambda sp: f(x + p*sp), **kw) + + +class TestLineSearch(object): + # -- scalar functions; must have dphi(0.) < 0 + def _scalar_func_1(self, s): + self.fcount += 1 + p = -s - s**3 + s**4 + dp = -1 - 3*s**2 + 4*s**3 + return p, dp + + def _scalar_func_2(self, s): + self.fcount += 1 + p = np.exp(-4*s) + s**2 + dp = -4*np.exp(-4*s) + 2*s + return p, dp + + def _scalar_func_3(self, s): + self.fcount += 1 + p = -np.sin(10*s) + dp = -10*np.cos(10*s) + return p, dp + + # -- n-d functions + + def _line_func_1(self, x): + self.fcount += 1 + f = np.dot(x, x) + df = 2*x + return f, df + + def _line_func_2(self, x): + self.fcount += 1 + f = np.dot(x, np.dot(self.A, x)) + 1 + df = np.dot(self.A + self.A.T, x) + return f, df + + # -- + + def __init__(self): + self.scalar_funcs = [] + self.line_funcs = [] + self.N = 20 + self.fcount = 0 + + def bind_index(func, idx): + # Remember Python's closure semantics! + return lambda *a, **kw: func(*a, **kw)[idx] + + for name in sorted(dir(self)): + if name.startswith('_scalar_func_'): + value = getattr(self, name) + self.scalar_funcs.append( + (name, bind_index(value, 0), bind_index(value, 1))) + elif name.startswith('_line_func_'): + value = getattr(self, name) + self.line_funcs.append( + (name, bind_index(value, 0), bind_index(value, 1))) + + def setUp(self): + np.random.seed(1234) + self.A = np.random.randn(self.N, self.N) + + def scalar_iter(self): + for name, phi, derphi in self.scalar_funcs: + for old_phi0 in np.random.randn(3): + yield name, phi, derphi, old_phi0 + + def line_iter(self): + for name, f, fprime in self.line_funcs: + k = 0 + while k < 9: + x = np.random.randn(self.N) + p = np.random.randn(self.N) + if np.dot(p, fprime(x)) >= 0: + # always pick a descent direction + continue + k += 1 + old_fv = float(np.random.randn()) + yield name, f, fprime, x, p, old_fv + + # -- Generic scalar searches + + def test_scalar_search_wolfe1(self): + c = 0 + for name, phi, derphi, old_phi0 in self.scalar_iter(): + c += 1 + s, phi1, phi0 = ls.scalar_search_wolfe1(phi, derphi, phi(0), + old_phi0, derphi(0)) + assert_equal(phi0, phi(0)) + assert_equal(phi1, phi(s)) + assert_wolfe(s, phi, derphi) + + assert c > 3 # check that the iterator really works... + + def test_scalar_search_wolfe2(self): + for name, phi, derphi, old_phi0 in self.scalar_iter(): + s, phi1, phi0, derphi1 = ls.scalar_search_wolfe2( + phi, derphi, phi(0), old_phi0, derphi(0)) + assert_equal(phi0, phi(0), name) + assert_equal(phi1, phi(s), name) + if derphi1 is not None: + assert_equal(derphi1, derphi(s), name) + assert_wolfe(s, phi, derphi, err_msg="%s %g" % (name, old_phi0)) + + def test_scalar_search_armijo(self): + for name, phi, derphi, old_phi0 in self.scalar_iter(): + s, phi1 = ls.scalar_search_armijo(phi, phi(0), derphi(0)) + assert_equal(phi1, phi(s), name) + assert_armijo(s, phi, err_msg="%s %g" % (name, old_phi0)) + + # -- Generic line searches + + def test_line_search_wolfe1(self): + c = 0 + smax = 100 + for name, f, fprime, x, p, old_f in self.line_iter(): + f0 = f(x) + g0 = fprime(x) + self.fcount = 0 + s, fc, gc, fv, ofv, gv = ls.line_search_wolfe1(f, fprime, x, p, + g0, f0, old_f, + amax=smax) + assert_equal(self.fcount, fc+gc) + assert_equal(ofv, f(x)) + assert_equal(fv, f(x + s*p)) + assert_equal(gv, fprime(x + s*p)) + if s < smax: + c += 1 + assert_line_wolfe(x, p, s, f, fprime, err_msg=name) + + assert c > 3 # check that the iterator really works... + + def test_line_search_wolfe2(self): + c = 0 + smax = 100 + for name, f, fprime, x, p, old_f in self.line_iter(): + f0 = f(x) + g0 = fprime(x) + self.fcount = 0 + s, fc, gc, fv, ofv, gv = ls.line_search_wolfe2(f, fprime, x, p, + g0, f0, old_f, + amax=smax) + assert_equal(self.fcount, fc+gc) + assert_equal(ofv, f(x)) + assert_equal(fv, f(x + s*p)) + if gv is not None: + assert_equal(gv, fprime(x + s*p)) + if s < smax: + c += 1 + assert_line_wolfe(x, p, s, f, fprime, err_msg=name) + assert c > 3 # check that the iterator really works... + + def test_line_search_armijo(self): + c = 0 + for name, f, fprime, x, p, old_f in self.line_iter(): + f0 = f(x) + g0 = fprime(x) + self.fcount = 0 + s, fc, fv = ls.line_search_armijo(f, x, p, g0, f0) + c += 1 + assert_equal(self.fcount, fc) + assert_equal(fv, f(x + s*p)) + assert_line_armijo(x, p, s, f, err_msg=name) + assert c >= 9 + + # -- More specific tests + + def test_armijo_terminate_1(self): + # Armijo should evaluate the function only once if the trial step + # is already suitable + count = [0] + def phi(s): + count[0] += 1 + return -s + 0.01*s**2 + s, phi1 = ls.scalar_search_armijo(phi, phi(0), -1, alpha0=1) + assert_equal(s, 1) + assert_equal(count[0], 2) + assert_armijo(s, phi) + + def test_wolfe_terminate(self): + # wolfe1 and wolfe2 should also evaluate the function only a few + # times if the trial step is already suitable + + def phi(s): + count[0] += 1 + return -s + 0.05*s**2 + + def derphi(s): + count[0] += 1 + return -1 + 0.05*2*s + + for func in [ls.scalar_search_wolfe1, ls.scalar_search_wolfe2]: + count = [0] + r = func(phi, derphi, phi(0), None, derphi(0)) + assert r[0] is not None, (r, func) + assert count[0] <= 2 + 2, (count, func) + assert_wolfe(r[0], phi, derphi, err_msg=str(func)) Modified: trunk/scipy/optimize/tests/test_optimize.py =================================================================== --- trunk/scipy/optimize/tests/test_optimize.py 2010-09-04 17:45:31 UTC (rev 6672) +++ trunk/scipy/optimize/tests/test_optimize.py 2010-09-04 20:54:05 UTC (rev 6673) @@ -177,18 +177,10 @@ assert self.gradcalls == 18, self.gradcalls # 0.8.0 #assert self.gradcalls == 22, self.gradcalls # 0.7.0 - # Ensure that the function behaves the same; - - # # This is from Scipy 0.7.0 - #assert np.allclose(self.trace[3:5], - # [[-4.35700753e-07, -5.24869435e-01, 4.87527480e-01], - # [-4.35700753e-07, -5.24869401e-01, 4.87527774e-01]], - # atol=1e-14, rtol=1e-7), self.trace[3:5] - - # This if from Scipy 0.8.0; with some fixes in ncg + # Ensure that the function behaves the same; this is from Scipy 0.7.0 assert np.allclose(self.trace[3:5], - [[-2.90334653e-07,-5.24869431e-01,4.87527470e-01], - [-2.90334653e-07,-5.24869375e-01,4.87527680e-01]], + [[-4.35700753e-07, -5.24869435e-01, 4.87527480e-01], + [-4.35700753e-07, -5.24869401e-01, 4.87527774e-01]], atol=1e-14, rtol=1e-7), self.trace[3:5] From scipy-svn at scipy.org Sat Sep 4 18:53:26 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 17:53:26 -0500 (CDT) Subject: [Scipy-svn] r6674 - trunk/scipy/sparse/linalg/isolve Message-ID: <20100904225326.97EA939CD4B@scipy.org> Author: ptvirtan Date: 2010-09-04 17:53:26 -0500 (Sat, 04 Sep 2010) New Revision: 6674 Modified: trunk/scipy/sparse/linalg/isolve/iterative.py Log: BUG: sparse.linalg: clarify that the sparse solver tolerance is both absolute and relative Modified: trunk/scipy/sparse/linalg/isolve/iterative.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/iterative.py 2010-09-04 20:54:05 UTC (rev 6673) +++ trunk/scipy/sparse/linalg/isolve/iterative.py 2010-09-04 22:53:26 UTC (rev 6674) @@ -26,7 +26,8 @@ x0 : {array, matrix} Starting guess for the solution. tol : float - Relative tolerance to achieve before terminating. + Tolerance to achieve. The algorithm terminates when either the relative + or the absolute residual is below `tol`. maxiter : integer Maximum number of iterations. Iteration will stop after maxiter steps even if the specified tolerance has not been achieved. @@ -318,8 +319,9 @@ x0 : {array, matrix} Starting guess for the solution. tol : float - Relative tolerance to achieve before terminating. - restart : integer, optional + Tolerance to achieve. The algorithm terminates when either the relative + or the absolute residual is below `tol`. + restart : integer Number of iterations between restarts. Larger values increase iteration cost, but may be necessary for convergence. (Default: 20) @@ -463,7 +465,8 @@ x0 : {array, matrix} Starting guess for the solution. tol : float - Relative tolerance to achieve before terminating. + Tolerance to achieve. The algorithm terminates when either the relative + or the absolute residual is below `tol`. maxiter : integer Maximum number of iterations. Iteration will stop after maxiter steps even if the specified tolerance has not been achieved. From scipy-svn at scipy.org Sat Sep 4 18:53:52 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 17:53:52 -0500 (CDT) Subject: [Scipy-svn] r6675 - in trunk: doc/source scipy/optimize scipy/optimize/tests Message-ID: <20100904225352.D655839CD4C@scipy.org> Author: ptvirtan Date: 2010-09-04 17:53:52 -0500 (Sat, 04 Sep 2010) New Revision: 6675 Added: trunk/doc/source/optimize.nonlin.rst Modified: trunk/doc/source/optimize.rst trunk/scipy/optimize/__init__.py trunk/scipy/optimize/nonlin.py trunk/scipy/optimize/tests/test_minpack.py trunk/scipy/optimize/tests/test_nonlin.py Log: ENH: optimize: Complete rewrite of scipy.optimize.nonlin Rewrite the large-scale equation solver module scipy.optimize.nonlin. The following new features are added - Proper tolerance-based termination conditions - Generic framework for tolerance-controlled inexact Newton methods, where all the different methods are represented by different Jacobian approximations. - Backtracking (i.e. line searches) - Limited-memory Broyden methods, including SVD rank reduction in addition to more basic options - Newton-Krylov solver, using any of the solvers from scipy.sparse.linalg The new code API is mostly backward-compatible to the old one. The following methods are deprecated: - broyden_modified (not useful) - broyden1_modified (not useful) - broyden_generalized (equivalent to anderson) - anderson2 (equivalent to anderson) - broyden3 (obsoleted by the new limited-memory broyden methods) - vackar (renamed to diagbroyden) Tests for all implemented methods are included. Added: trunk/doc/source/optimize.nonlin.rst =================================================================== --- trunk/doc/source/optimize.nonlin.rst (rev 0) +++ trunk/doc/source/optimize.nonlin.rst 2010-09-04 22:53:52 UTC (rev 6675) @@ -0,0 +1 @@ +.. automodule:: scipy.optimize.nonlin Modified: trunk/doc/source/optimize.rst =================================================================== --- trunk/doc/source/optimize.rst 2010-09-04 22:53:26 UTC (rev 6674) +++ trunk/doc/source/optimize.rst 2010-09-04 22:53:52 UTC (rev 6675) @@ -69,8 +69,8 @@ fsolve -Scalar function solvers ------------------------ +Scalar functions +---------------- .. autosummary:: :toctree: generated/ @@ -88,19 +88,41 @@ fixed_point -General-purpose nonlinear (multidimensional) --------------------------------------------- +Multidimensional +---------------- +.. toctree:: + :maxdepth: 1 + + optimize.nonlin + +General nonlinear solvers: + .. autosummary:: :toctree: generated/ + fsolve broyden1 broyden2 - broyden3 - broyden_generalized + +Large-scale nonlinear solvers: + +.. autosummary:: + :toctree: generated/ + + newton_krylov anderson - anderson2 +Simple iterations: + +.. autosummary:: + :toctree: generated/ + + excitingmixing + linearmixing + vackar + + Utility Functions ================= Modified: trunk/scipy/optimize/__init__.py =================================================================== --- trunk/scipy/optimize/__init__.py 2010-09-04 22:53:26 UTC (rev 6674) +++ trunk/scipy/optimize/__init__.py 2010-09-04 22:53:52 UTC (rev 6675) @@ -11,8 +11,7 @@ from lbfgsb import fmin_l_bfgs_b from tnc import fmin_tnc from cobyla import fmin_cobyla -from nonlin import broyden1, broyden2, broyden3, broyden_generalized, \ - anderson, anderson2 +from nonlin import * from slsqp import fmin_slsqp from nnls import nnls Modified: trunk/scipy/optimize/nonlin.py =================================================================== --- trunk/scipy/optimize/nonlin.py 2010-09-04 22:53:26 UTC (rev 6674) +++ trunk/scipy/optimize/nonlin.py 2010-09-04 22:53:52 UTC (rev 6675) @@ -1,468 +1,1505 @@ -""" +r""" Nonlinear solvers ================= -These solvers find x for which F(x)=0. Both x and F is multidimensional. +.. currentmodule:: scipy.optimize -They accept the user defined function F, which accepts a python tuple x and it -should return F(x), which can be either a tuple, or numpy array. +This is a collection of general-purpose nonlinear multidimensional +solvers. These solvers find *x* for which *F(x) = 0*. Both *x* +and *F* can be multidimensional. -Example: +Routines +-------- -def F(x): - "Should converge to x=[0,0,0,0,0]" - import numpy - d = numpy.array([3,2,1.5,1,0.5]) - c = 0.01 - return -d*numpy.array(x)-c*numpy.array(x)**3 +Large-scale nonlinear solvers: -from scipy import optimize -x = optimize.broyden2(F,[1,1,1,1,1]) +.. autosummary:: -All solvers have the parameter iter (the number of iterations to compute), some -of them have other parameters of the solver, see the particular solver for -details. + newton_krylov + anderson - A collection of general-purpose nonlinear multidimensional solvers. +General nonlinear solvers: - broyden1 -- Broyden's first method - is a quasi-Newton-Raphson - method for updating an approximate Jacobian and then - inverting it - broyden2 -- Broyden's second method - the same as broyden1, but - updates the inverse Jacobian directly - broyden3 -- Broyden's second method - the same as broyden2, but - instead of directly computing the inverse Jacobian, - it remembers how to construct it using vectors, and - when computing inv(J)*F, it uses those vectors to - compute this product, thus avoding the expensive NxN - matrix multiplication. - broyden_generalized -- Generalized Broyden's method, the same as broyden2, - but instead of approximating the full NxN Jacobian, - it construct it at every iteration in a way that - avoids the NxN matrix multiplication. This is not - as precise as broyden3. - anderson -- extended Anderson method, the same as the - broyden_generalized, but added w_0^2*I to before - taking inversion to improve the stability - anderson2 -- the Anderson method, the same as anderson, but - formulated differently +.. autosummary:: - The broyden2 is the best. For large systems, use broyden3. excitingmixing is - also very effective. There are some more solvers implemented (see their - docstrings), however, those are of mediocre quality. + broyden1 + broyden2 +Simple iterations: - Utility Functions +.. autosummary:: - norm -- Returns an L2 norm of the vector + excitingmixing + linearmixing + diagbroyden + +Examples +======== + +Small problem +------------- + +>>> def F(x): +... return np.cos(x) + x[::-1] - [1, 2, 3, 4] +>>> import scipy.optimize +>>> x = scipy.optimize.broyden1(F, [1,1,1,1], f_tol=1e-14) +>>> x +array([ 4.04674914, 3.91158389, 2.71791677, 1.61756251]) +>>> np.cos(x) + x[::-1] +array([ 1., 2., 3., 4.]) + + +Large problem +------------- + +Suppose that we needed to solve the following integrodifferential +equation on the square :math:`[0,1]\times[0,1]`: + +.. math:: + + \nabla^2 P = 10 \left(\int_0^1\int_0^1\cosh(P)\,dx\,dy\right)^2 + +with :math:`P(x,1) = 1` and :math:`P=0` elsewhere on the boundary of +the square. + +The solution can be found using the `newton_krylov` solver: + +.. plot:: + + import numpy as np + from scipy.optimize import newton_krylov + from numpy import cosh, zeros_like, mgrid, zeros + + # parameters + nx, ny = 75, 75 + hx, hy = 1./(nx-1), 1./(ny-1) + + P_left, P_right = 0, 0 + P_top, P_bottom = 1, 0 + + def residual(P): + d2x = zeros_like(P) + d2y = zeros_like(P) + + d2x[1:-1] = (P[2:] - 2*P[1:-1] + P[:-2]) / hx/hx + d2x[0] = (P[1] - 2*P[0] + P_left)/hx/hx + d2x[-1] = (P_right - 2*P[-1] + P[-2])/hx/hx + + d2y[:,1:-1] = (P[:,2:] - 2*P[:,1:-1] + P[:,:-2])/hy/hy + d2y[:,0] = (P[:,1] - 2*P[:,0] + P_bottom)/hy/hy + d2y[:,-1] = (P_top - 2*P[:,-1] + P[:,-2])/hy/hy + + return d2x + d2y - 10*cosh(P).mean()**2 + + # solve + guess = zeros((nx, ny), float) + sol = newton_krylov(residual, guess, method='lgmres', verbose=1) + print 'Residual', abs(residual(sol)).max() + + # visualize + import matplotlib.pyplot as plt + x, y = mgrid[0:1:(nx*1j), 0:1:(ny*1j)] + plt.pcolor(x, y, sol) + plt.colorbar() + plt.show() + """ +# Copyright (C) 2009, Pauli Virtanen +# Distributed under the same license as Scipy. -import math +import sys +import numpy as np +from scipy.linalg import norm, solve, inv, qr, svd, lstsq, LinAlgError +from numpy import asarray, dot, vdot +import scipy.sparse.linalg +import scipy.sparse +import scipy.lib.blas as blas +import inspect +from linesearch import scalar_search_wolfe1, scalar_search_armijo -import numpy +__all__ = [ + 'broyden1', 'broyden2', 'anderson', 'linearmixing', + 'diagbroyden', 'excitingmixing', 'newton_krylov', + # Deprecated functions: + 'broyden_generalized', 'anderson2', 'broyden3'] -def mlog(x): - if x==0.: - return 13 - else: - return math.log(x) +#------------------------------------------------------------------------------ +# Utility functions +#------------------------------------------------------------------------------ -def norm(v): - """Returns an L2 norm of the vector.""" - return math.sqrt(numpy.sum((numpy.array(v)**2).flat)) +class NoConvergence(Exception): + pass -def myF(F,xm): - return numpy.matrix(F(tuple(xm.flat))).T +def maxnorm(x): + return np.absolute(x).max() -def difference(a,b): - m=0. - for x,y in zip(a,b): - m+=(x-y)**2 - return math.sqrt(m) +def _as_inexact(x): + """Return `x` as an array, of either floats or complex floats""" + x = asarray(x) + if not np.issubdtype(x.dtype, np.inexact): + return asarray(x, dtype=np.float_) + return x -def sum(a,b): - return [ai+bi for ai,bi in zip(a,b)] +def _array_like(x, x0): + """Return ndarray `x` as same array subclass and shape as `x0`""" + x = np.reshape(x, np.shape(x0)) + wrap = getattr(x0, '__array_wrap__', x.__array_wrap__) + return wrap(x) -def mul(C,b): - return [C*bi for bi in b] +def _safe_norm(v): + if not np.isfinite(v).all(): + return np.array(np.inf) + return norm(v) -def solve(A,b): - """Solve Ax=b, returns x""" - try: - from scipy import linalg - return linalg.solve(A,b) - except: - return A.I*b +#------------------------------------------------------------------------------ +# Generic nonlinear solver machinery +#------------------------------------------------------------------------------ -def broyden2(F, xin, iter=10, alpha=0.4, verbose = False): - """Broyden's second method. +_doc_parts = dict( + params_basic=""" + F : function(x) -> f + Function whose root to find; should take and return an array-like + object. + x0 : array-like + Initial guess for the solution + """.strip(), + params_extra=""" + iter : int, optional + Number of iterations to make. If omitted (default), make as many + as required to meet tolerances. + verbose : bool, optional + Print status to stdout on every iteration. + maxiter : int, optional + Maximum number of iterations to make. If more are needed to + meet convergence, `NoConvergence` is raised. + f_tol : float, optional + Absolute tolerance (in max-norm) for the residual. + If omitted, default is 6e-6. + f_rtol : float, optional + Relative tolerance for the residual. If omitted, not used. + x_tol : float, optional + Absolute minimum step size, as determined from the Jacobian + approximation. If the step size is smaller than this, optimization + is terminated as successful. If omitted, not used. + x_rtol : float, optional + Relative minimum step size. If omitted, not used. + tol_norm : function(vector) -> scalar, optional + Norm to use in convergence check. Default is the maximum norm. + line_search : {None, 'armijo' (default), 'wolfe'}, optional + Which type of a line search to use to determine the step size in the + direction given by the Jacobian approximation. Defaults to 'armijo'. + callback : function, optional + Optional callback function. It is called on every iteration as + ``callback(x, f)`` where `x` is the current solution and `f` + the corresponding residual. - Updates inverse Jacobian by an optimal formula. - There is NxN matrix multiplication in every iteration. + Returns + ------- + sol : array-like + An array (of similar array type as `x0`) containing the final solution. - The best norm |F(x)|=0.003 achieved in ~20 iterations. + Raises + ------ + NoConvergence + When a solution was not found. - Recommended. + """.strip() +) + +def _set_doc(obj): + if obj.__doc__: + obj.__doc__ = obj.__doc__ % _doc_parts + +def nonlin_solve(F, x0, jacobian='krylov', iter=None, verbose=False, + maxiter=None, f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + tol_norm=None, line_search='armijo', callback=None): """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - Gm=-alpha*numpy.matrix(numpy.identity(len(xin))) - for n in range(iter): - deltaxm=-Gm*Fxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - Gm=Gm+(deltaxm-Gm*deltaFxm)*deltaFxm.T/norm(deltaFxm)**2 - if verbose: - print "%d: |F(x)|=%.3f"%(n+1, norm(Fxm)) - return xm.flat + Find a root of a function, in a way suitable for large-scale problems. -def broyden3(F, xin, iter=10, alpha=0.4, verbose = False): - """Broyden's second method. + Parameters + ---------- + %(params_basic)s + jacobian : Jacobian + A Jacobian approximation: `Jacobian` object or something that + `asjacobian` can transform to one. Alternatively, a string specifying + which of the builtin Jacobian approximations to use: - Updates inverse Jacobian by an optimal formula. - The NxN matrix multiplication is avoided. + krylov, broyden1, broyden2, anderson + diagbroyden, linearmixing, excitingmixing - The best norm |F(x)|=0.003 achieved in ~20 iterations. + %(params_extra)s - Recommended. + See Also + -------- + asjacobian, Jacobian + + Notes + ----- + This algorithm implements the inexact Newton method, with + backtracking or full line searches. Several Jacobian + approximations are available, including Krylov and Quasi-Newton + methods. + + References + ---------- + .. [KIM] C. T. Kelley, \"Iterative Methods for Linear and Nonlinear + Equations\". Society for Industrial and Applied Mathematics. (1995) + http://www.siam.org/books/kelley/ + """ - zy=[] - def updateG(z,y): - "G:=G+z*y.T" - zy.append((z,y)) - def Gmul(f): - "G=-alpha*1+z*y.T+z*y.T ..." - s=-alpha*f - for z,y in zy: - s=s+z*(y.T*f) - return s - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) -# Gm=-alpha*numpy.matrix(numpy.identity(len(xin))) - for n in range(iter): - #deltaxm=-Gm*Fxm - deltaxm=Gmul(-Fxm) - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - #Gm=Gm+(deltaxm-Gm*deltaFxm)*deltaFxm.T/norm(deltaFxm)**2 - updateG(deltaxm-Gmul(deltaFxm),deltaFxm/norm(deltaFxm)**2) + + condition = TerminationCondition(f_tol=f_tol, f_rtol=f_rtol, + x_tol=x_tol, x_rtol=x_rtol, + iter=iter, norm=tol_norm) + + x0 = _as_inexact(x0) + func = lambda z: _as_inexact(F(_array_like(z, x0))).flatten() + x = x0.flatten() + + dx = np.inf + Fx = func(x) + Fx_norm = norm(Fx) + + jacobian = asjacobian(jacobian) + jacobian.setup(x.copy(), Fx, func) + + if maxiter is None: + if iter is not None: + maxiter = iter + 1 + else: + maxiter = 100*(x.size+1) + + if line_search is True: + line_search = 'armijo' + elif line_search is False: + line_search = None + + if line_search not in (None, 'armijo', 'wolfe'): + raise ValueError("Invalid line search") + + # Solver tolerance selection + gamma = 0.9 + eta_max = 0.9999 + eta_treshold = 0.1 + eta = 1e-3 + + for n in xrange(maxiter): + if condition.check(Fx, x, dx): + break + + # The tolerance, as computed for scipy.sparse.linalg.* routines + tol = min(eta, eta*Fx_norm) + dx = -jacobian.solve(Fx, tol=tol) + + if norm(dx) == 0: + raise ValueError("Jacobian inversion yielded zero vector. " + "This indicates a bug in the Jacobian " + "approximation.") + + # Line search, or Newton step + if line_search: + s, x, Fx, Fx_norm_new = _nonlin_line_search(func, x, Fx, dx, + line_search) + else: + s = 1.0 + x += dx + Fx = func(x) + Fx_norm_new = norm(Fx) + + jacobian.update(x.copy(), Fx) + + if callback: + callback(x, Fx) + + # Adjust forcing parameters for inexact methods + eta_A = gamma * Fx_norm_new**2 / Fx_norm**2 + if gamma * eta**2 < eta_treshold: + eta = min(eta_max, eta_A) + else: + eta = min(eta_max, max(eta_A, gamma*eta**2)) + + Fx_norm = Fx_norm_new + + # Print status if verbose: - print "%d: |F(x)|=%.3f"%(n+1, norm(Fxm)) - return xm.flat + sys.stdout.write("%d: |F(x)| = %g; step %g; tol %g\n" % ( + n, norm(Fx), s, eta)) + sys.stdout.flush() + else: + raise NoConvergence(_array_like(x, x0)) -def broyden_generalized(F, xin, iter=10, alpha=0.1, M=5, verbose = False): - """Generalized Broyden's method. + return _array_like(x, x0) - Computes an approximation to the inverse Jacobian from the last M - interations. Avoids NxN matrix multiplication, it only has MxM matrix - multiplication and inversion. +_set_doc(nonlin_solve) - M=0 .... linear mixing - M=1 .... Anderson mixing with 2 iterations - M=2 .... Anderson mixing with 3 iterations - etc. - optimal is M=5 +def _nonlin_line_search(func, x, Fx, dx, search_type='armijo', rdiff=1e-8, + smin=1e-2): + tmp_s = [0] + tmp_Fx = [Fx] + tmp_phi = [norm(Fx)**2] + s_norm = norm(x) / norm(dx) + def phi(s, store=True): + if s == tmp_s[0]: + return tmp_phi[0] + xt = x + s*dx + v = func(xt) + p = _safe_norm(v)**2 + if store: + tmp_s[0] = s + tmp_phi[0] = p + tmp_Fx[0] = v + return p + + def derphi(s): + ds = (abs(s) + s_norm + 1) * rdiff + return (phi(s+ds, store=False) - phi(s)) / ds + + if search_type == 'wolfe': + s, phi1, phi0 = scalar_search_wolfe1(phi, derphi, tmp_phi[0], + xtol=1e-2, amin=smin) + elif search_type == 'armijo': + s, phi1 = scalar_search_armijo(phi, tmp_phi[0], -tmp_phi[0], + amin=smin) + + if s is None: + # XXX: No suitable step length found. Take the full Newton step, + # and hope for the best. + s = 1.0 + + x = x + s*dx + if s == tmp_s[0]: + Fx = tmp_Fx[0] + else: + Fx = func(x) + Fx_norm = norm(Fx) + + return s, x, Fx, Fx_norm + +class TerminationCondition(object): """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - G0=-alpha - dxm=[] - dFxm=[] - for n in range(iter): - deltaxm=-G0*Fxm - if M>0: - MM=min(M,n) - for m in range(n-MM,n): - deltaxm=deltaxm-(float(gamma[m-(n-MM)])*dxm[m]-G0*dFxm[m]) - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 + Termination condition for an iteration. It is terminated if - if M>0: - dxm.append(deltaxm) - dFxm.append(deltaFxm) - MM=min(M,n+1) - a=numpy.matrix(numpy.empty((MM,MM))) - for i in range(n+1-MM,n+1): - for j in range(n+1-MM,n+1): - a[i-(n+1-MM),j-(n+1-MM)]=dFxm[i].T*dFxm[j] + - |F| < f_rtol*|F_0|, AND + - |F| < f_tol - dFF=numpy.matrix(numpy.empty(MM)).T - for k in range(n+1-MM,n+1): - dFF[k-(n+1-MM)]=dFxm[k].T*Fxm - gamma=a.I*dFF + AND - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm.flat + - |dx| < x_rtol*|x|, AND + - |dx| < x_tol -def anderson(F, xin, iter=10, alpha=0.1, M=5, w0=0.01, verbose = False): - """Extended Anderson method. + """ + def __init__(self, f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + iter=None, norm=maxnorm): - Computes an approximation to the inverse Jacobian from the last M - interations. Avoids NxN matrix multiplication, it only has MxM matrix - multiplication and inversion. + if f_tol is None: + f_tol = np.finfo(np.float_).eps ** (1./3) + if f_rtol is None: + f_rtol = np.inf + if x_tol is None: + x_tol = np.inf + if x_rtol is None: + x_rtol = np.inf + + self.x_tol = x_tol + self.x_rtol = x_rtol + self.f_tol = f_tol + self.f_rtol = f_rtol - M=0 .... linear mixing - M=1 .... Anderson mixing with 2 iterations - M=2 .... Anderson mixing with 3 iterations - etc. - optimal is M=5 + self.norm = maxnorm + self.iter = iter + self.f0_norm = None + self.iteration = 0 + + def check(self, f, x, dx): + self.iteration += 1 + f_norm = self.norm(f) + x_norm = self.norm(x) + dx_norm = self.norm(dx) + + if self.f0_norm is None: + self.f0_norm = f_norm + + if f_norm == 0: + return True + + if self.iter is not None: + # backwards compatibility with Scipy 0.6.0 + return self.iteration > self.iter + + # NB: condition must succeed for rtol=inf even if norm == 0 + return ((f_norm <= self.f_tol and f_norm/self.f_rtol <= self.f0_norm) + and (dx_norm <= self.x_tol and dx_norm/self.x_rtol <= x_norm)) + + +#------------------------------------------------------------------------------ +# Generic Jacobian approximation +#------------------------------------------------------------------------------ + +class Jacobian(object): """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - dxm=[] - dFxm=[] - for n in range(iter): - deltaxm=alpha*Fxm - if M>0: - MM=min(M,n) - for m in range(n-MM,n): - deltaxm=deltaxm-(float(gamma[m-(n-MM)])*dxm[m]+alpha*dFxm[m]) - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 + Common interface for Jacobians or Jacobian approximations. - if M>0: - dxm.append(deltaxm) - dFxm.append(deltaFxm) - MM=min(M,n+1) - a=numpy.matrix(numpy.empty((MM,MM))) - for i in range(n+1-MM,n+1): - for j in range(n+1-MM,n+1): - if i==j: wd=w0**2 - else: wd=0 - a[i-(n+1-MM),j-(n+1-MM)]=(1+wd)*dFxm[i].T*dFxm[j] + The optional methods come useful when implementing trust region + etc. algorithms that often require evaluating transposes of the + Jacobian. - dFF=numpy.matrix(numpy.empty(MM)).T - for k in range(n+1-MM,n+1): - dFF[k-(n+1-MM)]=dFxm[k].T*Fxm - gamma=solve(a,dFF) -# print gamma + Methods + ------- + solve + Returns J^-1 * v + update + Updates Jacobian to point `x` (where the function has residual `Fx`) - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm.flat + matvec : optional + Returns J * v + rmatvec : optional + Returns A^H * v + rsolve : optional + Returns A^-H * v + matmat : optional + Returns A * V, where V is a dense matrix with dimensions (N,K). + todense : optional + Form the dense Jacobian matrix. Necessary for dense trust region + algorithms, and useful for testing. + + Attributes + ---------- + shape + Matrix dimensions (M, N) + dtype + Data type of the matrix. + func : callable, optional + Function the Jacobian corresponds to -def anderson2(F, xin, iter=10, alpha=0.1, M=5, w0=0.01, verbose = False): - """Anderson method. + """ - M=0 .... linear mixing - M=1 .... Anderson mixing with 2 iterations - M=2 .... Anderson mixing with 3 iterations - etc. - optimal is M=5 + def __init__(self, **kw): + names = ["solve", "update", "matvec", "rmatvec", "rsolve", + "matmat", "todense", "shape", "dtype"] + for name, value in kw.items(): + if name not in names: + raise ValueError("Unknown keyword argument %s" % name) + if value is not None: + setattr(self, name, kw[name]) + if hasattr(self, 'todense'): + self.__array__ = lambda: self.todense() + + def aspreconditioner(self): + return InverseJacobian(self) + + def solve(self, v, tol=0): + raise NotImplementedError + + def update(self, x, F): + pass + + def setup(self, x, F, func): + self.func = func + self.shape = (F.size, x.size) + self.dtype = F.dtype + if self.__class__.setup is Jacobian.setup: + # Call on the first point unless overridden + self.update(self, x, F) + +class InverseJacobian(object): + def __init__(self, jacobian): + self.jacobian = jacobian + self.matvec = jacobian.solve + self.update = jacobian.update + if hasattr(jacobian, 'setup'): + self.setup = jacobian.setup + if hasattr(jacobian, 'rsolve'): + self.rmatvec = jacobian.rsolve + + @property + def shape(self): + return self.jacobian.shape + + @property + def dtype(self): + return self.jacobian.dtype + +def asjacobian(J): """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - dFxm=[] - for n in range(iter): - deltaxm=Fxm - if M>0: - MM=min(M,n) - for m in range(n-MM,n): - deltaxm=deltaxm+float(theta[m-(n-MM)])*(dFxm[m]-Fxm) - deltaxm=deltaxm*alpha - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 + Convert given object to one suitable for use as a Jacobian. + """ + spsolve = scipy.sparse.linalg.spsolve + if isinstance(J, Jacobian): + return J + elif inspect.isclass(J) and issubclass(J, Jacobian): + return J() + elif isinstance(J, np.ndarray): + if J.ndim > 2: + raise ValueError('array must have rank <= 2') + J = np.atleast_2d(np.asarray(J)) + if J.shape[0] != J.shape[1]: + raise ValueError('array must be square') - if M>0: - dFxm.append(Fxm-deltaFxm) - MM=min(M,n+1) - a=numpy.matrix(numpy.empty((MM,MM))) - for i in range(n+1-MM,n+1): - for j in range(n+1-MM,n+1): - if i==j: wd=w0**2 - else: wd=0 - a[i-(n+1-MM),j-(n+1-MM)]= \ - (1+wd)*(Fxm-dFxm[i]).T*(Fxm-dFxm[j]) + return Jacobian(matvec=lambda v: dot(J, v), + rmatvec=lambda v: dot(J.conj().T, v), + solve=lambda v: solve(J, v), + rsolve=lambda v: solve(J.conj().T, v), + dtype=J.dtype, shape=J.shape) + elif scipy.sparse.isspmatrix(J): + if J.shape[0] != J.shape[1]: + raise ValueError('matrix must be square') + return Jacobian(matvec=lambda v: J*v, + rmatvec=lambda v: J.conj().T * v, + solve=lambda v: spsolve(J, v), + rsolve=lambda v: spsolve(J.conj().T, v), + dtype=J.dtype, shape=J.shape) + elif hasattr(J, 'shape') and hasattr(J, 'dtype') and hasattr(J, 'solve'): + return Jacobian(matvec=getattr(J, 'matvec'), + rmatvec=getattr(J, 'rmatvec'), + solve=J.solve, + rsolve=getattr(J, 'rsolve'), + update=getattr(J, 'update'), + setup=getattr(J, 'setup'), + dtype=J.dtype, + shape=J.shape) + elif callable(J): + # Assume it's a function J(x) that returns the Jacobian + class Jac(Jacobian): + def update(self, x, F): + self.x = x + def solve(self, v, tol=0): + m = J(self.x) + if isinstance(m, np.ndarray): + return solve(m, v) + elif scipy.sparse.isspmatrix(m): + return spsolve(m, v) + else: + raise ValueError("Unknown matrix type") + def matvec(self, v): + m = J(self.x) + if isinstance(m, np.ndarray): + return dot(m, v) + elif scipy.sparse.isspmatrix(m): + return m*v + else: + raise ValueError("Unknown matrix type") + def rsolve(self, v, tol=0): + m = J(self.x) + if isinstance(m, np.ndarray): + return solve(m.conj().T, v) + elif scipy.sparse.isspmatrix(m): + return spsolve(m.conj().T, v) + else: + raise ValueError("Unknown matrix type") + def rmatvec(self, v): + m = J(self.x) + if isinstance(m, np.ndarray): + return dot(m.conj().T, v) + elif scipy.sparse.isspmatrix(m): + return m.conj().T * v + else: + raise ValueError("Unknown matrix type") + return Jac() + elif isinstance(J, str): + return dict(broyden1=BroydenFirst, + broyden2=BroydenSecond, + anderson=Anderson, + diagbroyden=DiagBroyden, + linearmixing=LinearMixing, + excitingmixing=ExcitingMixing, + krylov=KrylovJacobian)[J]() + else: + raise TypeError('Cannot convert object to a Jacobian') - dFF=numpy.matrix(numpy.empty(MM)).T - for k in range(n+1-MM,n+1): - dFF[k-(n+1-MM)]=(Fxm-dFxm[k]).T*Fxm - theta=solve(a,dFF) -# print gamma - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm.flat +#------------------------------------------------------------------------------ +# Broyden +#------------------------------------------------------------------------------ -def broyden_modified(F, xin, iter=10, alpha=0.35, w0=0.01, wl=5, verbose = False): - """Modified Broyden's method. +class GenericBroyden(Jacobian): + def setup(self, x0, f0, func): + Jacobian.setup(self, x0, f0, func) + self.last_f = f0 + self.last_x = x0 - Updates inverse Jacobian using information from all the iterations and - avoiding the NxN matrix multiplication. The problem is with the weights, - it converges the same or worse than broyden2 or broyden_generalized + if hasattr(self, 'alpha') and self.alpha is None: + # autoscale the initial Jacobian parameter + self.alpha = 0.5*max(norm(x0), 1) / norm(f0) + def _update(self, x, f, dx, df, dx_norm, df_norm): + raise NotImplementedError + + def update(self, x, f): + df = f - self.last_f + dx = x - self.last_x + self._update(x, f, dx, df, norm(dx), norm(df)) + self.last_f = f + self.last_x = x + +class LowRankMatrix(object): + r""" + A matrix represented as + + .. math:: \alpha I + \sum_{n=0}^{n=M} c_n d_n^\dagger + + However, if the rank of the matrix reaches the dimension of the vectors, + full matrix representation will be used thereon. + """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - G0=alpha - w=[] - u=[] - dFxm=[] - for n in range(iter): - deltaxm=G0*Fxm - for i in range(n): - for j in range(n): - deltaxm-=w[i]*w[j]*betta[i,j]*u[j]*(dFxm[i].T*Fxm) - xm+=deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - w.append(wl/norm(Fxm)) + def __init__(self, alpha, n, dtype): + self.alpha = alpha + self.cs = [] + self.ds = [] + self.n = n + self.dtype = dtype + self.collapsed = None - u.append((G0*deltaFxm+deltaxm)/norm(deltaFxm)) - dFxm.append(deltaFxm/norm(deltaFxm)) - a=numpy.matrix(numpy.empty((n+1,n+1))) - for i in range(n+1): - for j in range(n+1): - a[i,j]=w[i]*w[j]*dFxm[j].T*dFxm[i] - betta=(w0**2*numpy.matrix(numpy.identity(n+1))+a).I + @staticmethod + def _matvec(v, alpha, cs, ds): + axpy, scal, dotc = blas.get_blas_funcs(['axpy', 'scal', 'dotc'], + cs[:1] + [v]) + w = alpha * v + for c, d in zip(cs, ds): + a = dotc(d, v) + w = axpy(c, w, w.size, a) + return w - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm.flat + @staticmethod + def _solve(v, alpha, cs, ds): + """Evaluate w = M^-1 v""" + if len(cs) == 0: + return v/alpha -def broyden1(F, xin, iter=10, alpha=0.1, verbose = False): - """Broyden's first method. + # (B + C D^H)^-1 = B^-1 - B^-1 C (I + D^H B^-1 C)^-1 D^H B^-1 - Updates Jacobian and computes inv(J) by a matrix inversion at every - iteration. It's very slow. + axpy, dotc = blas.get_blas_funcs(['axpy', 'dotc'], cs[:1] + [v]) - The best norm |F(x)|=0.005 achieved in ~45 iterations. + c0 = cs[0] + A = alpha * np.identity(len(cs), dtype=c0.dtype) + for i, d in enumerate(ds): + for j, c in enumerate(cs): + A[i,j] += dotc(d, c) + + q = np.zeros(len(cs), dtype=c0.dtype) + for j, d in enumerate(ds): + q[j] = dotc(d, v) + q /= alpha + q = solve(A, q) + + w = v/alpha + for c, qc in zip(cs, q): + w = axpy(c, w, w.size, -qc) + + return w + + def matvec(self, v): + """Evaluate w = M v""" + if self.collapsed is not None: + return np.dot(self.collapsed, v) + return LowRankMatrix._matvec(v, self.alpha, self.cs, self.ds) + + def rmatvec(self, v): + """Evaluate w = M^H v""" + if self.collapsed is not None: + return np.dot(self.collapsed.T.conj(), v) + return LowRankMatrix._matvec(v, np.conj(self.alpha), self.ds, self.cs) + + def solve(self, v, tol=0): + """Evaluate w = M^-1 v""" + if self.collapsed is not None: + return solve(self.collapsed, v) + return LowRankMatrix._solve(v, self.alpha, self.cs, self.ds) + + def rsolve(self, v, tol=0): + """Evaluate w = M^-H v""" + if self.collapsed is not None: + return solve(self.collapsed.T.conj(), v) + return LowRankMatrix._solve(v, np.conj(self.alpha), self.ds, self.cs) + + def append(self, c, d): + if self.collapsed is not None: + self.collapsed += c[:,None] * d[None,:].conj() + return + + self.cs.append(c) + self.ds.append(d) + + if len(self.cs) > c.size: + self.collapse() + + def __array__(self): + if self.collapsed is not None: + return self.collapsed + + Gm = self.alpha*np.identity(self.n, dtype=self.dtype) + for c, d in zip(self.cs, self.ds): + Gm += c[:,None]*d[None,:].conj() + return Gm + + def collapse(self): + """Collapse the low-rank matrix to a full-rank one.""" + self.collapsed = np.array(self) + self.cs = None + self.ds = None + self.alpha = None + + def restart_reduce(self, rank): + """ + Reduce the rank of the matrix by dropping all vectors. + """ + if self.collapsed is not None: + return + assert rank > 0 + if len(self.cs) > rank: + del self.cs[:] + del self.ds[:] + + def simple_reduce(self, rank): + """ + Reduce the rank of the matrix by dropping oldest vectors. + """ + if self.collapsed is not None: + return + assert rank > 0 + while len(self.cs) > rank: + del self.cs[0] + del self.ds[0] + + def svd_reduce(self, max_rank, to_retain=None): + """ + Reduce the rank of the matrix by retaining some SVD components. + + This corresponds to the \"Broyden Rank Reduction Inverse\" + algorithm described in [vR]_. + + Note that the SVD decomposition can be done by solving only a + problem whose size is the effective rank of this matrix, which + is viable even for large problems. + + Parameters + ---------- + max_rank : int + Maximum rank of this matrix after reduction. + to_retain : int, optional + Number of SVD components to retain when reduction is done + (ie. rank > max_rank). Default is ``max_rank - 2``. + + References + ---------- + .. [vR] B.A. van der Rotten, PhD thesis, + \"A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations\". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + + http://www.math.leidenuniv.nl/scripties/Rotten.pdf + + """ + if self.collapsed is not None: + return + + p = max_rank + if to_retain is not None: + q = to_retain + else: + q = p - 2 + + if self.cs: + p = min(p, len(self.cs[0])) + q = max(0, min(q, p-1)) + + m = len(self.cs) + if m < p: + # nothing to do + return + + C = np.array(self.cs).T + D = np.array(self.ds).T + + D, R = qr(D, mode='qr', econ=True) + C = dot(C, R.T.conj()) + + U, S, WH = svd(C, full_matrices=False, compute_uv=True) + + C = dot(C, inv(WH)) + D = dot(D, WH.T.conj()) + + for k in xrange(q): + self.cs[k] = C[:,k].copy() + self.ds[k] = D[:,k].copy() + + del self.cs[q:] + del self.ds[q:] + +_doc_parts['broyden_params'] = """ + alpha : float, optional + Initial guess for the Jacobian is (-1/alpha). + reduction_method : str or tuple, optional + Method used in ensuring that the rank of the Broyden matrix + stays low. Can either be a string giving the name of the method, + or a tuple of the form ``(method, param1, param2, ...)`` + that gives the name of the method and values for additional parameters. + + Methods available: + - ``restart``: drop all matrix columns. Has no extra parameters. + - ``simple``: drop oldest matrix column. Has no extra parameters. + - ``svd``: keep only the most significant SVD components. + Extra parameters: + - ``to_retain`: number of SVD components to retain when + rank reduction is done. Default is ``max_rank - 2``. + max_rank : int, optional + Maximum rank for the Broyden matrix. + Default is infinity (ie., no rank reduction). + """.strip() + +class BroydenFirst(GenericBroyden): + r""" + Find a root of a function, using Broyden's first Jacobian approximation. + + This method is also known as \"Broyden's good method\". + + Parameters + ---------- + %(params_basic)s + %(broyden_params)s + %(params_extra)s + + Notes + ----- + This algorithm implements the inverse Jacobian Quasi-Newton update + + .. math:: H_+ = H + (dx - H df) dx^\dagger H / ( dx^\dagger H df) + + which corresponds to Broyden's first Jacobian update + + .. math:: J_+ = J + (df - J dx) dx^\dagger / dx^\dagger dx + + + References + ---------- + .. [vR] B.A. van der Rotten, PhD thesis, + \"A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations\". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + + http://www.math.leidenuniv.nl/scripties/Rotten.pdf + """ - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - Jm=-1/alpha*numpy.matrix(numpy.identity(len(xin))) - for n in range(iter): - deltaxm=solve(-Jm,Fxm) - #!!!! What the fuck?! - #xm+=deltaxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - Jm=Jm+(deltaFxm-Jm*deltaxm)*deltaxm.T/norm(deltaxm)**2 - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm.flat + def __init__(self, alpha=None, reduction_method='restart', max_rank=None): + GenericBroyden.__init__(self) + self.alpha = alpha + self.Gm = None + + if max_rank is None: + max_rank = np.inf + self.max_rank = max_rank -def broyden1_modified(F, xin, iter=10, alpha=0.1, verbose = False): - """Broyden's first method, modified by O. Certik. + if isinstance(reduction_method, str): + reduce_params = () + else: + reduce_params = reduction_method[1:] + reduction_method = reduction_method[0] + reduce_params = (max_rank - 1,) + reduce_params - Updates inverse Jacobian using some matrix identities at every iteration, - its faster then newton_slow, but still not optimal. + if reduction_method == 'svd': + self._reduce = lambda: self.Gm.svd_reduce(*reduce_params) + elif reduction_method == 'simple': + self._reduce = lambda: self.Gm.simple_reduce(*reduce_params) + elif reduction_method == 'restart': + self._reduce = lambda: self.Gm.restart_reduce(*reduce_params) + else: + raise ValueError("Unknown rank reduction method '%s'" % + reduction_method) - The best norm |F(x)|=0.005 achieved in ~45 iterations. + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.Gm = LowRankMatrix(-self.alpha, self.shape[0], self.dtype) + + def todense(self): + return inv(self.Gm) + + def solve(self, f, tol=0): + r = self.Gm.matvec(f) + if not np.isfinite(r).all(): + # singular; reset the Jacobian approximation + self.setup(self.last_x, self.last_f, self.func) + return self.Gm.matvec(f) + + def matvec(self, f): + return self.Gm.solve(f) + + def rsolve(self, f, tol=0): + return self.Gm.rmatvec(f) + + def rmatvec(self, f): + return self.Gm.rsolve(f) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + self._reduce() # reduce first to preserve secant condition + + v = self.Gm.rmatvec(dx) + c = dx - self.Gm.matvec(df) + d = v / vdot(df, v) + + self.Gm.append(c, d) + + +class BroydenSecond(BroydenFirst): """ - def inv(A,u,v): + Find a root of a function, using Broyden\'s second Jacobian approximation. - #interesting is that this - #return (A.I+u*v.T).I - #is more stable than - #return A-A*u*v.T*A/float(1+v.T*A*u) - Au=A*u - return A-Au*(v.T*A)/float(1+v.T*Au) - xm=numpy.matrix(xin).T - Fxm=myF(F,xm) - Jm=alpha*numpy.matrix(numpy.identity(len(xin))) - for n in range(iter): - deltaxm=Jm*Fxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 -# print "-------------",norm(deltaFxm),norm(deltaxm) - deltaFxm/=norm(deltaxm) - deltaxm/=norm(deltaxm) - Jm=inv(Jm+deltaxm*deltaxm.T*Jm,-deltaFxm,deltaxm) + This method is also known as \"Broyden's bad method\". - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm + Parameters + ---------- + %(params_basic)s + %(broyden_params)s + %(params_extra)s -def vackar(F, xin, iter=10, alpha=0.1, verbose = False): - """J=diag(d1,d2,...,dN) + Notes + ----- + This algorithm implements the inverse Jacobian Quasi-Newton update - The best norm |F(x)|=0.005 achieved in ~110 iterations. + .. math:: H_+ = H + (dx - H df) df^\dagger / ( df^\dagger df) + + corresponding to Broyden's second method. + + References + ---------- + .. [vR] B.A. van der Rotten, PhD thesis, + \"A limited memory Broyden method to solve high-dimensional + systems of nonlinear equations\". Mathematisch Instituut, + Universiteit Leiden, The Netherlands (2003). + + http://www.math.leidenuniv.nl/scripties/Rotten.pdf + """ - def myF(F,xm): - return numpy.array(F(tuple(xm.flat))).T - xm=numpy.array(xin) - Fxm=myF(F,xm) - d=1/alpha*numpy.ones(len(xin)) - Jm=numpy.matrix(numpy.diag(d)) - for n in range(iter): - deltaxm=1/d*Fxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - d=d-(deltaFxm+d*deltaxm)*deltaxm/norm(deltaxm)**2 - if verbose: - print "%d: |F(x)|=%.3f"%(n, norm(Fxm)) - return xm + def _update(self, x, f, dx, df, dx_norm, df_norm): + self._reduce() # reduce first to preserve secant condition -def linearmixing(F,xin, iter=10, alpha=0.1, verbose = False): - """J=-1/alpha + v = df + c = dx - self.Gm.matvec(df) + d = v / df_norm**2 + self.Gm.append(c, d) - The best norm |F(x)|=0.005 achieved in ~140 iterations. + +#------------------------------------------------------------------------------ +# Broyden-like (restricted memory) +#------------------------------------------------------------------------------ + +class Anderson(GenericBroyden): """ - def myF(F,xm): - return numpy.array(F(tuple(xm.flat))).T - xm=numpy.array(xin) - Fxm=myF(F,xm) - for n in range(iter): - deltaxm=alpha*Fxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - Fxm=Fxm1 - if verbose: - print "%d: |F(x)|=%.3f" %(n,norm(Fxm)) + Find a root of a function, using (extended) Anderson mixing. - return xm + The Jacobian is formed by for a 'best' solution in the space + spanned by last `M` vectors. As a result, only a MxM matrix + inversions and MxN multiplications are required. [Ey]_ -def excitingmixing(F,xin,iter=10,alpha=0.1,alphamax=1.0, verbose = False): - """J=-1/alpha + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial guess for the Jacobian is (-1/alpha). + M : float, optional + Number of previous vectors to retain. Defaults to 5. + w0 : float, optional + Regularization parameter for numerical stability. + Compared to unity, good values of the order of 0.01. + %(params_extra)s - The best norm |F(x)|=0.005 achieved in ~140 iterations. + References + ---------- + .. [Ey] V. Eyert, J. Comp. Phys., 124, 271 (1996). + """ - def myF(F,xm): - return numpy.array(F(tuple(xm.flat))).T - xm=numpy.array(xin) - beta=numpy.array([alpha]*len(xm)) - Fxm=myF(F,xm) - for n in range(iter): - deltaxm=beta*Fxm - xm=xm+deltaxm - Fxm1=myF(F,xm) - deltaFxm=Fxm1-Fxm - for i in range(len(xm)): - if Fxm1[i]*Fxm[i] > 0: - beta[i]=beta[i]+alpha - if beta[i] > alphamax: - beta[i] = alphamax - else: - beta[i]=alpha - Fxm=Fxm1 - if verbose: - print "%d: |F(x)|=%.3f" %(n,norm(Fxm)) - return xm + # Note: + # + # Anderson method maintains a rank M approximation of the inverse Jacobian, + # + # J^-1 v ~ -v*alpha + (dX + alpha dF) A^-1 dF^H v + # A = W + dF^H dF + # W = w0^2 diag(dF^H dF) + # + # so that for w0 = 0 the secant condition applies for last M iterates, ie., + # + # J^-1 df_j = dx_j + # + # for all j = 0 ... M-1. + # + # Moreover, (from Sherman-Morrison-Woodbury formula) + # + # J v ~ [ b I - b^2 C (I + b dF^H A^-1 C)^-1 dF^H ] v + # C = (dX + alpha dF) A^-1 + # b = -1/alpha + # + # and after simplification + # + # J v ~ -v/alpha + (dX/alpha + dF) (dF^H dX - alpha W)^-1 dF^H v + # + + def __init__(self, alpha=None, w0=0.01, M=5): + GenericBroyden.__init__(self) + self.alpha = alpha + self.M = M + self.dx = [] + self.df = [] + self.gamma = None + self.w0 = w0 + + def solve(self, f, tol=0): + dx = -self.alpha*f + + n = len(self.dx) + if n == 0: + return dx + + df_f = np.empty(n, dtype=f.dtype) + for k in xrange(n): + df_f[k] = vdot(self.df[k], f) + + try: + gamma = solve(self.a, df_f) + except LinAlgError: + # singular; reset the Jacobian approximation + del self.dx[:] + del self.df[:] + return dx + + for m in xrange(n): + dx += gamma[m]*(self.dx[m] + self.alpha*self.df[m]) + return dx + + def matvec(self, f): + dx = -f/self.alpha + + n = len(self.dx) + if n == 0: + return dx + + df_f = np.empty(n, dtype=f.dtype) + for k in xrange(n): + df_f[k] = vdot(self.df[k], f) + + b = np.empty((n, n), dtype=f.dtype) + for i in xrange(n): + for j in xrange(n): + b[i,j] = vdot(self.df[i], self.dx[j]) + if i == j and self.w0 != 0: + b[i,j] -= vdot(self.df[i], self.df[i])*self.w0**2*self.alpha + gamma = solve(b, df_f) + + for m in xrange(n): + dx += gamma[m]*(self.df[m] + self.dx[m]/self.alpha) + return dx + + def _update(self, x, f, dx, df, dx_norm, df_norm): + if self.M == 0: + return + + self.dx.append(dx) + self.df.append(df) + + while len(self.dx) > self.M: + self.dx.pop(0) + self.df.pop(0) + + n = len(self.dx) + a = np.zeros((n, n), dtype=f.dtype) + + for i in xrange(n): + for j in xrange(i, n): + if i == j: + wd = self.w0**2 + else: + wd = 0 + a[i,j] = (1+wd)*vdot(self.df[i], self.df[j]) + + a += np.triu(a, 1).T.conj() + self.a = a + +#------------------------------------------------------------------------------ +# Simple iterations +#------------------------------------------------------------------------------ + +class DiagBroyden(GenericBroyden): + """ + Find a root of a function, using diagonal Broyden Jacobian approximation. + + The Jacobian approximation is derived from previous iterations, by + retaining only the diagonal of Broyden matrices. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial guess for the Jacobian is (-1/alpha). + %(params_extra)s + """ + + def __init__(self, alpha=None): + GenericBroyden.__init__(self) + self.alpha = alpha + + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.d = np.ones((self.shape[0],), dtype=self.dtype) / self.alpha + + def solve(self, f, tol=0): + return -f / self.d + + def matvec(self, f): + return -f * self.d + + def rsolve(self, f, tol=0): + return -f / self.d.conj() + + def rmatvec(self, f): + return -f * self.d.conj() + + def todense(self): + return np.diag(-self.d) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + self.d -= (df + self.d*dx)*dx/dx_norm**2 + +class LinearMixing(GenericBroyden): + """ + Find a root of a function, using a scalar Jacobian approximation. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + The Jacobian approximation is (-1/alpha). + %(params_extra)s + """ + + def __init__(self, alpha=None): + GenericBroyden.__init__(self) + self.alpha = alpha + + def solve(self, f, tol=0): + return -f*self.alpha + + def matvec(self, f): + return -f/self.alpha + + def rsolve(self, f, tol=0): + return -f*np.conj(self.alpha) + + def rmatvec(self, f): + return -f/np.conj(self.alpha) + + def todense(self): + return np.diag(-np.ones(self.shape[0])/self.alpha) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + pass + +class ExcitingMixing(GenericBroyden): + """ + Find a root of a function, using a tuned diagonal Jacobian approximation. + + The Jacobian matrix is diagonal and is tuned on each iteration. + + .. warning:: + + This algorithm may be useful for specific problems, but whether + it will work may depend strongly on the problem. + + Parameters + ---------- + %(params_basic)s + alpha : float, optional + Initial Jacobian approximation is (-1/alpha). + alphamax : float, optional + The entries of the diagonal Jacobian are kept in the range + ``[alpha, alphamax]``. + %(params_extra)s + """ + + def __init__(self, alpha=None, alphamax=1.0): + GenericBroyden.__init__(self) + self.alpha = alpha + self.alphamax = alphamax + self.beta = None + + def setup(self, x, F, func): + GenericBroyden.setup(self, x, F, func) + self.beta = self.alpha * np.ones((self.shape[0],), dtype=self.dtype) + + def solve(self, f, tol=0): + return -f*self.beta + + def matvec(self, f): + return -f/self.beta + + def rsolve(self, f, tol=0): + return -f*self.beta.conj() + + def rmatvec(self, f): + return -f/self.beta.conj() + + def todense(self): + return np.diag(-1/self.beta) + + def _update(self, x, f, dx, df, dx_norm, df_norm): + incr = f*self.last_f > 0 + self.beta[incr] += self.alpha + self.beta[~incr] = self.alpha + np.clip(self.beta, 0, self.alphamax, out=self.beta) + + +#------------------------------------------------------------------------------ +# Iterative/Krylov approximated Jacobians +#------------------------------------------------------------------------------ + +class KrylovJacobian(Jacobian): + r""" + Find a root of a function, using Krylov approximation for inverse Jacobian. + + This method is suitable for solving large-scale problems. + + Parameters + ---------- + %(params_basic)s + rdiff : float, optional + Relative step size to use in numerical differentiation. + method : {'lgmres', 'gmres', 'bicgstab', 'cgs', 'minres'} or function + Krylov method to use to approximate the Jacobian. + Can be a string, or a function implementing the same interface as + the iterative solvers in `scipy.sparse.linalg`. + + The default is `scipy.sparse.linalg.lgmres`. + inner_M : LinearOperator or InverseJacobian + Preconditioner for the inner Krylov iteration. + Note that you can use also inverse Jacobians as (adaptive) + preconditioners. For example, + + >>> jac = BroydenFirst() + >>> kjac = KrylovJacobian(inner_M=jac.inverse). + inner_tol, inner_maxiter, ... + Parameters to pass on to the \"inner\" Krylov solver. + See `scipy.sparse.linalg.gmres` for details. + outer_k : int, optional + Size of the subspace kept across LGMRES nonlinear iterations. + See `scipy.sparse.linalg.lgmres` for details. + %(params_extra)s + + See Also + -------- + scipy.sparse.linalg.gmres + scipy.sparse.linalg.lgmres + + Notes + ----- + This function implements a Newton-Krylov solver. The basic idea is + to compute the inverse of the Jacobian with an iterative Krylov + method. These methods require only evaluating the Jacobian-vector + products, which are conveniently approximated by numerical + differentiation: + + .. math:: J v \approx (f(x + \omega*v/|v|) - f(x)) / \omega + + Due to the use of iterative matrix inverses, these methods can + deal with large nonlinear problems. + + Scipy's `scipy.sparse.linalg` module offers a selection of Krylov + solvers to choose from. The default here is `lgmres`, which is a + variant of restarted GMRES iteration that reuses some of the + information obtained in the previous Newton steps to invert + Jacobians in subsequent steps. + + For a review on Newton-Krylov methods, see for example [KK]_, + and for the LGMRES sparse inverse method, see [BJM]_. + + References + ---------- + .. [KK] D.A. Knoll and D.E. Keyes, J. Comp. Phys. 193, 357 (2003). + .. [BJM] A.H. Baker and E.R. Jessup and T. Manteuffel, + SIAM J. Matrix Anal. Appl. 26, 962 (2005). + + """ + + def __init__(self, rdiff=None, method='lgmres', inner_maxiter=20, + inner_M=None, outer_k=10, **kw): + self.preconditioner = inner_M + self.rdiff = rdiff + self.method = dict( + bicgstab=scipy.sparse.linalg.bicgstab, + gmres=scipy.sparse.linalg.gmres, + lgmres=scipy.sparse.linalg.lgmres, + cgs=scipy.sparse.linalg.cgs, + minres=scipy.sparse.linalg.minres, + ).get(method, method) + + self.method_kw = dict(maxiter=inner_maxiter, M=self.preconditioner) + + if self.method is scipy.sparse.linalg.gmres: + # Replace GMRES's outer iteration with Newton steps + self.method_kw['restrt'] = inner_maxiter + self.method_kw['maxiter'] = 1 + elif self.method is scipy.sparse.linalg.lgmres: + self.method_kw['outer_k'] = outer_k + # Replace LGMRES's outer iteration with Newton steps + self.method_kw['maxiter'] = 1 + # Carry LGMRES's `outer_v` vectors across nonlinear iterations + self.method_kw.setdefault('outer_v', []) + # But don't carry the corresponding Jacobian*v products, in case + # the Jacobian changes a lot in the nonlinear step + # + # XXX: some trust-region inspired ideas might be more efficient... + # See eg. Brown & Saad. But needs to be implemented separately + # since it's not an inexact Newton method. + self.method_kw.setdefault('store_outer_Av', False) + + for key, value in kw.items(): + if not key.startswith('inner_'): + raise ValueError("Unknown parameter %s" % key) + self.method_kw[key[6:]] = value + + def _update_diff_step(self): + mx = abs(self.x0).max() + mf = abs(self.f0).max() + self.omega = self.rdiff * max(1, mx) / max(1, mf) + + def matvec(self, v): + nv = norm(v) + if nv == 0: + return 0*v + sc = self.omega / nv + r = (self.func(self.x0 + sc*v) - self.f0) / sc + if not np.all(np.isfinite(r)) and np.all(np.isfinite(v)): + raise ValueError('Function returned non-finite results') + return r + + def solve(self, rhs, tol=0): + sol, info = self.method(self.op, rhs, tol=tol, **self.method_kw) + return sol + + def update(self, x, f): + self.x0 = x + self.f0 = f + self._update_diff_step() + + # Update also the preconditioner, if possible + if self.preconditioner is not None: + if hasattr(self.preconditioner, 'update'): + self.preconditioner.update(x, f) + + def setup(self, x, f, func): + Jacobian.setup(self, x, f, func) + self.x0 = x + self.f0 = f + self.op = scipy.sparse.linalg.aslinearoperator(self) + + if self.rdiff is None: + self.rdiff = np.finfo(x.dtype).eps ** (1./2) + + self._update_diff_step() + + + # Setup also the preconditioner, if possible + if self.preconditioner is not None: + if hasattr(self.preconditioner, 'setup'): + self.preconditioner.setup(x, f, func) + + +#------------------------------------------------------------------------------ +# Wrapper functions +#------------------------------------------------------------------------------ + +def _nonlin_wrapper(name, jac): + """ + Construct a solver wrapper with given name and jacobian approx. + + It inspects the keyword arguments of ``jac.__init__``, and allows to + use the same arguments in the wrapper function, in addition to the + keyword arguments of `nonlin_solve` + + """ + import inspect + args, varargs, varkw, defaults = inspect.getargspec(jac.__init__) + kwargs = zip(args[-len(defaults):], defaults) + kw_str = ", ".join(["%s=%r" % (k, v) for k, v in kwargs]) + if kw_str: + kw_str = ", " + kw_str + kwkw_str = ", ".join(["%s=%s" % (k, k) for k, v in kwargs]) + if kwkw_str: + kwkw_str = kwkw_str + ", " + + # Construct the wrapper function so that it's keyword arguments + # are visible in pydoc.help etc. + wrapper = """ +def %(name)s(F, xin, iter=None %(kw)s, verbose=False, maxiter=None, + f_tol=None, f_rtol=None, x_tol=None, x_rtol=None, + tol_norm=None, line_search='armijo', callback=None, **kw): + jac = %(jac)s(%(kwkw)s **kw) + return nonlin_solve(F, xin, jac, iter, verbose, maxiter, + f_tol, f_rtol, x_tol, x_rtol, tol_norm, line_search, + callback) +""" + + wrapper = wrapper % dict(name=name, kw=kw_str, jac=jac.__name__, + kwkw=kwkw_str) + ns = {} + ns.update(globals()) + exec wrapper in ns + func = ns[name] + func.__doc__ = jac.__doc__ + _set_doc(func) + return func + +broyden1 = _nonlin_wrapper('broyden1', BroydenFirst) +broyden2 = _nonlin_wrapper('broyden2', BroydenSecond) +anderson = _nonlin_wrapper('anderson', Anderson) +linearmixing = _nonlin_wrapper('linearmixing', LinearMixing) +diagbroyden = _nonlin_wrapper('diagbroyden', DiagBroyden) +excitingmixing = _nonlin_wrapper('excitingmixing', ExcitingMixing) +newton_krylov = _nonlin_wrapper('newton_krylov', KrylovJacobian) + + +# Deprecated functions + + at np.deprecate +def broyden_generalized(*a, **kw): + """Use *anderson(..., w0=0)* instead""" + kw.setdefault('w0', 0) + return anderson(*a, **kw) + + at np.deprecate +def broyden1_modified(*a, **kw): + """Use `broyden1` instead""" + return broyden1(*a, **kw) + + at np.deprecate +def broyden_modified(*a, **kw): + """Use `anderson` instead""" + return anderson(*a, **kw) + + at np.deprecate +def anderson2(*a, **kw): + """Use `anderson` instead""" + return anderson(*a, **kw) + + at np.deprecate +def broyden3(*a, **kw): + """Use `broyden2` instead""" + return broyden2(*a, **kw) + + at np.deprecate +def vackar(*a, **kw): + """Use `diagbroyden` instead""" + return diagbroyden(*a, **kw) Modified: trunk/scipy/optimize/tests/test_minpack.py =================================================================== --- trunk/scipy/optimize/tests/test_minpack.py 2010-09-04 22:53:26 UTC (rev 6674) +++ trunk/scipy/optimize/tests/test_minpack.py 2010-09-04 22:53:52 UTC (rev 6675) @@ -9,7 +9,7 @@ from scipy import optimize from scipy.optimize.minpack import fsolve, leastsq, curve_fit -class TestFSolve(TestCase): +class TestFSolve(object): def pressure_network(self, flow_rates, Qtot, k): """Evaluate non-linear equation system representing the pressures and flows in a system of n parallel pipes:: Modified: trunk/scipy/optimize/tests/test_nonlin.py =================================================================== --- trunk/scipy/optimize/tests/test_nonlin.py 2010-09-04 22:53:26 UTC (rev 6674) +++ trunk/scipy/optimize/tests/test_nonlin.py 2010-09-04 22:53:52 UTC (rev 6675) @@ -6,89 +6,340 @@ from numpy.testing import * from scipy.optimize import nonlin -from numpy import matrix, diag +from numpy import matrix, diag, dot +from numpy.linalg import inv +import numpy as np +SOLVERS = [nonlin.anderson, nonlin.diagbroyden, nonlin.linearmixing, + nonlin.excitingmixing, nonlin.broyden1, nonlin.broyden2, + nonlin.newton_krylov] +MUST_WORK = [nonlin.anderson, nonlin.broyden1, nonlin.broyden2, + nonlin.newton_krylov] +#------------------------------------------------------------------------------- +# Test problems +#------------------------------------------------------------------------------- + def F(x): - def p3(y): - return float(y.T*y)*y - try: - x=tuple(x.flat) - except: + x = np.asmatrix(x).T + d = matrix(diag([3,2,1.5,1,0.5])) + c = 0.01 + f = -d*x - c*float(x.T*x)*x + return f +F.xin = [1,1,1,1,1] +F.KNOWN_BAD = [] + +def F2(x): + return x +F2.xin = [1,2,3,4,5,6] +F2.KNOWN_BAD = [nonlin.linearmixing, nonlin.excitingmixing] + +def F3(x): + A = np.mat('-2 1 0; 1 -2 1; 0 1 -2') + b = np.mat('1 2 3') + return np.dot(A, x) - b +F3.xin = [1,2,3] +F3.KNOWN_BAD = [] + +def F4_powell(x): + A = 1e4 + return [A*x[0]*x[1] - 1, np.exp(-x[0]) + np.exp(-x[1]) - (1 + 1/A)] +F4_powell.xin = [-1, -2] +F4_powell.KNOWN_BAD = [nonlin.linearmixing, nonlin.excitingmixing, + nonlin.diagbroyden] + +from test_minpack import TestFSolve as F5_class +F5_object = F5_class() +def F5(x): + return F5_object.pressure_network(x, 4, np.array([.5, .5, .5, .5])) +F5.xin = [2., 0, 2, 0] +F5.KNOWN_BAD = [nonlin.excitingmixing, nonlin.linearmixing, nonlin.diagbroyden] + +def F6(x): + x1, x2 = x + J0 = np.array([[ -4.256 , 14.7 ], + [ 0.8394989 , 0.59964207]]) + v = np.array([(x1 + 3) * (x2**5 - 7) + 3*6, + np.sin(x2 * np.exp(x1) - 1)]) + return -np.linalg.solve(J0, v) +F6.xin = [-0.5, 1.4] +F6.KNOWN_BAD = [nonlin.excitingmixing, nonlin.linearmixing, nonlin.diagbroyden] + +#------------------------------------------------------------------------------- +# Tests +#------------------------------------------------------------------------------- + +class TestNonlin(object): + """ + Check the Broyden methods for a few test problems. + + broyden1, broyden2, and newton_krylov must succeed for + all functions. Some of the others don't -- tests in KNOWN_BAD are skipped. + + """ + + def _check_func(self, f, func, f_tol=1e-2): + x = func(f, f.xin, f_tol=f_tol, maxiter=200, verbose=0) + assert np.absolute(f(x)).max() < f_tol + + @dec.knownfailureif(True) + def _check_func_fail(self, *a, **kw): pass - x=matrix(x).T - d=matrix(diag([3,2,1.5,1,0.5])) - c=0.01 - f=-d*x-c*p3(x) + def test_problem(self): + for f in [F, F2, F3, F4_powell, F5, F6]: + for func in SOLVERS: + if func in f.KNOWN_BAD: + if func in MUST_WORK: + yield self._check_func_fail, f, func + continue + yield self._check_func, f, func - return tuple(f.flat) -class TestNonlin(TestCase): +class TestSecant(TestCase): + """Check that some Jacobian approximations satisfy the secant condition""" + + xs = [np.array([1,2,3,4,5], float), + np.array([2,3,4,5,1], float), + np.array([3,4,5,1,2], float), + np.array([4,5,1,2,3], float), + np.array([9,1,9,1,3], float), + np.array([0,1,9,1,3], float), + np.array([5,5,7,1,1], float), + np.array([1,2,7,5,1], float),] + fs = [x**2 - 1 for x in xs] + + def _check_secant(self, jac_cls, npoints=1, **kw): + """ + Check that the given Jacobian approximation satisfies secant + conditions for last `npoints` points. + """ + jac = jac_cls(**kw) + jac.setup(self.xs[0], self.fs[0], None) + for j, (x, f) in enumerate(zip(self.xs[1:], self.fs[1:])): + jac.update(x, f) + + for k in xrange(min(npoints, j+1)): + dx = self.xs[j-k+1] - self.xs[j-k] + df = self.fs[j-k+1] - self.fs[j-k] + assert np.allclose(dx, jac.solve(df)) + + # Check that the `npoints` secant bound is strict + if j >= npoints: + dx = self.xs[j-npoints+1] - self.xs[j-npoints] + df = self.fs[j-npoints+1] - self.fs[j-npoints] + assert not np.allclose(dx, jac.solve(df)) + + def test_broyden1(self): + self._check_secant(nonlin.BroydenFirst) + + def test_broyden2(self): + self._check_secant(nonlin.BroydenSecond) + + def test_broyden1_update(self): + # Check that BroydenFirst update works as for a dense matrix + jac = nonlin.BroydenFirst(alpha=0.1) + jac.setup(self.xs[0], self.fs[0], None) + + B = np.identity(5) * (-1/0.1) + + for last_j, (x, f) in enumerate(zip(self.xs[1:], self.fs[1:])): + df = f - self.fs[last_j] + dx = x - self.xs[last_j] + B += (df - dot(B, dx))[:,None] * dx[None,:] / dot(dx, dx) + jac.update(x, f) + assert np.allclose(jac.todense(), B, rtol=1e-10, atol=1e-13) + + def test_broyden2_update(self): + # Check that BroydenSecond update works as for a dense matrix + jac = nonlin.BroydenSecond(alpha=0.1) + jac.setup(self.xs[0], self.fs[0], None) + + H = np.identity(5) * (-0.1) + + for last_j, (x, f) in enumerate(zip(self.xs[1:], self.fs[1:])): + df = f - self.fs[last_j] + dx = x - self.xs[last_j] + H += (dx - dot(H, df))[:,None] * df[None,:] / dot(df, df) + jac.update(x, f) + assert np.allclose(jac.todense(), inv(H), rtol=1e-10, atol=1e-13) + + def test_anderson(self): + # Anderson mixing (with w0=0) satisfies secant conditions + # for the last M iterates, see [Ey]_ + # + # .. [Ey] V. Eyert, J. Comp. Phys., 124, 271 (1996). + self._check_secant(nonlin.Anderson, M=3, w0=0, npoints=3) + +class TestLinear(TestCase): + """Solve a linear equation; + some methods find the exact solution in a finite number of steps""" + + def _check(self, jac, N, maxiter, complex=False, **kw): + np.random.seed(123) + + A = np.random.randn(N, N) + if complex: + A = A + 1j*np.random.randn(N, N) + b = np.random.randn(N) + if complex: + b = b + 1j*np.random.randn(N) + + def func(x): + return dot(A, x) - b + + sol = nonlin.nonlin_solve(func, b*0, jac, maxiter=maxiter, + f_tol=1e-6, line_search=None, verbose=0) + assert np.allclose(dot(A, sol), b, atol=1e-6) + + def test_broyden1(self): + # Broyden methods solve linear systems exactly in 2*N steps + self._check(nonlin.BroydenFirst(alpha=1.0), 20, 41, False) + self._check(nonlin.BroydenFirst(alpha=1.0), 20, 41, True) + + def test_broyden2(self): + # Broyden methods solve linear systems exactly in 2*N steps + self._check(nonlin.BroydenSecond(alpha=1.0), 20, 41, False) + self._check(nonlin.BroydenSecond(alpha=1.0), 20, 41, True) + + def test_anderson(self): + # Anderson is rather similar to Broyden, if given enough storage space + self._check(nonlin.Anderson(M=50, alpha=1.0), 20, 29, False) + self._check(nonlin.Anderson(M=50, alpha=1.0), 20, 29, True) + + def test_krylov(self): + # Krylov methods solve linear systems exactly in N inner steps + self._check(nonlin.KrylovJacobian, 20, 2, False, inner_m=10) + self._check(nonlin.KrylovJacobian, 20, 2, True, inner_m=10) + + +class TestJacobianDotSolve(object): + """Check that solve/dot methods in Jacobian approximations are consistent""" + + def _func(self, x): + return x**2 - 1 + np.dot(self.A, x) + + def _check_dot(self, jac_cls, complex=False, tol=1e-6, **kw): + np.random.seed(123) + + N = 7 + def rand(*a): + q = np.random.rand(*a) + if complex: + q = q + 1j*np.random.rand(*a) + return q + + def assert_close(a, b, msg): + d = abs(a - b).max() + f = tol + abs(b).max()*tol + if d > f: + raise AssertionError('%s: err %g' % (msg, d)) + + self.A = rand(N, N) + + # initialize + x0 = np.random.rand(N) + jac = jac_cls(**kw) + jac.setup(x0, self._func(x0), self._func) + + # check consistency + for k in xrange(2*N): + v = rand(N) + + if hasattr(jac, '__array__'): + Jd = np.array(jac) + if hasattr(jac, 'solve'): + Gv = jac.solve(v) + Gv2 = np.linalg.solve(Jd, v) + assert_close(Gv, Gv2, 'solve vs array') + if hasattr(jac, 'rsolve'): + Gv = jac.rsolve(v) + Gv2 = np.linalg.solve(Jd.T.conj(), v) + assert_close(Gv, Gv2, 'rsolve vs array') + if hasattr(jac, 'matvec'): + Jv = jac.matvec(v) + Jv2 = np.dot(Jd, v) + assert_close(Jv, Jv2, 'dot vs array') + if hasattr(jac, 'rmatvec'): + Jv = jac.rmatvec(v) + Jv2 = np.dot(Jd.T.conj(), v) + assert_close(Jv, Jv2, 'rmatvec vs array') + + if hasattr(jac, 'matvec') and hasattr(jac, 'solve'): + Jv = jac.matvec(v) + Jv2 = jac.solve(jac.matvec(Jv)) + assert_close(Jv, Jv2, 'dot vs solve') + + if hasattr(jac, 'rmatvec') and hasattr(jac, 'rsolve'): + Jv = jac.rmatvec(v) + Jv2 = jac.rmatvec(jac.rsolve(Jv)) + assert_close(Jv, Jv2, 'rmatvec vs rsolve') + + x = rand(N) + jac.update(x, self._func(x)) + + def test_broyden1(self): + self._check_dot(nonlin.BroydenFirst, complex=False) + self._check_dot(nonlin.BroydenFirst, complex=True) + + def test_broyden2(self): + self._check_dot(nonlin.BroydenSecond, complex=False) + self._check_dot(nonlin.BroydenSecond, complex=True) + + def test_anderson(self): + self._check_dot(nonlin.Anderson, complex=False) + self._check_dot(nonlin.Anderson, complex=True) + + def test_diagbroyden(self): + self._check_dot(nonlin.DiagBroyden, complex=False) + self._check_dot(nonlin.DiagBroyden, complex=True) + + def test_linearmixing(self): + self._check_dot(nonlin.LinearMixing, complex=False) + self._check_dot(nonlin.LinearMixing, complex=True) + + def test_excitingmixing(self): + self._check_dot(nonlin.ExcitingMixing, complex=False) + self._check_dot(nonlin.ExcitingMixing, complex=True) + + def test_krylov(self): + self._check_dot(nonlin.KrylovJacobian, complex=False, tol=1e-4) + self._check_dot(nonlin.KrylovJacobian, complex=True, tol=1e-4) + +class TestNonlinOldTests(TestCase): """ Test case for a simple constrained entropy maximization problem (the machine translation example of Berger et al in Computational Linguistics, vol 22, num 1, pp 39--72, 1996.) """ - def setUp(self): - self.xin=[1,1,1,1,1] - - def test_linearmixing(self): - x = nonlin.linearmixing(F,self.xin,iter=60,alpha=0.5) - assert nonlin.norm(x)<1e-7 - assert nonlin.norm(F(x))<1e-7 - def test_broyden1(self): - x= nonlin.broyden1(F,self.xin,iter=11,alpha=1) + x= nonlin.broyden1(F,F.xin,iter=12,alpha=1) assert nonlin.norm(x)<1e-9 assert nonlin.norm(F(x))<1e-9 def test_broyden2(self): - x= nonlin.broyden2(F,self.xin,iter=12,alpha=1) + x= nonlin.broyden2(F,F.xin,iter=12,alpha=1) assert nonlin.norm(x)<1e-9 assert nonlin.norm(F(x))<1e-9 - def test_broyden3(self): - x= nonlin.broyden3(F,self.xin,iter=12,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 - - def test_exciting(self): - x= nonlin.excitingmixing(F,self.xin,iter=20,alpha=0.5) - assert nonlin.norm(x)<1e-5 - assert nonlin.norm(F(x))<1e-5 - def test_anderson(self): - x= nonlin.anderson(F,self.xin,iter=12,alpha=0.03,M=5) + x= nonlin.anderson(F,F.xin,iter=12,alpha=0.03,M=5) assert nonlin.norm(x)<0.33 - def test_anderson2(self): - x= nonlin.anderson2(F,self.xin,iter=12,alpha=0.6,M=5) - assert nonlin.norm(x)<0.2 - - def test_broydengeneralized(self): - x= nonlin.broyden_generalized(F,self.xin,iter=60,alpha=0.5,M=0) + def test_linearmixing(self): + x = nonlin.linearmixing(F,F.xin,iter=60,alpha=0.5) assert nonlin.norm(x)<1e-7 assert nonlin.norm(F(x))<1e-7 - x= nonlin.broyden_generalized(F,self.xin,iter=61,alpha=0.1,M=1) - assert nonlin.norm(x)<2e-4 - assert nonlin.norm(F(x))<2e-4 - def xtest_broydenmodified(self): - x= nonlin.broyden_modified(F,self.xin,iter=12,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 + def test_exciting(self): + x= nonlin.excitingmixing(F,F.xin,iter=20,alpha=0.5) + assert nonlin.norm(x)<1e-5 + assert nonlin.norm(F(x))<1e-5 - def test_broyden1modified(self): - x= nonlin.broyden1_modified(F,self.xin,iter=35,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 + def test_diagbroyden(self): + x= nonlin.diagbroyden(F,F.xin,iter=11,alpha=1) + assert nonlin.norm(x)<1e-8 + assert nonlin.norm(F(x))<1e-8 - def test_vackar(self): - x= nonlin.vackar(F,self.xin,iter=11,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 - - if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Sat Sep 4 19:32:20 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 18:32:20 -0500 (CDT) Subject: [Scipy-svn] r6676 - trunk/doc/release Message-ID: <20100904233220.00C8439CD4E@scipy.org> Author: ptvirtan Date: 2010-09-04 18:32:19 -0500 (Sat, 04 Sep 2010) New Revision: 6676 Modified: trunk/doc/release/0.8.0-notes.rst Log: DOC: release: copy 0.8.0 release notes from the 0.8.x branch Modified: trunk/doc/release/0.8.0-notes.rst =================================================================== --- trunk/doc/release/0.8.0-notes.rst 2010-09-04 22:53:52 UTC (rev 6675) +++ trunk/doc/release/0.8.0-notes.rst 2010-09-04 23:32:19 UTC (rev 6676) @@ -4,7 +4,7 @@ .. contents:: -SciPy 0.8.0 is the culmination of XXX months of hard work. It contains +SciPy 0.8.0 is the culmination of 17 months of hard work. It contains many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users @@ -12,16 +12,14 @@ of bug-fixes and optimizations. Moreover, our development attention will now shift to bug-fix releases on the 0.8.x branch, and on adding new features on the development trunk. This release requires Python -2.4 - 2.6 and NumPy 1.3 or greater. +2.4 - 2.6 and NumPy 1.4.1 or greater. Please note that SciPy is still considered to have "Beta" status, as we work toward a SciPy 1.0.0 release. The 1.0.0 release will mark a major milestone in the development of SciPy, after which changing the package structure or API will be much more difficult. Whilst these pre-1.0 releases are considered to have "Beta" status, we are -committed to making them as bug-free as possible. For example, in -addition to fixing numerous bugs in this release, we have also doubled -the number of unit tests since the last release. +committed to making them as bug-free as possible. However, until the 1.0 release, we are aggressively reviewing and refining the functionality, organization, and interface. This is being @@ -36,8 +34,9 @@ Python 3 compatibility is planned and is currently technically feasible, since Numpy has been ported. However, since the Python 3 -compatible Numpy 2.0 has not been released yet, support for Python 3 -in Scipy might not yet be included in Scipy 0.8. +compatible Numpy 1.5 has not been released yet, support for Python 3 +in Scipy is not yet included in Scipy 0.8. SciPy 0.9, planned for fall +2010, will very likely include experimental support for Python 3. Major documentation improvements ================================ @@ -63,6 +62,7 @@ Additional deprecations ----------------------- + * linalg: The function `solveh_banded` currently returns a tuple containing the Cholesky factorization and the solution to the linear system. In SciPy 0.9, the return value will be just the solution. @@ -75,6 +75,7 @@ * Passing the coefficients of a polynomial as the argument `f0` to `signal.chirp` is deprecated. Use the function `signal.sweep_poly` instead. +* The `io.recaster` module has been deprecated and will be removed in 0.9.0. New features ============ @@ -83,8 +84,7 @@ --------------------------- New realtransforms have been added, namely dct and idct for Discrete Cosine -Transform; type I, II and III are available, for both single and double -precision. +Transform; type I, II and III are available. Single precision support for fft functions (scipy.fftpack) ---------------------------------------------------------- @@ -92,6 +92,10 @@ fft functions can now handle single precision inputs as well: fft(x) will return a single precision array if x is single precision. +At the moment, for FFT sizes that are not composites of 2, 3, and 5, the +transform is computed internally in double precision to avoid rounding error in +FFTPACK. + Correlation functions now implement the usual definition (scipy.signal) ----------------------------------------------------------------------- @@ -106,6 +110,7 @@ Additions and modification to LTI functions (scipy.signal) ---------------------------------------------------------- + * The functions `impulse2` and `step2` were added to `scipy.signal`. They use the function `scipy.signal.lsim2` to compute the impulse and step response of a system, respectively. @@ -114,6 +119,7 @@ Improved waveform generators (scipy.signal) ------------------------------------------- + Several improvements to the `chirp` function in `scipy.signal` were made: * The waveform generated when `method="logarithmic"` was corrected; it @@ -129,12 +135,29 @@ New functions and other changes in scipy.linalg ----------------------------------------------- + The functions `cho_solve_banded`, `circulant`, `companion`, `hadamard` and `leslie` were added to `scipy.linalg`. The function `block_diag` was enhanced to accept scalar and 1D arguments, along with the usual 2D arguments. +New function and changes in scipy.optimize +------------------------------------------ + +The `curve_fit` function has been added; it takes a function and uses +non-linear least squares to fit that to the provided data. + +The `leastsq` and `fsolve` functions now return an array of size one instead of +a scalar when solving for a single parameter. + +New sparse least squares solver +------------------------------- + +The `lsqr` function was added to `scipy.sparse`. `This routine +`_ finds a +least-squares solution to a large, sparse, linear system of equations. + ARPACK-based sparse SVD ----------------------- @@ -144,6 +167,7 @@ Alternative behavior available for `scipy.constants.find` --------------------------------------------------------- + The keyword argument `disp` was added to the function `scipy.constants.find`, with the default value `True`. When `disp` is `True`, the behavior is the same as in Scipy version 0.7. When `False`, the function returns the list of @@ -159,6 +183,7 @@ Faster matlab file reader and default behavior change ------------------------------------------------------ + We've rewritten the matlab file reader in Cython and it should now read matlab files at around the same speed that Matlab does. @@ -179,23 +204,40 @@ of this change; for now we suggest using the ``oned_as='row'`` keyword argument to `scipy.io.savemat` and friends. +Faster evaluation of orthogonal polynomials +------------------------------------------- -Improvements to scipy.stats ---------------------------- +Values of orthogonal polynomials can be evaluated with new vectorized functions +in `scipy.special`: `eval_legendre`, `eval_chebyt`, `eval_chebyu`, +`eval_chebyc`, `eval_chebys`, `eval_jacobi`, `eval_laguerre`, +`eval_genlaguerre`, `eval_hermite`, `eval_hermitenorm`, +`eval_gegenbauer`, `eval_sh_legendre`, `eval_sh_chebyt`, +`eval_sh_chebyu`, `eval_sh_jacobi`. This is faster than constructing the +full coefficient representation of the polynomials, which was previously the +only available way. -* addition of mvsdist function which returns distribution objects - providing full information about mean, variance, and standard deviation - of a data-set -* addition of 'median', 'mean', 'std', 'var', 'interval', 'logpdf', - 'logcdf', 'logsf', 'expect' -* addition of 'fit_loc_scale' (deprecation of 'est_loc_scale') -* improvement to 'fit' method of distribution objects so that sub-classes - can add a _fitstart method to fix the starting position of the arguments. - Also, some parameters can be fixed and the data-fitting proceed over the - remaining free parameters using f0..fn and floc and fscale keywords to the - fit function. +Note that the previous orthogonal polynomial routines will now also invoke this +feature, when possible. +Lambert W function +------------------ +`scipy.special.lambertw` can now be used for evaluating the Lambert W +function. + +Improved hypergeometric 2F1 function +------------------------------------ + +Implementation of `scipy.special.hyp2f1` for real parameters was revised. +The new version should produce accurate values for all real parameters. + +More flexible interface for Radial basis function interpolation +--------------------------------------------------------------- + +The `scipy.interpolate.Rbf` class now accepts a callable as input for the +"function" argument, in addition to the built-in radial basis functions which +can be selected with a string argument. + Removed features ================ @@ -203,4 +245,19 @@ The module `scipy.misc.limits` was removed. +scipy.io +-------- +The IO code in both NumPy and SciPy is being extensively +reworked. NumPy will be where basic code for reading and writing NumPy +arrays is located, while SciPy will house file readers and writers for +various data formats (data, audio, video, images, matlab, etc.). + +Several functions in `scipy.io` are removed in the 0.8.0 release including: +`npfile`, `save`, `load`, `create_module`, `create_shelf`, +`objload`, `objsave`, `fopen`, `read_array`, `write_array`, +`fread`, `fwrite`, `bswap`, `packbits`, `unpackbits`, and +`convert_objectarray`. Some of these functions have been replaced by NumPy's +raw reading and writing capabilities, memory-mapping capabilities, or array +methods. Others have been moved from SciPy to NumPy, since basic array reading +and writing capability is now handled by NumPy. From scipy-svn at scipy.org Sat Sep 4 19:32:33 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 18:32:33 -0500 (CDT) Subject: [Scipy-svn] r6677 - trunk/doc/release Message-ID: <20100904233233.0E61C39CD50@scipy.org> Author: ptvirtan Date: 2010-09-04 18:32:32 -0500 (Sat, 04 Sep 2010) New Revision: 6677 Added: trunk/doc/release/0.7.1-notes.rst trunk/doc/release/0.7.2-notes.rst Log: DOC: release: copy 0.7.x release notes from the 0.7.x branch Added: trunk/doc/release/0.7.1-notes.rst =================================================================== --- trunk/doc/release/0.7.1-notes.rst (rev 0) +++ trunk/doc/release/0.7.1-notes.rst 2010-09-04 23:32:32 UTC (rev 6677) @@ -0,0 +1,88 @@ +========================= +SciPy 0.7.1 Release Notes +========================= + +.. contents:: + +SciPy 0.7.1 is a bug-fix release with no new features compared to 0.7.0. + +scipy.io +======== + +Bugs fixed: + +- Several fixes in Matlab file IO + +scipy.odr +========= + +Bugs fixed: + +- Work around a failure with Python 2.6 + +scipy.signal +============ + +Memory leak in lfilter have been fixed, as well as support for array object + +Bugs fixed: + +- #880, #925: lfilter fixes +- #871: bicgstab fails on Win32 + + +scipy.sparse +============ + +Bugs fixed: + +- #883: scipy.io.mmread with scipy.sparse.lil_matrix broken +- lil_matrix and csc_matrix reject now unexpected sequences, + cf. http://thread.gmane.org/gmane.comp.python.scientific.user/19996 + +scipy.special +============= + +Several bugs of varying severity were fixed in the special functions: + +- #503, #640: iv: problems at large arguments fixed by new implementation +- #623: jv: fix errors at large arguments +- #679: struve: fix wrong output for v < 0 +- #803: pbdv produces invalid output +- #804: lqmn: fix crashes on some input +- #823: betainc: fix documentation +- #834: exp1 strange behavior near negative integer values +- #852: jn_zeros: more accurate results for large s, also in jnp/yn/ynp_zeros +- #853: jv, yv, iv: invalid results for non-integer v < 0, complex x +- #854: jv, yv, iv, kv: return nan more consistently when out-of-domain +- #927: ellipj: fix segfault on Windows +- #946: ellpj: fix segfault on Mac OS X/python 2.6 combination. +- ive, jve, yve, kv, kve: with real-valued input, return nan for out-of-domain + instead of returning only the real part of the result. + +Also, when ``scipy.special.errprint(1)`` has been enabled, warning +messages are now issued as Python warnings instead of printing them to +stderr. + + +scipy.stats +=========== + +- linregress, mannwhitneyu, describe: errors fixed +- kstwobign, norm, expon, exponweib, exponpow, frechet, genexpon, rdist, + truncexpon, planck: improvements to numerical accuracy in distributions + +Windows binaries for python 2.6 +=============================== + +python 2.6 binaries for windows are now included. The binary for python 2.5 +requires numpy 1.2.0 or above, and and the one for python 2.6 requires numpy +1.3.0 or above. + +Universal build for scipy +========================= + +Mac OS X binary installer is now a proper universal build, and does not depend +on gfortran anymore (libgfortran is statically linked). The python 2.5 version +of scipy requires numpy 1.2.0 or above, the python 2.6 version requires numpy +1.3.0 or above. Added: trunk/doc/release/0.7.2-notes.rst =================================================================== --- trunk/doc/release/0.7.2-notes.rst (rev 0) +++ trunk/doc/release/0.7.2-notes.rst 2010-09-04 23:32:32 UTC (rev 6677) @@ -0,0 +1,10 @@ +========================= +SciPy 0.7.2 Release Notes +========================= + +.. contents:: + +SciPy 0.7.2 is a bug-fix release with no new features compared to 0.7.1. The +only change is that all C sources from Cython code have been regenerated with +Cython 0.12.1. This fixes the incompatibility between binaries of SciPy 0.7.1 +and NumPy 1.4. From scipy-svn at scipy.org Sat Sep 4 19:32:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 18:32:47 -0500 (CDT) Subject: [Scipy-svn] r6678 - trunk/doc/source Message-ID: <20100904233247.6288139CD51@scipy.org> Author: ptvirtan Date: 2010-09-04 18:32:47 -0500 (Sat, 04 Sep 2010) New Revision: 6678 Added: trunk/doc/source/release.prev.rst Modified: trunk/doc/source/release.rst Log: DOC: include previous release notes in built docs Added: trunk/doc/source/release.prev.rst =================================================================== --- trunk/doc/source/release.prev.rst (rev 0) +++ trunk/doc/source/release.prev.rst 2010-09-04 23:32:47 UTC (rev 6678) @@ -0,0 +1,27 @@ +################################### +Release Notes for previous versions +################################### + +===== +0.8.0 +===== + +.. include:: ../release/0.8.0-notes.rst + +===== +0.7.2 +===== + +.. include:: ../release/0.7.2-notes.rst + +===== +0.7.1 +===== + +.. include:: ../release/0.7.1-notes.rst + +===== +0.7.0 +===== + +.. include:: ../release/0.7.0-notes.rst Modified: trunk/doc/source/release.rst =================================================================== --- trunk/doc/source/release.rst 2010-09-04 23:32:32 UTC (rev 6677) +++ trunk/doc/source/release.rst 2010-09-04 23:32:47 UTC (rev 6678) @@ -2,4 +2,9 @@ Release Notes ************* -.. include:: ../release/0.8.0-notes.rst +.. toctree:: + :maxdepth: 0 + + release.prev + +.. include:: ../release/0.9.0-notes.rst From scipy-svn at scipy.org Sat Sep 4 19:33:08 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 18:33:08 -0500 (CDT) Subject: [Scipy-svn] r6679 - trunk/doc/release Message-ID: <20100904233308.DD05739CD52@scipy.org> Author: ptvirtan Date: 2010-09-04 18:33:08 -0500 (Sat, 04 Sep 2010) New Revision: 6679 Added: trunk/doc/release/0.9.0-notes.rst Log: DOC: release: add initial 0.9.0 release notes Added: trunk/doc/release/0.9.0-notes.rst =================================================================== --- trunk/doc/release/0.9.0-notes.rst (rev 0) +++ trunk/doc/release/0.9.0-notes.rst 2010-09-04 23:33:08 UTC (rev 6679) @@ -0,0 +1,102 @@ +========================= +SciPy 0.9.0 Release Notes +========================= + +.. note:: Scipy 0.9.0 is not released yet! + +.. contents:: + +SciPy 0.9.0 is the culmination of XXX months of hard work. It contains +many new features, numerous bug-fixes, improved test coverage and +better documentation. There have been a number of deprecations and +API changes in this release, which are documented below. All users +are encouraged to upgrade to this release, as there are a large number +of bug-fixes and optimizations. Moreover, our development attention +will now shift to bug-fix releases on the 0.9.x branch, and on adding +new features on the development trunk. + +This release requires Python 2.4 - 2.7 or 3.1 - and NumPy 1.5 or greater. + +Please note that SciPy is still considered to have "Beta" status, as +we work toward a SciPy 1.0.0 release. The 1.0.0 release will mark a +major milestone in the development of SciPy, after which changing the +package structure or API will be much more difficult. Whilst these +pre-1.0 releases are considered to have "Beta" status, we are +committed to making them as bug-free as possible. For example, in +addition to fixing numerous bugs in this release, we have also doubled +the number of unit tests since the last release. + +However, until the 1.0 release, we are aggressively reviewing and +refining the functionality, organization, and interface. This is being +done in an effort to make the package as coherent, intuitive, and +useful as possible. To achieve this, we need help from the community +of users. Specifically, we need feedback regarding all aspects of the +project - everything - from which algorithms we implement, to details +about our function's call signatures. + +Python 3 +======== + +.. note:: This is the goal, we aren't there yet! + +Scipy 0.9.0 is the first release to have full support for Python 3. + +Deprecated features +=================== + +Obsolete nonlinear solvers (in ``scipy.optimize``) +-------------------------------------------------- + +The following nonlinear solvers from ``scipy.optimize`` are +deprecated: + +- ``broyden_modified`` (bad performance) +- ``broyden1_modified`` (bad performance) +- ``broyden_generalized`` (equivalent to ``anderson``) +- ``anderson2`` (equivalent to ``anderson``) +- ``broyden3`` (obsoleted by new limited-memory broyden methods) +- ``vackar`` (renamed to ``diagbroyden``) + + +New features +============ + +Delaunay tesselations (``scipy.spatial``) +----------------------------------------- + +Scipy now includes routines for computing Delaunay tesselations in N +dimensions, powered by the Qhull_ computational geometry library. Such +calculations can now make use of the new ``scipy.spatial.Delaunay`` +interface. + +.. _Qhull: http://www.qhull.org/ + +N-dimensional interpolation (``scipy.interpolate``) +--------------------------------------------------- + +Support for scattered data interpolation is now significantly +improved. This version includes a ``scipy.interpolate.griddata`` +function that can perform linear and nearest-neighbour interpolation +for N-dimensional scattered data, in addition to cubic spline +(C1-smooth) interpolation in 2D and 1D. An object-oriented interface +to each interpolator type is also available. + +Nonlinear equation solvers (``scipy.optimize``) +----------------------------------------------- + +Scipy includes new routines for large-scale nonlinear equation solving +in ``scipy.optimize``. The following methods are implemented: + +* Newton-Krylov (``scipy.optimize.newton_krylov``) +* (Generalized) secant methods: + - Limited-memory Broyden methods (``scipy.optimize.broyden1``, + ``scipy.optimize.broyden2``) + - Anderson method (``scipy.optimize.anderson``) +* Simple iterations (``scipy.optimize.diagbroyden``, + ``scipy.optimize.excitingmixing``, ``scipy.optimize.linearmixing``) + +The ``scipy.optimize.nonlin`` module was completely rewritten, and +some of the functions were deprecated (see above). + +Removed features +================ From scipy-svn at scipy.org Sat Sep 4 19:56:49 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 18:56:49 -0500 (CDT) Subject: [Scipy-svn] r6680 - in trunk/scipy/optimize: . tests Message-ID: <20100904235649.B470E39CD53@scipy.org> Author: ptvirtan Date: 2010-09-04 18:56:49 -0500 (Sat, 04 Sep 2010) New Revision: 6680 Modified: trunk/scipy/optimize/linesearch.py trunk/scipy/optimize/tests/test_linesearch.py Log: BUG: optimize: bail out in scalar_search_wolfe1 when MINPACK reports it cannot find a suitable step size (fixes #1012) Modified: trunk/scipy/optimize/linesearch.py =================================================================== --- trunk/scipy/optimize/linesearch.py 2010-09-04 23:33:08 UTC (rev 6679) +++ trunk/scipy/optimize/linesearch.py 2010-09-04 23:56:49 UTC (rev 6680) @@ -151,7 +151,7 @@ else: break - if task[:5] == 'ERROR': + if task[:5] == 'ERROR' or task[:4] == 'WARN': stp = None # failed return stp, phi1, phi0 Modified: trunk/scipy/optimize/tests/test_linesearch.py =================================================================== --- trunk/scipy/optimize/tests/test_linesearch.py 2010-09-04 23:33:08 UTC (rev 6679) +++ trunk/scipy/optimize/tests/test_linesearch.py 2010-09-04 23:56:49 UTC (rev 6680) @@ -159,6 +159,8 @@ amax=smax) assert_equal(self.fcount, fc+gc) assert_equal(ofv, f(x)) + if s is None: + continue assert_equal(fv, f(x + s*p)) assert_equal(gv, fprime(x + s*p)) if s < smax: From scipy-svn at scipy.org Sat Sep 4 20:04:24 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 4 Sep 2010 19:04:24 -0500 (CDT) Subject: [Scipy-svn] r6681 - trunk/scipy/optimize Message-ID: <20100905000424.1FA5339CD55@scipy.org> Author: ptvirtan Date: 2010-09-04 19:04:24 -0500 (Sat, 04 Sep 2010) New Revision: 6681 Modified: trunk/scipy/optimize/optimize.py Log: BUG: optimize: don't clobber line search old_fval if the first one fails, although this probably does not matter much (fixes #1158) Modified: trunk/scipy/optimize/optimize.py =================================================================== --- trunk/scipy/optimize/optimize.py 2010-09-04 23:56:49 UTC (rev 6680) +++ trunk/scipy/optimize/optimize.py 2010-09-05 00:04:24 UTC (rev 6681) @@ -406,10 +406,14 @@ gnorm = vecnorm(gfk,ord=norm) while (gnorm > gtol) and (k < maxiter): pk = -numpy.dot(Hk,gfk) - alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ + alpha_k, fc, gc, old_fval2, old_old_fval2, gfkp1 = \ line_search_wolfe1(f,myfprime,xk,pk,gfk, old_fval,old_old_fval) - if alpha_k is None: # line search failed try different one. + if alpha_k is not None: + old_fval = old_fval2 + old_old_fval = old_old_fval2 + else: + # line search failed: try different one. alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \ line_search_wolfe2(f,myfprime,xk,pk,gfk, old_fval,old_old_fval) From scipy-svn at scipy.org Sun Sep 5 06:40:19 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 05:40:19 -0500 (CDT) Subject: [Scipy-svn] r6682 - in trunk/scipy/interpolate: . tests Message-ID: <20100905104019.90B8B39CD56@scipy.org> Author: ptvirtan Date: 2010-09-05 05:40:19 -0500 (Sun, 05 Sep 2010) New Revision: 6682 Modified: trunk/scipy/interpolate/griddatand.py trunk/scipy/interpolate/tests/test_griddatand.py Log: ENH: interpolate: add a 'fill_value' keyword to griddata Modified: trunk/scipy/interpolate/griddatand.py =================================================================== --- trunk/scipy/interpolate/griddatand.py 2010-09-05 00:04:24 UTC (rev 6681) +++ trunk/scipy/interpolate/griddatand.py 2010-09-05 10:40:19 UTC (rev 6682) @@ -64,7 +64,7 @@ # Convenience interface function #------------------------------------------------------------------------------ -def griddata(points, values, xi, method='linear'): +def griddata(points, values, xi, method='linear', fill_value=np.nan): """ griddata(points, values, xi, method='linear') @@ -101,7 +101,13 @@ approximately curvature-minimizing polynomial surface. See `CloughTocher2DInterpolator` for more details. + fill_value : float, optional + Value used to fill in for requested points outside of the + convex hull of the input points. If not provided, then the + default is ``nan``. This option has no effect for the + 'nearest' method. + Examples -------- @@ -156,16 +162,17 @@ ndim = points.shape[-1] if ndim == 1 and method in ('nearest', 'linear', 'cubic'): - ip = interp1d(points, values, kind=method, axis=0, bounds_error=False) + ip = interp1d(points, values, kind=method, axis=0, bounds_error=False, + fill_value=fill_value) return ip(xi) elif method == 'nearest': ip = NearestNDInterpolator(points, values) return ip(xi) elif method == 'linear': - ip = LinearNDInterpolator(points, values) + ip = LinearNDInterpolator(points, values, fill_value=fill_value) return ip(xi) elif method == 'cubic' and ndim == 2: - ip = CloughTocher2DInterpolator(points, values) + ip = CloughTocher2DInterpolator(points, values, fill_value=fill_value) return ip(xi) else: raise ValueError("Unknown interpolation method %r for " Modified: trunk/scipy/interpolate/tests/test_griddatand.py =================================================================== --- trunk/scipy/interpolate/tests/test_griddatand.py 2010-09-05 00:04:24 UTC (rev 6681) +++ trunk/scipy/interpolate/tests/test_griddatand.py 2010-09-05 10:40:19 UTC (rev 6682) @@ -5,7 +5,16 @@ class TestGriddata(object): + def test_fill_value(self): + x = [(0,0), (0,1), (1,0)] + y = [1, 2, 3] + yi = griddata(x, y, [(1,1), (1,2), (0,0)], fill_value=-1) + assert_array_equal(yi, [-1, -1, 1]) + + yi = griddata(x, y, [(1,1), (1,2), (0,0)]) + assert_array_equal(yi, [np.nan, np.nan, 1]) + def test_alternative_call(self): x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], dtype=np.double) @@ -14,7 +23,7 @@ for method in ('nearest', 'linear', 'cubic'): yi = griddata((x[:,0], x[:,1]), y, (x[:,0], x[:,1]), method=method) - assert_almost_equal(y, yi, err_msg=method) + assert_allclose(y, yi, atol=1e-14, err_msg=method) def test_multivalue_2d(self): x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], @@ -24,7 +33,7 @@ for method in ('nearest', 'linear', 'cubic'): yi = griddata(x, y, x, method=method) - assert_almost_equal(y, yi, err_msg=method) + assert_allclose(y, yi, atol=1e-14, err_msg=method) def test_multipoint_2d(self): x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], @@ -37,7 +46,8 @@ yi = griddata(x, y, xi, method=method) assert_equal(yi.shape, (5, 3), err_msg=method) - assert_almost_equal(yi, np.tile(y[:,None], (1, 3)), err_msg=method) + assert_allclose(yi, np.tile(y[:,None], (1, 3)), + atol=1e-14, err_msg=method) def test_complex_2d(self): x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], @@ -51,7 +61,8 @@ yi = griddata(x, y, xi, method=method) assert_equal(yi.shape, (5, 3), err_msg=method) - assert_almost_equal(yi, np.tile(y[:,None], (1, 3)), err_msg=method) + assert_allclose(yi, np.tile(y[:,None], (1, 3)), + atol=1e-14, err_msg=method) if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Sun Sep 5 06:40:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 05:40:31 -0500 (CDT) Subject: [Scipy-svn] r6683 - trunk/scipy/interpolate Message-ID: <20100905104031.F41EE39CD57@scipy.org> Author: ptvirtan Date: 2010-09-05 05:40:31 -0500 (Sun, 05 Sep 2010) New Revision: 6683 Modified: trunk/scipy/interpolate/interpnd.pyx Log: BUG: interpolate/interpnd: accept non-ndarray values arrays in the N-d interpolators Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-09-05 10:40:19 UTC (rev 6682) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-05 10:40:31 UTC (rev 6683) @@ -64,11 +64,11 @@ C-contiguous, and of correct type. """ points = _ndim_coords_from_arrays(points) + values = np.ascontiguousarray(values) self._check_init_shape(points, values, ndim=ndim) points = np.ascontiguousarray(points.astype(np.double)) - values = np.ascontiguousarray(values) self.values_shape = values.shape[1:] if values.ndim == 1: From scipy-svn at scipy.org Sun Sep 5 06:40:45 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 05:40:45 -0500 (CDT) Subject: [Scipy-svn] r6684 - trunk/scipy/interpolate Message-ID: <20100905104045.4114639CD59@scipy.org> Author: ptvirtan Date: 2010-09-05 05:40:45 -0500 (Sun, 05 Sep 2010) New Revision: 6684 Modified: trunk/scipy/interpolate/interpnd.c Log: GEN: interpolate: regenerate interpnd.c Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-05 10:40:31 UTC (rev 6683) +++ trunk/scipy/interpolate/interpnd.c 2010-09-05 10:40:45 UTC (rev 6684) @@ -1166,78 +1166,78 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_init_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values); + __Pyx_GIVEREF(__pyx_v_values); + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_values); + __pyx_v_values = __pyx_t_1; + __pyx_t_1 = 0; + + + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_init_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_points); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_points); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); __Pyx_INCREF(__pyx_v_values); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndim), __pyx_v_ndim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndim), __pyx_v_ndim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_points); - __pyx_v_points = __pyx_t_3; - __pyx_t_3 = 0; - - - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_values); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values); - __Pyx_GIVEREF(__pyx_v_values); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_values); - __pyx_v_values = __pyx_t_1; + __Pyx_DECREF(__pyx_v_points); + __pyx_v_points = __pyx_t_1; __pyx_t_1 = 0; From scipy-svn at scipy.org Sun Sep 5 06:42:32 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 05:42:32 -0500 (CDT) Subject: [Scipy-svn] r6685 - trunk/scipy/interpolate Message-ID: <20100905104232.5B79539CD5D@scipy.org> Author: ptvirtan Date: 2010-09-05 05:42:32 -0500 (Sun, 05 Sep 2010) New Revision: 6685 Modified: trunk/scipy/interpolate/griddatand.py Log: DOC: interpolate: remove spurious signature from griddata docstring Modified: trunk/scipy/interpolate/griddatand.py =================================================================== --- trunk/scipy/interpolate/griddatand.py 2010-09-05 10:40:45 UTC (rev 6684) +++ trunk/scipy/interpolate/griddatand.py 2010-09-05 10:42:32 UTC (rev 6685) @@ -66,8 +66,6 @@ def griddata(points, values, xi, method='linear', fill_value=np.nan): """ - griddata(points, values, xi, method='linear') - Interpolate unstructured N-dimensional data. .. versionadded:: 0.9 From scipy-svn at scipy.org Sun Sep 5 07:15:32 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 06:15:32 -0500 (CDT) Subject: [Scipy-svn] r6686 - trunk/doc/source/tutorial Message-ID: <20100905111532.0AF1339CD5E@scipy.org> Author: ptvirtan Date: 2010-09-05 06:15:31 -0500 (Sun, 05 Sep 2010) New Revision: 6686 Modified: trunk/doc/source/tutorial/optimize.rst Log: DOC: tutorial/optimize: add an example for the new nonlinear solvers Modified: trunk/doc/source/tutorial/optimize.rst =================================================================== --- trunk/doc/source/tutorial/optimize.rst 2010-09-05 10:42:32 UTC (rev 6685) +++ trunk/doc/source/tutorial/optimize.rst 2010-09-05 11:15:31 UTC (rev 6686) @@ -588,7 +588,10 @@ .. math:: :nowrap: - \begin{eqnarray*} x_{0}\cos\left(x_{1}\right) & = & 4,\\ x_{0}x_{1}-x_{1} & = & 5.\end{eqnarray*} + \begin{eqnarray*} + x_{0}\cos\left(x_{1}\right) & = & 4,\\ + x_{0}x_{1}-x_{1} & = & 5. + \end{eqnarray*} The results are :math:`x=-1.0299` and :math:`x_{0}=6.5041,\, x_{1}=0.9084` . @@ -610,7 +613,6 @@ [ 6.50409711 0.90841421] - Scalar function root finding ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -635,3 +637,80 @@ :obj:`fixed_point` provides a simple iterative method using Aitkens sequence acceleration to estimate the fixed point of :math:`g` given a starting point. + + +Large problems +^^^^^^^^^^^^^^ + +The :obj:`fsolve` function cannot deal with a very large number of +variables (*N*), as it needs to calculate and invert a dense *N x N* +Jacobian matrix on every Newton step. This becomes rather inefficent +when *N* grows. + +Consider for instance the following problem: we need to solve the +following integrodifferential equation on the square +:math:`[0,1]\times[0,1]`: + +.. math:: + + \nabla^2 P = 10 \left(\int_0^1\int_0^1\cosh(P)\,dx\,dy\right)^2 + +with the boundary condition :math:`P(x,1) = 1` on the upper edge and +:math:`P=0` elsewhere on the boundary of the square. This can be done +by approximating the continuous function *P* by its values on a grid, +:math:`P(n h, m h)`, with a small grid spacing *h*. The derivatives +and integrals can then be approximated, for example by +:math:`\partial_x P(x,y)\approx{}(P(x+h) - P(x-h))/2h`. The problem +is then equivalent to finding the root of some function *residual(P)*, +where *P* is a vector of length :math:`N_x N_y`. + +Now, because :math:`N_x N_y` can be large, :obj:`fsolve` will take a +long time to solve this problem. The solution can however be found +using one of the large-scale solvers in :mod:`scipy.optimize`, for +example :obj:`newton_krylov`, :obj:`broyden2`, or +:obj:`anderson`. These use what is known as the inexact Newton method, +which instead of computing the Jacobian matrix exactly, form an +approximation for it. + +The problem we have can now be solved as follows: + +.. plot:: + + import numpy as np + from scipy.optimize import newton_krylov + from numpy import cosh, zeros_like, mgrid, zeros + + # parameters + nx, ny = 75, 75 + hx, hy = 1./(nx-1), 1./(ny-1) + + P_left, P_right = 0, 0 + P_top, P_bottom = 1, 0 + + def residual(P): + d2x = zeros_like(P) + d2y = zeros_like(P) + + d2x[1:-1] = (P[2:] - 2*P[1:-1] + P[:-2]) / hx/hx + d2x[0] = (P[1] - 2*P[0] + P_left)/hx/hx + d2x[-1] = (P_right - 2*P[-1] + P[-2])/hx/hx + + d2y[:,1:-1] = (P[:,2:] - 2*P[:,1:-1] + P[:,:-2])/hy/hy + d2y[:,0] = (P[:,1] - 2*P[:,0] + P_bottom)/hy/hy + d2y[:,-1] = (P_top - 2*P[:,-1] + P[:,-2])/hy/hy + + return d2x + d2y - 10*cosh(P).mean()**2 + + # solve + guess = zeros((nx, ny), float) + sol = newton_krylov(residual, guess, verbose=1) + #sol = broyden2(residual, guess, max_rank=50, verbose=1) + #sol = anderson(residual, guess, M=10, verbose=1) + print 'Residual', abs(residual(sol)).max() + + # visualize + import matplotlib.pyplot as plt + x, y = mgrid[0:1:(nx*1j), 0:1:(ny*1j)] + plt.pcolor(x, y, sol) + plt.colorbar() + plt.show() From scipy-svn at scipy.org Sun Sep 5 07:46:49 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 06:46:49 -0500 (CDT) Subject: [Scipy-svn] r6687 - trunk/doc/source Message-ID: <20100905114649.13A2839CD61@scipy.org> Author: ptvirtan Date: 2010-09-05 06:46:48 -0500 (Sun, 05 Sep 2010) New Revision: 6687 Modified: trunk/doc/source/optimize.rst Log: DOC: optimize: point to diagbroyden in the docs Modified: trunk/doc/source/optimize.rst =================================================================== --- trunk/doc/source/optimize.rst 2010-09-05 11:15:31 UTC (rev 6686) +++ trunk/doc/source/optimize.rst 2010-09-05 11:46:48 UTC (rev 6687) @@ -120,7 +120,7 @@ excitingmixing linearmixing - vackar + diagbroyden Utility Functions From scipy-svn at scipy.org Sun Sep 5 10:11:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 09:11:29 -0500 (CDT) Subject: [Scipy-svn] r6688 - trunk/doc/source/tutorial Message-ID: <20100905141129.1E8E639CD62@scipy.org> Author: ptvirtan Date: 2010-09-05 09:11:28 -0500 (Sun, 05 Sep 2010) New Revision: 6688 Modified: trunk/doc/source/tutorial/optimize.rst Log: DOC: tutorial/optimize: adjust the newton_krylov example Modified: trunk/doc/source/tutorial/optimize.rst =================================================================== --- trunk/doc/source/tutorial/optimize.rst 2010-09-05 11:46:48 UTC (rev 6687) +++ trunk/doc/source/tutorial/optimize.rst 2010-09-05 14:11:28 UTC (rev 6688) @@ -653,16 +653,17 @@ .. math:: - \nabla^2 P = 10 \left(\int_0^1\int_0^1\cosh(P)\,dx\,dy\right)^2 + (\partial_x^2 + \partial_y^2) P + 5 \left(\int_0^1\int_0^1\cosh(P)\,dx\,dy\right)^2 = 0 with the boundary condition :math:`P(x,1) = 1` on the upper edge and :math:`P=0` elsewhere on the boundary of the square. This can be done by approximating the continuous function *P* by its values on a grid, :math:`P(n h, m h)`, with a small grid spacing *h*. The derivatives -and integrals can then be approximated, for example by -:math:`\partial_x P(x,y)\approx{}(P(x+h) - P(x-h))/2h`. The problem -is then equivalent to finding the root of some function *residual(P)*, -where *P* is a vector of length :math:`N_x N_y`. +and integrals can then be approximated; for instance +:math:`\partial_x^2 P(x,y)\approx{}(P(x+h,y) - 2 P(x,y) + +P(x-h,y))/h^2`. The problem is then equivalent to finding the root of +some function *residual(P)*, where *P* is a vector of length +:math:`N_x N_y`. Now, because :math:`N_x N_y` can be large, :obj:`fsolve` will take a long time to solve this problem. The solution can however be found @@ -699,7 +700,7 @@ d2y[:,0] = (P[:,1] - 2*P[:,0] + P_bottom)/hy/hy d2y[:,-1] = (P_top - 2*P[:,-1] + P[:,-2])/hy/hy - return d2x + d2y - 10*cosh(P).mean()**2 + return d2x + d2y + 5*cosh(P).mean()**2 # solve guess = zeros((nx, ny), float) From scipy-svn at scipy.org Sun Sep 5 10:11:48 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 5 Sep 2010 09:11:48 -0500 (CDT) Subject: [Scipy-svn] r6689 - in trunk/doc: release source Message-ID: <20100905141148.9ABBF39CD65@scipy.org> Author: ptvirtan Date: 2010-09-05 09:11:48 -0500 (Sun, 05 Sep 2010) New Revision: 6689 Added: trunk/doc/source/release.0.7.0.rst trunk/doc/source/release.0.7.1.rst trunk/doc/source/release.0.7.2.rst trunk/doc/source/release.0.8.0.rst trunk/doc/source/release.0.9.0.rst Removed: trunk/doc/source/release.prev.rst Modified: trunk/doc/release/0.7.0-notes.rst trunk/doc/release/0.9.0-notes.rst trunk/doc/source/release.rst Log: DOC: adjust the way how release notes are included Modified: trunk/doc/release/0.7.0-notes.rst =================================================================== --- trunk/doc/release/0.7.0-notes.rst 2010-09-05 14:11:28 UTC (rev 6688) +++ trunk/doc/release/0.7.0-notes.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -39,7 +39,7 @@ to become more involved. Python 2.6 and 3.0 ------------------- +================== A significant amount of work has gone into making SciPy compatible with Python 2.6; however, there are still some issues in this regard. @@ -55,7 +55,7 @@ currently, we don't have any timeline or roadmap for this transition. Major documentation improvements --------------------------------- +================================ SciPy documentation is greatly improved; you can view a HTML reference manual `online `__ or download it as a PDF @@ -75,7 +75,7 @@ documentation editor at http://docs.scipy.org/ and correct the issues. Running Tests -------------- +============= NumPy 1.2 introduced a new testing framework based on `nose `__. Starting with @@ -97,7 +97,7 @@ that number, with just over 4,000 unit tests. Building SciPy --------------- +============== Support for NumScons has been added. NumScons is a tentative new build system for NumPy/SciPy, using `SCons `__ at its @@ -113,7 +113,7 @@ cooperation. Sandbox Removed ---------------- +=============== While porting SciPy to NumPy in 2005, several packages and modules were moved into ``scipy.sandbox``. The sandbox was a staging ground @@ -126,7 +126,7 @@ replaced by other code. Sparse Matrices ---------------- +=============== Sparse matrices have seen extensive improvements. There is now support for integer dtypes such ``int8``, ``uint32``, etc. Two new @@ -169,7 +169,7 @@ numerous bugfixes. Statistics package ------------------- +================== Statistical functions for masked arrays have been added, and are accessible through ``scipy.stats.mstats``. The functions are similar @@ -198,7 +198,7 @@ enhancements in the next release of scipy. Reworking of IO package ------------------------ +======================= The IO code in both NumPy and SciPy is being extensively reworked. NumPy will be where basic code for reading and writing NumPy @@ -227,7 +227,7 @@ ``squeeze_me=False`` by default New Hierarchical Clustering module ----------------------------------- +================================== This module adds new hierarchical clustering functionality to the ``scipy.cluster`` package. The function interfaces are similar to the @@ -251,7 +251,7 @@ matplotlib. New Spatial package -------------------- +=================== The new spatial package contains a collection of spatial algorithms and data structures, useful for spatial statistics and clustering @@ -278,14 +278,14 @@ distance matrices between square and condensed forms. Reworked fftpack package ------------------------- +======================== FFTW2, FFTW3, MKL and DJBFFT wrappers have been removed. Only (NETLIB) fftpack remains. By focusing on one backend, we hope to add new features - like float32 support - more easily. New Constants package ---------------------- +===================== ``scipy.constants`` provides a collection of physical constants and conversion factors. These constants are taken from CODATA Recommended @@ -296,7 +296,7 @@ unless otherwise stated. Several helper functions are provided. New Radial Basis Function module --------------------------------- +================================ ``scipy.interpolate`` now contains a Radial Basis Function module. Radial basis functions can be used for smoothing/interpolating @@ -304,14 +304,14 @@ extrapolation outside of the observed data range. New complex ODE integrator --------------------------- +========================== ``scipy.integrate.ode`` now contains a wrapper for the ZVODE complex-valued ordinary differential equation solver (by Peter N. Brown, Alan C. Hindmarsh, and George D. Byrne). New generalized symmetric and hermitian eigenvalue problem solver ------------------------------------------------------------------ +================================================================= ``scipy.linalg.eigh`` now contains wrappers for more LAPACK symmetric and hermitian eigenvalue problem solvers. Users can now solve @@ -320,7 +320,7 @@ usage. The signature of the ``scipy.linalg.eigh`` changed accordingly. Bug fixes in the interpolation package --------------------------------------- +====================================== The shape of return values from ``scipy.interpolate.interp1d`` used to be incorrect, if interpolated data had more than 2 dimensions and the @@ -330,14 +330,14 @@ revise their code if it relies on the previous behavior. Weave clean up --------------- +============== There were numerous improvements to ``scipy.weave``. ``blitz++`` was relicensed by the author to be compatible with the SciPy license. ``wx_spec.py`` was removed. Known problems --------------- +============== Here are known problems with scipy 0.7.0: Modified: trunk/doc/release/0.9.0-notes.rst =================================================================== --- trunk/doc/release/0.9.0-notes.rst 2010-09-05 14:11:28 UTC (rev 6688) +++ trunk/doc/release/0.9.0-notes.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -88,10 +88,14 @@ in ``scipy.optimize``. The following methods are implemented: * Newton-Krylov (``scipy.optimize.newton_krylov``) + * (Generalized) secant methods: + - Limited-memory Broyden methods (``scipy.optimize.broyden1``, ``scipy.optimize.broyden2``) + - Anderson method (``scipy.optimize.anderson``) + * Simple iterations (``scipy.optimize.diagbroyden``, ``scipy.optimize.excitingmixing``, ``scipy.optimize.linearmixing``) Added: trunk/doc/source/release.0.7.0.rst =================================================================== --- trunk/doc/source/release.0.7.0.rst (rev 0) +++ trunk/doc/source/release.0.7.0.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -0,0 +1 @@ +.. include:: ../release/0.7.0-notes.rst Added: trunk/doc/source/release.0.7.1.rst =================================================================== --- trunk/doc/source/release.0.7.1.rst (rev 0) +++ trunk/doc/source/release.0.7.1.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -0,0 +1 @@ +.. include:: ../release/0.7.1-notes.rst Added: trunk/doc/source/release.0.7.2.rst =================================================================== --- trunk/doc/source/release.0.7.2.rst (rev 0) +++ trunk/doc/source/release.0.7.2.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -0,0 +1 @@ +.. include:: ../release/0.7.2-notes.rst Added: trunk/doc/source/release.0.8.0.rst =================================================================== --- trunk/doc/source/release.0.8.0.rst (rev 0) +++ trunk/doc/source/release.0.8.0.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -0,0 +1 @@ +.. include:: ../release/0.8.0-notes.rst Added: trunk/doc/source/release.0.9.0.rst =================================================================== --- trunk/doc/source/release.0.9.0.rst (rev 0) +++ trunk/doc/source/release.0.9.0.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -0,0 +1 @@ +.. include:: ../release/0.9.0-notes.rst Deleted: trunk/doc/source/release.prev.rst =================================================================== --- trunk/doc/source/release.prev.rst 2010-09-05 14:11:28 UTC (rev 6688) +++ trunk/doc/source/release.prev.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -1,27 +0,0 @@ -################################### -Release Notes for previous versions -################################### - -===== -0.8.0 -===== - -.. include:: ../release/0.8.0-notes.rst - -===== -0.7.2 -===== - -.. include:: ../release/0.7.2-notes.rst - -===== -0.7.1 -===== - -.. include:: ../release/0.7.1-notes.rst - -===== -0.7.0 -===== - -.. include:: ../release/0.7.0-notes.rst Modified: trunk/doc/source/release.rst =================================================================== --- trunk/doc/source/release.rst 2010-09-05 14:11:28 UTC (rev 6688) +++ trunk/doc/source/release.rst 2010-09-05 14:11:48 UTC (rev 6689) @@ -3,8 +3,12 @@ ************* .. toctree:: - :maxdepth: 0 + :maxdepth: 1 - release.prev + release.0.9.0 + release.0.8.0 + release.0.7.2 + release.0.7.1 + release.0.7.0 .. include:: ../release/0.9.0-notes.rst From scipy-svn at scipy.org Mon Sep 6 14:54:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 6 Sep 2010 13:54:23 -0500 (CDT) Subject: [Scipy-svn] r6690 - in trunk/scipy/interpolate: . tests Message-ID: <20100906185423.D3C3E39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-06 13:54:23 -0500 (Mon, 06 Sep 2010) New Revision: 6690 Added: trunk/scipy/interpolate/ndgriddata.py trunk/scipy/interpolate/tests/test_ndgriddata.py Removed: trunk/scipy/interpolate/griddatand.py trunk/scipy/interpolate/tests/test_griddatand.py Modified: trunk/scipy/interpolate/__init__.py Log: ENH: interpolate: rename module griddatand -> ndgriddata Modified: trunk/scipy/interpolate/__init__.py =================================================================== --- trunk/scipy/interpolate/__init__.py 2010-09-05 14:11:48 UTC (rev 6689) +++ trunk/scipy/interpolate/__init__.py 2010-09-06 18:54:23 UTC (rev 6690) @@ -14,7 +14,7 @@ from polyint import * -from griddatand import * +from ndgriddata import * __all__ = filter(lambda s:not s.startswith('_'),dir()) from numpy.testing import Tester Deleted: trunk/scipy/interpolate/griddatand.py =================================================================== --- trunk/scipy/interpolate/griddatand.py 2010-09-05 14:11:48 UTC (rev 6689) +++ trunk/scipy/interpolate/griddatand.py 2010-09-06 18:54:23 UTC (rev 6690) @@ -1,177 +0,0 @@ -""" -Convenience interface to N-D interpolation - -.. versionadded:: 0.9 - -""" - -import numpy as np -from interpnd import LinearNDInterpolator, NDInterpolatorBase, \ - CloughTocher2DInterpolator, _ndim_coords_from_arrays -from scipy.spatial import cKDTree - -__all__ = ['griddata', 'NearestNDInterpolator', 'LinearNDInterpolator', - 'CloughTocher2DInterpolator'] - -#------------------------------------------------------------------------------ -# Nearest-neighbour interpolation -#------------------------------------------------------------------------------ - -class NearestNDInterpolator(NDInterpolatorBase): - """ - NearestNDInterpolator(points, values) - - Nearest-neighbour interpolation in N dimensions. - - .. versionadded:: 0.9 - - Parameters - ---------- - points : ndarray of floats, shape (npoints, ndims) - Data point coordinates. - values : ndarray of float or complex, shape (npoints, ...) - Data values. - - Notes - ----- - Uses ``scipy.spatial.cKDTree`` - - """ - - def __init__(self, x, y): - x = _ndim_coords_from_arrays(x) - self._check_init_shape(x, y) - self.tree = cKDTree(x) - self.points = x - self.values = y - - def __call__(self, xi): - """ - Evaluate interpolator at given points. - - Parameters - ---------- - xi : ndarray of float, shape (..., ndim) - Points where to interpolate data at. - - """ - xi = self._check_call_shape(xi) - dist, i = self.tree.query(xi) - return self.values[i] - - -#------------------------------------------------------------------------------ -# Convenience interface function -#------------------------------------------------------------------------------ - -def griddata(points, values, xi, method='linear', fill_value=np.nan): - """ - Interpolate unstructured N-dimensional data. - - .. versionadded:: 0.9 - - Parameters - ---------- - points : ndarray of floats, shape (npoints, ndims) - Data point coordinates. Can either be a ndarray of - size (npoints, ndim), or a tuple of `ndim` arrays. - values : ndarray of float or complex, shape (npoints, ...) - Data values. - xi : ndarray of float, shape (..., ndim) - Points where to interpolate data at. - - method : {'linear', 'nearest', 'cubic'} - Method of interpolation. One of - - - ``nearest``: return the value at the data point closest to - the point of interpolation. See `NearestNDInterpolator` for - more details. - - - ``linear``: tesselate the input point set to n-dimensional - simplices, and interpolate linearly on each simplex. See - `LinearNDInterpolator` for more details. - - - ``cubic`` (1-D): return the value detemined from a cubic - spline. - - - ``cubic`` (2-D): return the value determined from a - piecewise cubic, continuously differentiable (C1), and - approximately curvature-minimizing polynomial surface. See - `CloughTocher2DInterpolator` for more details. - - fill_value : float, optional - Value used to fill in for requested points outside of the - convex hull of the input points. If not provided, then the - default is ``nan``. This option has no effect for the - 'nearest' method. - - - Examples - -------- - - Suppose we want to interpolate the 2-D function - - >>> def func(x, y): - >>> return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2 - - on a grid in [0, 1]x[0, 1] - - >>> grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j] - - but we only know its values at 1000 data points: - - >>> points = np.random.rand(1000, 2) - >>> values = func(points[:,0], points[:,1]) - - This can be done with `griddata` -- below we try out all of the - interpolation methods: - - >>> from scipy.interpolate import griddata - >>> grid_z0 = griddata(points, values, (grid_x, grid_y), method='nearest') - >>> grid_z1 = griddata(points, values, (grid_x, grid_y), method='linear') - >>> grid_z2 = griddata(points, values, (grid_x, grid_y), method='cubic') - - One can see that the exact result is reproduced by all of the - methods to some degree, but for this smooth function the piecewise - cubic interpolant gives the best results: - - >>> import matplotlib.pyplot as plt - >>> plt.subplot(221) - >>> plt.imshow(func(grid_x, grid_y).T, extent=(0,1,0,1), origin='lower') - >>> plt.plot(points[:,0], points[:,1], 'k.', ms=1) - >>> plt.title('Original') - >>> plt.subplot(222) - >>> plt.imshow(grid_z0.T, extent=(0,1,0,1), origin='lower') - >>> plt.title('Nearest') - >>> plt.subplot(223) - >>> plt.imshow(grid_z1.T, extent=(0,1,0,1), origin='lower') - >>> plt.title('Linear') - >>> plt.subplot(224) - >>> plt.imshow(grid_z2.T, extent=(0,1,0,1), origin='lower') - >>> plt.title('Cubic') - >>> plt.gcf().set_size_inches(6, 6) - >>> plt.show() - - """ - - points = _ndim_coords_from_arrays(points) - xi = _ndim_coords_from_arrays(xi) - - ndim = points.shape[-1] - - if ndim == 1 and method in ('nearest', 'linear', 'cubic'): - ip = interp1d(points, values, kind=method, axis=0, bounds_error=False, - fill_value=fill_value) - return ip(xi) - elif method == 'nearest': - ip = NearestNDInterpolator(points, values) - return ip(xi) - elif method == 'linear': - ip = LinearNDInterpolator(points, values, fill_value=fill_value) - return ip(xi) - elif method == 'cubic' and ndim == 2: - ip = CloughTocher2DInterpolator(points, values, fill_value=fill_value) - return ip(xi) - else: - raise ValueError("Unknown interpolation method %r for " - "%d dimensional data" % (method, ndim)) Copied: trunk/scipy/interpolate/ndgriddata.py (from rev 6689, trunk/scipy/interpolate/griddatand.py) =================================================================== --- trunk/scipy/interpolate/ndgriddata.py (rev 0) +++ trunk/scipy/interpolate/ndgriddata.py 2010-09-06 18:54:23 UTC (rev 6690) @@ -0,0 +1,177 @@ +""" +Convenience interface to N-D interpolation + +.. versionadded:: 0.9 + +""" + +import numpy as np +from interpnd import LinearNDInterpolator, NDInterpolatorBase, \ + CloughTocher2DInterpolator, _ndim_coords_from_arrays +from scipy.spatial import cKDTree + +__all__ = ['griddata', 'NearestNDInterpolator', 'LinearNDInterpolator', + 'CloughTocher2DInterpolator'] + +#------------------------------------------------------------------------------ +# Nearest-neighbour interpolation +#------------------------------------------------------------------------------ + +class NearestNDInterpolator(NDInterpolatorBase): + """ + NearestNDInterpolator(points, values) + + Nearest-neighbour interpolation in N dimensions. + + .. versionadded:: 0.9 + + Parameters + ---------- + points : ndarray of floats, shape (npoints, ndims) + Data point coordinates. + values : ndarray of float or complex, shape (npoints, ...) + Data values. + + Notes + ----- + Uses ``scipy.spatial.cKDTree`` + + """ + + def __init__(self, x, y): + x = _ndim_coords_from_arrays(x) + self._check_init_shape(x, y) + self.tree = cKDTree(x) + self.points = x + self.values = y + + def __call__(self, xi): + """ + Evaluate interpolator at given points. + + Parameters + ---------- + xi : ndarray of float, shape (..., ndim) + Points where to interpolate data at. + + """ + xi = self._check_call_shape(xi) + dist, i = self.tree.query(xi) + return self.values[i] + + +#------------------------------------------------------------------------------ +# Convenience interface function +#------------------------------------------------------------------------------ + +def griddata(points, values, xi, method='linear', fill_value=np.nan): + """ + Interpolate unstructured N-dimensional data. + + .. versionadded:: 0.9 + + Parameters + ---------- + points : ndarray of floats, shape (npoints, ndims) + Data point coordinates. Can either be a ndarray of + size (npoints, ndim), or a tuple of `ndim` arrays. + values : ndarray of float or complex, shape (npoints, ...) + Data values. + xi : ndarray of float, shape (..., ndim) + Points where to interpolate data at. + + method : {'linear', 'nearest', 'cubic'} + Method of interpolation. One of + + - ``nearest``: return the value at the data point closest to + the point of interpolation. See `NearestNDInterpolator` for + more details. + + - ``linear``: tesselate the input point set to n-dimensional + simplices, and interpolate linearly on each simplex. See + `LinearNDInterpolator` for more details. + + - ``cubic`` (1-D): return the value detemined from a cubic + spline. + + - ``cubic`` (2-D): return the value determined from a + piecewise cubic, continuously differentiable (C1), and + approximately curvature-minimizing polynomial surface. See + `CloughTocher2DInterpolator` for more details. + + fill_value : float, optional + Value used to fill in for requested points outside of the + convex hull of the input points. If not provided, then the + default is ``nan``. This option has no effect for the + 'nearest' method. + + + Examples + -------- + + Suppose we want to interpolate the 2-D function + + >>> def func(x, y): + >>> return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2 + + on a grid in [0, 1]x[0, 1] + + >>> grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j] + + but we only know its values at 1000 data points: + + >>> points = np.random.rand(1000, 2) + >>> values = func(points[:,0], points[:,1]) + + This can be done with `griddata` -- below we try out all of the + interpolation methods: + + >>> from scipy.interpolate import griddata + >>> grid_z0 = griddata(points, values, (grid_x, grid_y), method='nearest') + >>> grid_z1 = griddata(points, values, (grid_x, grid_y), method='linear') + >>> grid_z2 = griddata(points, values, (grid_x, grid_y), method='cubic') + + One can see that the exact result is reproduced by all of the + methods to some degree, but for this smooth function the piecewise + cubic interpolant gives the best results: + + >>> import matplotlib.pyplot as plt + >>> plt.subplot(221) + >>> plt.imshow(func(grid_x, grid_y).T, extent=(0,1,0,1), origin='lower') + >>> plt.plot(points[:,0], points[:,1], 'k.', ms=1) + >>> plt.title('Original') + >>> plt.subplot(222) + >>> plt.imshow(grid_z0.T, extent=(0,1,0,1), origin='lower') + >>> plt.title('Nearest') + >>> plt.subplot(223) + >>> plt.imshow(grid_z1.T, extent=(0,1,0,1), origin='lower') + >>> plt.title('Linear') + >>> plt.subplot(224) + >>> plt.imshow(grid_z2.T, extent=(0,1,0,1), origin='lower') + >>> plt.title('Cubic') + >>> plt.gcf().set_size_inches(6, 6) + >>> plt.show() + + """ + + points = _ndim_coords_from_arrays(points) + xi = _ndim_coords_from_arrays(xi) + + ndim = points.shape[-1] + + if ndim == 1 and method in ('nearest', 'linear', 'cubic'): + ip = interp1d(points, values, kind=method, axis=0, bounds_error=False, + fill_value=fill_value) + return ip(xi) + elif method == 'nearest': + ip = NearestNDInterpolator(points, values) + return ip(xi) + elif method == 'linear': + ip = LinearNDInterpolator(points, values, fill_value=fill_value) + return ip(xi) + elif method == 'cubic' and ndim == 2: + ip = CloughTocher2DInterpolator(points, values, fill_value=fill_value) + return ip(xi) + else: + raise ValueError("Unknown interpolation method %r for " + "%d dimensional data" % (method, ndim)) Deleted: trunk/scipy/interpolate/tests/test_griddatand.py =================================================================== --- trunk/scipy/interpolate/tests/test_griddatand.py 2010-09-05 14:11:48 UTC (rev 6689) +++ trunk/scipy/interpolate/tests/test_griddatand.py 2010-09-06 18:54:23 UTC (rev 6690) @@ -1,68 +0,0 @@ -import numpy as np -from numpy.testing import * - -from scipy.interpolate.griddatand import griddata - - -class TestGriddata(object): - def test_fill_value(self): - x = [(0,0), (0,1), (1,0)] - y = [1, 2, 3] - - yi = griddata(x, y, [(1,1), (1,2), (0,0)], fill_value=-1) - assert_array_equal(yi, [-1, -1, 1]) - - yi = griddata(x, y, [(1,1), (1,2), (0,0)]) - assert_array_equal(yi, [np.nan, np.nan, 1]) - - def test_alternative_call(self): - x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], - dtype=np.double) - y = (np.arange(x.shape[0], dtype=np.double)[:,None] - + np.array([0,1])[None,:]) - - for method in ('nearest', 'linear', 'cubic'): - yi = griddata((x[:,0], x[:,1]), y, (x[:,0], x[:,1]), method=method) - assert_allclose(y, yi, atol=1e-14, err_msg=method) - - def test_multivalue_2d(self): - x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], - dtype=np.double) - y = (np.arange(x.shape[0], dtype=np.double)[:,None] - + np.array([0,1])[None,:]) - - for method in ('nearest', 'linear', 'cubic'): - yi = griddata(x, y, x, method=method) - assert_allclose(y, yi, atol=1e-14, err_msg=method) - - def test_multipoint_2d(self): - x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], - dtype=np.double) - y = np.arange(x.shape[0], dtype=np.double) - - xi = x[:,None,:] + np.array([0,0,0])[None,:,None] - - for method in ('nearest', 'linear', 'cubic'): - yi = griddata(x, y, xi, method=method) - - assert_equal(yi.shape, (5, 3), err_msg=method) - assert_allclose(yi, np.tile(y[:,None], (1, 3)), - atol=1e-14, err_msg=method) - - def test_complex_2d(self): - x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], - dtype=np.double) - y = np.arange(x.shape[0], dtype=np.double) - y = y - 2j*y[::-1] - - xi = x[:,None,:] + np.array([0,0,0])[None,:,None] - - for method in ('nearest', 'linear', 'cubic'): - yi = griddata(x, y, xi, method=method) - - assert_equal(yi.shape, (5, 3), err_msg=method) - assert_allclose(yi, np.tile(y[:,None], (1, 3)), - atol=1e-14, err_msg=method) - -if __name__ == "__main__": - run_module_suite() Copied: trunk/scipy/interpolate/tests/test_ndgriddata.py (from rev 6689, trunk/scipy/interpolate/tests/test_griddatand.py) =================================================================== --- trunk/scipy/interpolate/tests/test_ndgriddata.py (rev 0) +++ trunk/scipy/interpolate/tests/test_ndgriddata.py 2010-09-06 18:54:23 UTC (rev 6690) @@ -0,0 +1,68 @@ +import numpy as np +from numpy.testing import * + +from scipy.interpolate import griddata + + +class TestGriddata(object): + def test_fill_value(self): + x = [(0,0), (0,1), (1,0)] + y = [1, 2, 3] + + yi = griddata(x, y, [(1,1), (1,2), (0,0)], fill_value=-1) + assert_array_equal(yi, [-1, -1, 1]) + + yi = griddata(x, y, [(1,1), (1,2), (0,0)]) + assert_array_equal(yi, [np.nan, np.nan, 1]) + + def test_alternative_call(self): + x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], + dtype=np.double) + y = (np.arange(x.shape[0], dtype=np.double)[:,None] + + np.array([0,1])[None,:]) + + for method in ('nearest', 'linear', 'cubic'): + yi = griddata((x[:,0], x[:,1]), y, (x[:,0], x[:,1]), method=method) + assert_allclose(y, yi, atol=1e-14, err_msg=method) + + def test_multivalue_2d(self): + x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], + dtype=np.double) + y = (np.arange(x.shape[0], dtype=np.double)[:,None] + + np.array([0,1])[None,:]) + + for method in ('nearest', 'linear', 'cubic'): + yi = griddata(x, y, x, method=method) + assert_allclose(y, yi, atol=1e-14, err_msg=method) + + def test_multipoint_2d(self): + x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], + dtype=np.double) + y = np.arange(x.shape[0], dtype=np.double) + + xi = x[:,None,:] + np.array([0,0,0])[None,:,None] + + for method in ('nearest', 'linear', 'cubic'): + yi = griddata(x, y, xi, method=method) + + assert_equal(yi.shape, (5, 3), err_msg=method) + assert_allclose(yi, np.tile(y[:,None], (1, 3)), + atol=1e-14, err_msg=method) + + def test_complex_2d(self): + x = np.array([(0,0), (-0.5,-0.5), (-0.5,0.5), (0.5, 0.5), (0.25, 0.3)], + dtype=np.double) + y = np.arange(x.shape[0], dtype=np.double) + y = y - 2j*y[::-1] + + xi = x[:,None,:] + np.array([0,0,0])[None,:,None] + + for method in ('nearest', 'linear', 'cubic'): + yi = griddata(x, y, xi, method=method) + + assert_equal(yi.shape, (5, 3), err_msg=method) + assert_allclose(yi, np.tile(y[:,None], (1, 3)), + atol=1e-14, err_msg=method) + +if __name__ == "__main__": + run_module_suite() From scipy-svn at scipy.org Tue Sep 7 04:35:20 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 7 Sep 2010 03:35:20 -0500 (CDT) Subject: [Scipy-svn] r6691 - trunk/doc/source Message-ID: <20100907083520.B5E3639CC9C@scipy.org> Author: ptvirtan Date: 2010-09-07 03:35:20 -0500 (Tue, 07 Sep 2010) New Revision: 6691 Modified: trunk/doc/source/optimize.rst Log: DOC: optimize: remove spurious link to fsolve Modified: trunk/doc/source/optimize.rst =================================================================== --- trunk/doc/source/optimize.rst 2010-09-06 18:54:23 UTC (rev 6690) +++ trunk/doc/source/optimize.rst 2010-09-07 08:35:20 UTC (rev 6691) @@ -64,11 +64,6 @@ Root finding ============ -.. autosummary:: - :toctree: generated/ - - fsolve - Scalar functions ---------------- From scipy-svn at scipy.org Tue Sep 7 17:53:41 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 7 Sep 2010 16:53:41 -0500 (CDT) Subject: [Scipy-svn] r6692 - in trunk/doc/source/tutorial: . examples Message-ID: <20100907215341.F01E739CCF3@scipy.org> Author: ptvirtan Date: 2010-09-07 16:53:41 -0500 (Tue, 07 Sep 2010) New Revision: 6692 Added: trunk/doc/source/tutorial/examples/newton_krylov_preconditioning.py Modified: trunk/doc/source/tutorial/optimize.rst Log: DOC: optimize/tutorial: add an example of preconditioning when using the matrix-free Newton-Krylov solver Added: trunk/doc/source/tutorial/examples/newton_krylov_preconditioning.py =================================================================== --- trunk/doc/source/tutorial/examples/newton_krylov_preconditioning.py (rev 0) +++ trunk/doc/source/tutorial/examples/newton_krylov_preconditioning.py 2010-09-07 21:53:41 UTC (rev 6692) @@ -0,0 +1,91 @@ +import numpy as np +from scipy.optimize import newton_krylov +from scipy.sparse import spdiags, spkron +from scipy.sparse.linalg import spilu, LinearOperator +from numpy import cosh, zeros_like, mgrid, zeros, eye + +# parameters +nx, ny = 75, 75 +hx, hy = 1./(nx-1), 1./(ny-1) + +P_left, P_right = 0, 0 +P_top, P_bottom = 1, 0 + +def get_preconditioner(): + """Compute the preconditioner M""" + diags_x = zeros((3, nx)) + diags_x[0,:] = 1/hx/hx + diags_x[1,:] = -2/hx/hx + diags_x[2,:] = 1/hx/hx + Lx = spdiags(diags_x, [-1,0,1], nx, nx) + + diags_y = zeros((3, ny)) + diags_y[0,:] = 1/hy/hy + diags_y[1,:] = -2/hy/hy + diags_y[2,:] = 1/hy/hy + Ly = spdiags(diags_y, [-1,0,1], ny, ny) + + J1 = spkron(Lx, eye(ny)) + spkron(eye(nx), Ly) + + # Now we have the matrix `J_1`. We need to find its inverse `M` -- + # however, since an approximate inverse is enough, we can use + # the *incomplete LU* decomposition + + J1_ilu = spilu(J1) + + # This returns an object with a method .solve() that evaluates + # the corresponding matrix-vector product. We need to wrap it into + # a LinearOperator before it can be passed to the Krylov methods: + + M = LinearOperator(shape=(nx*ny, nx*ny), matvec=J1_ilu.solve) + return M + +def solve(preconditioning=True): + """Compute the solution""" + count = [0] + + def residual(P): + count[0] += 1 + + d2x = zeros_like(P) + d2y = zeros_like(P) + + d2x[1:-1] = (P[2:] - 2*P[1:-1] + P[:-2])/hx/hx + d2x[0] = (P[1] - 2*P[0] + P_left)/hx/hx + d2x[-1] = (P_right - 2*P[-1] + P[-2])/hx/hx + + d2y[:,1:-1] = (P[:,2:] - 2*P[:,1:-1] + P[:,:-2])/hy/hy + d2y[:,0] = (P[:,1] - 2*P[:,0] + P_bottom)/hy/hy + d2y[:,-1] = (P_top - 2*P[:,-1] + P[:,-2])/hy/hy + + return d2x + d2y + 5*cosh(P).mean()**2 + + # preconditioner + if preconditioning: + M = get_preconditioner() + else: + M = None + + # solve + guess = zeros((nx, ny), float) + + sol = newton_krylov(residual, guess, verbose=1, inner_M=M) + print 'Residual', abs(residual(sol)).max() + print 'Evaluations', count[0] + + return sol + +def main(): + sol = solve(preconditioning=True) + + # visualize + import matplotlib.pyplot as plt + x, y = mgrid[0:1:(nx*1j), 0:1:(ny*1j)] + plt.clf() + plt.pcolor(x, y, sol) + plt.clim(0, 1) + plt.colorbar() + plt.show() + +if __name__ == "__main__": + main() Modified: trunk/doc/source/tutorial/optimize.rst =================================================================== --- trunk/doc/source/tutorial/optimize.rst 2010-09-07 08:35:20 UTC (rev 6691) +++ trunk/doc/source/tutorial/optimize.rst 2010-09-07 21:53:41 UTC (rev 6692) @@ -3,23 +3,35 @@ .. sectionauthor:: Travis E. Oliphant +.. sectionauthor:: Pauli Virtanen + .. currentmodule:: scipy.optimize -There are several classical optimization algorithms provided by SciPy -in the :mod:`scipy.optimize` package. An overview of the module is -available using :func:`help` (or :func:`pydoc.help`): +The :mod:`scipy.optimize` package provides several commonly used +optimization algorithms. An detailed listing is available: +:mod:`scipy.optimize` (can also be found by ``help(scipy.optimize)``). -.. literalinclude:: examples/5-1 +The module contains: -The first four algorithms are unconstrained minimization algorithms -(:func:`fmin`: Nelder-Mead simplex, :func:`fmin_bfgs`: BFGS, -:func:`fmin_ncg`: Newton Conjugate Gradient, and :func:`leastsq`: -Levenburg-Marquardt). The last algorithm actually finds the roots of a -general function of possibly many variables. It is included in the -optimization package because at the (non-boundary) extreme points of a -function, the gradient is equal to zero. +1. Unconstrained and constrained minimization and least-squares algorithms + (e.g., :func:`fmin`: Nelder-Mead simplex, :func:`fmin_bfgs`: + BFGS, :func:`fmin_ncg`: Newton Conjugate Gradient, + :func:`leastsq`: Levenberg-Marquardt, :func:`fmin_cobyla`: COBYLA). +2. Global (brute-force) optimization routines (e.g., :func:`anneal`) +3. Curve fitting (:func:`curve_fit`) + +4. Scalar function minimizers and root finders (e.g., Brent's method + :func:`fminbound`, and :func:`newton`) + +5. Multivariate equation system solvers (:func:`fsolve`) + +6. Large-scale multivariate equation system solvers (e.g. :func:`newton_krylov`) + +Below, several examples demonstrate their basic usage. + + Nelder-Mead Simplex algorithm (:func:`fmin`) -------------------------------------------- @@ -639,8 +651,8 @@ starting point. -Large problems -^^^^^^^^^^^^^^ +Root finding: Large problems +---------------------------- The :obj:`fsolve` function cannot deal with a very large number of variables (*N*), as it needs to calculate and invert a dense *N x N* @@ -658,9 +670,9 @@ with the boundary condition :math:`P(x,1) = 1` on the upper edge and :math:`P=0` elsewhere on the boundary of the square. This can be done by approximating the continuous function *P* by its values on a grid, -:math:`P(n h, m h)`, with a small grid spacing *h*. The derivatives -and integrals can then be approximated; for instance -:math:`\partial_x^2 P(x,y)\approx{}(P(x+h,y) - 2 P(x,y) + +:math:`P_{n,m}\approx{}P(n h, m h)`, with a small grid spacing +*h*. The derivatives and integrals can then be approximated; for +instance :math:`\partial_x^2 P(x,y)\approx{}(P(x+h,y) - 2 P(x,y) + P(x-h,y))/h^2`. The problem is then equivalent to finding the root of some function *residual(P)*, where *P* is a vector of length :math:`N_x N_y`. @@ -670,7 +682,7 @@ using one of the large-scale solvers in :mod:`scipy.optimize`, for example :obj:`newton_krylov`, :obj:`broyden2`, or :obj:`anderson`. These use what is known as the inexact Newton method, -which instead of computing the Jacobian matrix exactly, form an +which instead of computing the Jacobian matrix exactly, forms an approximation for it. The problem we have can now be solved as follows: @@ -715,3 +727,107 @@ plt.pcolor(x, y, sol) plt.colorbar() plt.show() + + +Still too slow? Preconditioning. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When looking for the zero of the functions :math:`f_i({\bf x}) = 0`, +*i = 1, 2, ..., N*, the :obj:`newton_krylov` solver spends most of its +time inverting the Jacobian matrix, + +.. math:: J_{ij} = \frac{\partial f_i}{\partial x_j} . + +If you have an approximation for the inverse matrix +:math:`M\approx{}J^{-1}`, you can use it for *preconditioning* the +linear inversion problem. The idea is that instead of solving +:math:`J{\bf s}={\bf y}` one solves :math:`MJ{\bf s}=M{\bf y}`: since +matrix :math:`MJ` is "closer" to the identity matrix than :math:`J` +is, the equation should be easier for the Krylov method to deal with. + +The matrix *M* can be passed to :obj:`newton_krylov` as the *inner_M* +parameter. It can be a (sparse) matrix or a +:obj:`scipy.sparse.linalg.LinearOperator` instance. + +For the problem in the previous section, we note that the function to +solve consists of two parts: the first one is application of the +Laplace operator, :math:`[\partial_x^2 + \partial_y^2] P`, and the second +is the integral. We can actually easily compute the Jacobian corresponding +to the Laplace operator part: we know that in one dimension + +.. math:: + + \partial_x^2 \approx \frac{1}{h_x^2} \begin{pmatrix} + -2 & 1 & 0 & 0 \cdots \\ + 1 & -2 & 1 & 0 \cdots \\ + 0 & 1 & -2 & 1 \cdots \\ + \ldots + \end{pmatrix} + = h_x^{-2} L + +so that the whole 2-D operator is represented by + +.. math:: + + J_1 = \partial_x^2 + \partial_y^2 + \simeq + h_x^{-2} L \otimes I + h_y^{-2} I \otimes L + +The matrix :math:`J_2` of the Jacobian corresponding to the integral +is more difficult to calculate, and since *all* of it entries are +nonzero, it will be difficult to invert. :math:`J_1` on the other hand +is a relatively simple matrix, and can be inverted by +:obj:`scipy.sparse.linalg.splu` (or the inverse can be approximated by +:obj:`scipy.sparse.linalg.spilu`). So we are content to take +:math:`M\approx{}J_1^{-1}` and hope for the best. + +In the example below, we use the preconditioner :math:`M=J_1^{-1}`. + +.. literalinclude:: examples/newton_krylov_preconditioning.py + +Resulting run, first without preconditioning:: + + 0: |F(x)| = 803.614; step 1; tol 0.000257947 + 1: |F(x)| = 345.912; step 1; tol 0.166755 + 2: |F(x)| = 139.159; step 1; tol 0.145657 + 3: |F(x)| = 27.3682; step 1; tol 0.0348109 + 4: |F(x)| = 1.03303; step 1; tol 0.00128227 + 5: |F(x)| = 0.0406634; step 1; tol 0.00139451 + 6: |F(x)| = 0.00344341; step 1; tol 0.00645373 + 7: |F(x)| = 0.000153671; step 1; tol 0.00179246 + 8: |F(x)| = 6.7424e-06; step 1; tol 0.00173256 + Residual 3.57078908664e-07 + Evaluations 317 + +and then with preconditioning:: + + 0: |F(x)| = 136.993; step 1; tol 7.49599e-06 + 1: |F(x)| = 4.80983; step 1; tol 0.00110945 + 2: |F(x)| = 0.195942; step 1; tol 0.00149362 + 3: |F(x)| = 0.000563597; step 1; tol 7.44604e-06 + 4: |F(x)| = 1.00698e-09; step 1; tol 2.87308e-12 + Residual 9.29603061195e-11 + Evaluations 77 + +Using a preconditioner reduced the number of evaluations of the +*residual* function by a factor of *4*. For problems where the +residual is expensive to compute, good preconditioning can be crucial +--- it can even decide whether the problem is solvable in practice or +not. + +Preconditioning is an art, science, and industry. Here, we were lucky +in making a simple choice that worked reasonably well, but there is a +lot more depth to this topic than is shown here. + +.. rubric:: References + +Some further reading and related software: + +.. [KK] D.A. Knoll and D.E. Keyes, "Jacobian-free Newton-Krylov methods", + J. Comp. Phys. 193, 357 (2003). + +.. [PP] PETSc http://www.mcs.anl.gov/petsc/ and its Python bindings + http://code.google.com/p/petsc4py/ + +.. [AMG] PyAMG (algebraic multigrid preconditioners/solvers) + http://code.google.com/p/pyamg/ From scipy-svn at scipy.org Tue Sep 7 17:53:56 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 7 Sep 2010 16:53:56 -0500 (CDT) Subject: [Scipy-svn] r6693 - trunk/scipy/optimize Message-ID: <20100907215356.1181F39CD18@scipy.org> Author: ptvirtan Date: 2010-09-07 16:53:55 -0500 (Tue, 07 Sep 2010) New Revision: 6693 Modified: trunk/scipy/optimize/nonlin.py Log: DOC: optimize/nonlin: update KrylovJacobian documentation Modified: trunk/scipy/optimize/nonlin.py =================================================================== --- trunk/scipy/optimize/nonlin.py 2010-09-07 21:53:41 UTC (rev 6692) +++ trunk/scipy/optimize/nonlin.py 2010-09-07 21:53:55 UTC (rev 6693) @@ -1290,6 +1290,10 @@ >>> jac = BroydenFirst() >>> kjac = KrylovJacobian(inner_M=jac.inverse). + + If the preconditioner has a method named 'update', it will be called + as ``update(x, f)`` after each nonlinear step, with ``x`` giving + the current point, and ``f`` the current function value. inner_tol, inner_maxiter, ... Parameters to pass on to the \"inner\" Krylov solver. See `scipy.sparse.linalg.gmres` for details. From scipy-svn at scipy.org Thu Sep 9 13:31:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 9 Sep 2010 12:31:47 -0500 (CDT) Subject: [Scipy-svn] r6694 - in trunk/scipy: interpolate spatial Message-ID: <20100909173147.49F4139CCAA@scipy.org> Author: ptvirtan Date: 2010-09-09 12:31:47 -0500 (Thu, 09 Sep 2010) New Revision: 6694 Modified: trunk/scipy/interpolate/interpnd.c trunk/scipy/interpolate/interpnd.pyx trunk/scipy/spatial/qhull.c trunk/scipy/spatial/qhull.pxd Log: BUG: interpolate/spatial: include numpy/ndarrayobject.h instead of ndarraytypes.h Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-07 21:53:55 UTC (rev 6693) +++ trunk/scipy/interpolate/interpnd.c 2010-09-09 17:31:47 UTC (rev 6694) @@ -157,7 +157,7 @@ #include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" -#include "numpy/ndarraytypes.h" +#include "numpy/ndarrayobject.h" #include "math.h" #ifndef CYTHON_INLINE Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-09-07 21:53:55 UTC (rev 6693) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-09 17:31:47 UTC (rev 6694) @@ -40,7 +40,7 @@ double fmax(double a, double b) nogil double fabs(double a) nogil -cdef extern from "numpy/ndarraytypes.h": +cdef extern from "numpy/ndarrayobject.h": cdef enum: NPY_MAXDIMS Modified: trunk/scipy/spatial/qhull.c =================================================================== --- trunk/scipy/spatial/qhull.c 2010-09-07 21:53:55 UTC (rev 6693) +++ trunk/scipy/spatial/qhull.c 2010-09-09 17:31:47 UTC (rev 6694) @@ -154,7 +154,7 @@ #include #define __PYX_HAVE_API__scipy__spatial__qhull #include "stdlib.h" -#include "numpy/ndarraytypes.h" +#include "numpy/ndarrayobject.h" #include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" Modified: trunk/scipy/spatial/qhull.pxd =================================================================== --- trunk/scipy/spatial/qhull.pxd 2010-09-07 21:53:55 UTC (rev 6693) +++ trunk/scipy/spatial/qhull.pxd 2010-09-09 17:31:47 UTC (rev 6694) @@ -13,7 +13,7 @@ void *malloc(int size) void free(void *ptr) -cdef extern from "numpy/ndarraytypes.h": +cdef extern from "numpy/ndarrayobject.h": cdef enum: NPY_MAXDIMS From scipy-svn at scipy.org Thu Sep 9 13:32:11 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 9 Sep 2010 12:32:11 -0500 (CDT) Subject: [Scipy-svn] r6695 - in trunk/scipy: fftpack interpolate spatial Message-ID: <20100909173211.1F5E539CCAA@scipy.org> Author: ptvirtan Date: 2010-09-09 12:32:11 -0500 (Thu, 09 Sep 2010) New Revision: 6695 Modified: trunk/scipy/fftpack/SConscript trunk/scipy/interpolate/SConscript trunk/scipy/spatial/SConscript Log: BUG: fix some SConscript issues - include lapack in spatial/qhull - import CheckF77Mangling Modified: trunk/scipy/fftpack/SConscript =================================================================== --- trunk/scipy/fftpack/SConscript 2010-09-09 17:31:47 UTC (rev 6694) +++ trunk/scipy/fftpack/SConscript 2010-09-09 17:32:11 UTC (rev 6695) @@ -3,11 +3,12 @@ from os.path import join as pjoin from numscons import GetNumpyEnvironment +from numscons import CheckF77Mangling env = GetNumpyEnvironment(ARGUMENTS) env.Tool('f2py') -config = env.NumpyConfigure() +config = env.NumpyConfigure(custom_tests = {'CheckF77Mangling' : CheckF77Mangling}) config.CheckF77Mangling() config.Finish() Modified: trunk/scipy/interpolate/SConscript =================================================================== --- trunk/scipy/interpolate/SConscript 2010-09-09 17:31:47 UTC (rev 6694) +++ trunk/scipy/interpolate/SConscript 2010-09-09 17:32:11 UTC (rev 6695) @@ -2,12 +2,12 @@ # vim:syntax=python from os.path import join as pjoin -from numscons import GetNumpyEnvironment, CheckF77Clib +from numscons import GetNumpyEnvironment, CheckF77Clib, CheckF77Mangling env = GetNumpyEnvironment(ARGUMENTS) env.Tool('f2py') -config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib}) +config = env.NumpyConfigure(custom_tests = {'CheckF77Clib' : CheckF77Clib, 'CheckF77Mangling': CheckF77Mangling}) if not config.CheckF77Clib(): raise Exception("Could not check F77 runtime, needed for interpolate") config.CheckF77Mangling() Modified: trunk/scipy/spatial/SConscript =================================================================== --- trunk/scipy/spatial/SConscript 2010-09-09 17:31:47 UTC (rev 6694) +++ trunk/scipy/spatial/SConscript 2010-09-09 17:32:11 UTC (rev 6695) @@ -1,10 +1,33 @@ # Last Change: Mon Nov 03 06:00 PM 2008 J # vim:syntax=python from os.path import join -from numscons import GetNumpyEnvironment +from numscons import GetNumpyEnvironment, CheckF77LAPACK, CheckF77Clib +from numscons import write_info env = GetNumpyEnvironment(ARGUMENTS) +#======================= +# Starting Configuration +#======================= +config = env.NumpyConfigure(custom_tests = {'CheckLAPACK' : CheckF77LAPACK}) + +#----------------- +# Checking Lapack +#----------------- +st = config.CheckLAPACK() +if not st: + has_lapack = 0 +else: + has_lapack = 1 + +config.Finish() +write_info(env) + + +#========== +# Build +#========== + env.NumpyPythonExtension('ckdtree', source = ['ckdtree.c']) env.NumpyPythonExtension('_distance_wrap', @@ -16,6 +39,5 @@ 'geom.c', 'geom2.c', 'global.c', 'io.c', 'mem.c', 'merge.c', 'poly.c', 'poly2.c', 'qset.c', 'user.c', 'stat.c', 'qhull.c']] -qhullsrc = env.DistutilsStaticExtLibrary('qhullsrc', source=src) -env.NumpyPythonExtension('qhull', source = 'qhull.c', LIBS=qhullsrc) +env.NumpyPythonExtension('qhull', source = ['qhull.c'] + src) From scipy-svn at scipy.org Fri Sep 10 10:26:53 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 10 Sep 2010 09:26:53 -0500 (CDT) Subject: [Scipy-svn] r6696 - trunk/scipy/interpolate Message-ID: <20100910142653.8512039CC3F@scipy.org> Author: ptvirtan Date: 2010-09-10 09:26:53 -0500 (Fri, 10 Sep 2010) New Revision: 6696 Modified: trunk/scipy/interpolate/interpnd.pyx Log: ENH: interpolate/interpnd: make the interpolators automatically broadcast input arrays appropriately Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-09-09 17:32:11 UTC (rev 6695) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-10 14:26:53 UTC (rev 6696) @@ -143,7 +143,7 @@ """ if (isinstance(points, tuple) or isinstance(points, list)) \ and points and isinstance(points[0], np.ndarray): - p = map(np.asanyarray, points) + p = np.broadcast_arrays(*points) for j in xrange(1, len(p)): if p[j].shape != p[0].shape: raise ValueError("coordinate arrays do not have the same shape") From scipy-svn at scipy.org Fri Sep 10 10:27:02 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 10 Sep 2010 09:27:02 -0500 (CDT) Subject: [Scipy-svn] r6697 - trunk/scipy/interpolate Message-ID: <20100910142702.CD86839CC3F@scipy.org> Author: ptvirtan Date: 2010-09-10 09:27:02 -0500 (Fri, 10 Sep 2010) New Revision: 6697 Modified: trunk/scipy/interpolate/interpnd.c Log: GEN: interpolate: regenerate interpnd.c Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-10 14:26:53 UTC (rev 6696) +++ trunk/scipy/interpolate/interpnd.c 2010-09-10 14:27:02 UTC (rev 6697) @@ -2,17 +2,38 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,13 +103,37 @@ #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif +#ifndef PySet_CheckExact +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -103,32 +148,25 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif + + +#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -146,114 +184,65 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include #define __PYX_HAVE_API__interpnd -#include "stdlib.h" #include "stdio.h" +#include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "numpy/ndarrayobject.h" #include "math.h" + #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif -typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || defined(__INTEL_COMPILER) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -263,7 +252,7 @@ #ifdef __GNUC__ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else @@ -283,7 +272,6 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -309,6 +297,11 @@ #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "interpnd.pyx", + "numpy.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -454,6 +447,8 @@ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); @@ -472,11 +467,11 @@ } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -489,14 +484,14 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -509,15 +504,15 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -531,7 +526,7 @@ r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } @@ -542,7 +537,10 @@ ((likely(PyFloat_CheckExact(obj))) ? \ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + struct __Pyx_StructField_; typedef struct { @@ -564,8 +562,8 @@ } __Pyx_BufFmt_StackElem; +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); @@ -576,20 +574,14 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); -static int __Pyx_EndUnpack(PyObject *); - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); - #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -653,13 +645,11 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); - static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); #ifndef __PYX_FORCE_INIT_THREADS #if PY_VERSION_HEX < 0x02040200 @@ -719,6 +709,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -752,6 +744,8 @@ + + static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; @@ -786,15 +780,15 @@ static int __pyx_f_8interpnd__estimate_gradients_2d_global(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, double *, int, double, double *); static double __pyx_f_8interpnd__clough_tocher_2d_single_double(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int, double *, double *, double *); static __pyx_t_double_complex __pyx_f_8interpnd__clough_tocher_2d_single_complex(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int, double *, __pyx_t_double_complex *, __pyx_t_double_complex *); -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "numpy.double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "numpy.npy_int", NULL, sizeof(npy_int), 'I' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "npy_int", NULL, sizeof(npy_int), 'I' }; static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), 'R' }; static __Pyx_StructField __Pyx_StructFields_nn___pyx_t_5numpy_complex_t[] = { {&__Pyx_TypeInfo_double, "real", offsetof(__pyx_t_5numpy_complex_t, real)}, {&__Pyx_TypeInfo_double, "imag", offsetof(__pyx_t_5numpy_complex_t, imag)}, {NULL, NULL, 0} }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_complex_t = { "numpy.complex_t", __Pyx_StructFields_nn___pyx_t_5numpy_complex_t, sizeof(__pyx_t_5numpy_complex_t), 'C' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_complex_t = { "complex_t", __Pyx_StructFields_nn___pyx_t_5numpy_complex_t, sizeof(__pyx_t_5numpy_complex_t), 'C' }; #define __Pyx_MODULE_NAME "interpnd" int __pyx_module_is_main_interpnd = 0; @@ -802,7 +796,6 @@ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_Warning; static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_map; static PyObject *__pyx_builtin_xrange; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_range; @@ -859,7 +852,6 @@ static char __pyx_k__xi[] = "xi"; static char __pyx_k__buf[] = "buf"; static char __pyx_k__eps[] = "eps"; -static char __pyx_k__map[] = "map"; static char __pyx_k__nan[] = "nan"; static char __pyx_k__obj[] = "obj"; static char __pyx_k__tol[] = "tol"; @@ -925,6 +917,7 @@ static char __pyx_k__values_shape[] = "values_shape"; static char __pyx_k__complexfloating[] = "complexfloating"; static char __pyx_k___evaluate_double[] = "_evaluate_double"; +static char __pyx_k__broadcast_arrays[] = "broadcast_arrays"; static char __pyx_k___check_call_shape[] = "_check_call_shape"; static char __pyx_k___check_init_shape[] = "_check_init_shape"; static char __pyx_k___evaluate_complex[] = "_evaluate_complex"; @@ -976,6 +969,7 @@ static PyObject *__pyx_n_s__ascontiguousarray; static PyObject *__pyx_n_s__astype; static PyObject *__pyx_n_s__base; +static PyObject *__pyx_n_s__broadcast_arrays; static PyObject *__pyx_n_s__buf; static PyObject *__pyx_n_s__byteorder; static PyObject *__pyx_n_s__complex; @@ -997,7 +991,6 @@ static PyObject *__pyx_n_s__is_complex; static PyObject *__pyx_n_s__issubdtype; static PyObject *__pyx_n_s__itemsize; -static PyObject *__pyx_n_s__map; static PyObject *__pyx_n_s__maxiter; static PyObject *__pyx_n_s__names; static PyObject *__pyx_n_s__nan; @@ -1104,12 +1097,12 @@ case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value); - if (unlikely(value)) { values[3] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndim); - if (unlikely(value)) { values[4] = value; kw_args--; } + if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -1141,13 +1134,11 @@ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase.__init__"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_points); __Pyx_INCREF(__pyx_v_values); - __Pyx_INCREF(__pyx_v_fill_value); - __Pyx_INCREF(__pyx_v_ndim); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1464,11 +1455,8 @@ __Pyx_AddTraceback("interpnd.NDInterpolatorBase.__init__"); __pyx_r = NULL; __pyx_L0:; - __Pyx_DECREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_points); __Pyx_DECREF(__pyx_v_values); - __Pyx_DECREF(__pyx_v_fill_value); - __Pyx_DECREF(__pyx_v_ndim); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -1526,7 +1514,7 @@ case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndim); - if (unlikely(value)) { values[3] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -1554,12 +1542,9 @@ __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_init_shape"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_points); - __Pyx_INCREF(__pyx_v_values); - __Pyx_INCREF(__pyx_v_ndim); __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1672,11 +1657,11 @@ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); @@ -1697,10 +1682,6 @@ __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_init_shape"); __pyx_r = NULL; __pyx_L0:; - __Pyx_DECREF(__pyx_v_self); - __Pyx_DECREF(__pyx_v_points); - __Pyx_DECREF(__pyx_v_values); - __Pyx_DECREF(__pyx_v_ndim); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -1758,9 +1739,9 @@ __Pyx_RaiseArgtupleInvalid("_check_call_shape", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_call_shape"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_xi); @@ -1835,7 +1816,6 @@ __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_call_shape"); __pyx_r = NULL; __pyx_L0:; - __Pyx_DECREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -1898,9 +1878,9 @@ __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase.__call__"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_xi); __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_r = Py_None; __Pyx_INCREF(Py_None); @@ -2097,7 +2077,6 @@ __pyx_L0:; __Pyx_DECREF(__pyx_v_shape); __Pyx_DECREF(__pyx_v_r); - __Pyx_DECREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -2119,9 +2098,9 @@ PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("_ndim_coords_from_arrays"); __pyx_self = __pyx_self; @@ -2131,9 +2110,9 @@ __pyx_v_item = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = PyObject_TypeCheck(__pyx_v_points, ((PyTypeObject *)((PyObject*)&PyTuple_Type))); + __pyx_t_1 = PyTuple_Check(__pyx_v_points); if (!__pyx_t_1) { - __pyx_t_2 = PyObject_TypeCheck(__pyx_v_points, ((PyTypeObject *)((PyObject*)&PyList_Type))); + __pyx_t_2 = PyList_Check(__pyx_v_points); __pyx_t_3 = __pyx_t_2; } else { __pyx_t_3 = __pyx_t_1; @@ -2158,93 +2137,88 @@ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__broadcast_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_INCREF(__pyx_v_points); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_points); - __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_Tuple(__pyx_v_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_p = __pyx_t_7; + __pyx_t_7 = 0; - __pyx_t_8 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) { - __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4); + if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_8 = 0; __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; } else { - __pyx_t_6 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_6) { + __pyx_t_7 = PyIter_Next(__pyx_t_4); + if (!__pyx_t_7) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_v_j); - __pyx_v_j = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_j = __pyx_t_7; + __pyx_t_7 = 0; - __pyx_t_6 = PyObject_GetItem(__pyx_v_p, __pyx_v_j); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_v_p, __pyx_v_j); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_8)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_8)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_10, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2262,110 +2236,110 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyFloat_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_10, __pyx_t_9, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_10, __pyx_t_6, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_points); - __pyx_v_points = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_points = __pyx_t_7; + __pyx_t_7 = 0; __Pyx_INCREF(__pyx_int_0); - __pyx_t_6 = __pyx_int_0; + __pyx_t_7 = __pyx_int_0; if (PyList_CheckExact(__pyx_v_p) || PyTuple_CheckExact(__pyx_v_p)) { - __pyx_t_7 = 0; __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); + __pyx_t_8 = 0; __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_4))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; + if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break; + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; + if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; } else { - __pyx_t_9 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_9) { + __pyx_t_6 = PyIter_Next(__pyx_t_4); + if (!__pyx_t_6) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_6); } __Pyx_DECREF(__pyx_v_item); - __pyx_v_item = __pyx_t_9; - __pyx_t_9 = 0; - __Pyx_INCREF(__pyx_t_6); + __pyx_v_item = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_j); - __pyx_v_j = __pyx_t_6; - __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); - __pyx_t_6 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_j = __pyx_t_7; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); + __pyx_t_7 = __pyx_t_6; + __pyx_t_6 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_Ellipsis); - PyTuple_SET_ITEM(__pyx_t_9, 0, Py_Ellipsis); + PyTuple_SET_ITEM(__pyx_t_6, 0, Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); __Pyx_INCREF(__pyx_v_j); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_j); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); - if (PyObject_SetItem(__pyx_v_points, __pyx_t_9, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PyObject_SetItem(__pyx_v_points, __pyx_t_6, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5; } { - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_points); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_points); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_9 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_points); - __pyx_v_points = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_points = __pyx_t_6; + __pyx_t_6 = 0; } __pyx_L5:; @@ -2380,7 +2354,7 @@ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("interpnd._ndim_coords_from_arrays"); __pyx_r = NULL; @@ -2443,7 +2417,7 @@ case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value); - if (unlikely(value)) { values[3] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -2471,6 +2445,7 @@ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator.__init__"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -2653,10 +2628,9 @@ __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator._evaluate_double"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_xi); __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_eps = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; @@ -2754,7 +2728,7 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -2895,7 +2869,7 @@ __pyx_t_22 = __pyx_v_k; if (__pyx_t_21 < 0) __pyx_t_21 += __pyx_bshape_0_out; if (__pyx_t_22 < 0) __pyx_t_22 += __pyx_bshape_1_out; - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_out.buf, __pyx_t_21, __pyx_bstride_0_out, __pyx_t_22, __pyx_bstride_1_out) = 0; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_out.buf, __pyx_t_21, __pyx_bstride_0_out, __pyx_t_22, __pyx_bstride_1_out) = 0.0; } @@ -2930,13 +2904,13 @@ __pyx_L9_continue:; } } + + { int __pyx_why; __pyx_why = 0; goto __pyx_L8; __pyx_L7: __pyx_why = 4; goto __pyx_L8; __pyx_L8:; - - Py_BLOCK_THREADS switch (__pyx_why) { case 4: goto __pyx_L1_error; @@ -2984,8 +2958,6 @@ __Pyx_XDECREF((PyObject *)__pyx_v_points); __Pyx_XDECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF(__pyx_v_eps); - __Pyx_DECREF(__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3119,10 +3091,9 @@ __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator._evaluate_complex"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_xi); __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_eps = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; @@ -3220,7 +3191,7 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -3368,14 +3339,14 @@ __pyx_t_25 = __pyx_v_k; if (__pyx_t_24 < 0) __pyx_t_24 += __pyx_bshape_0_out; if (__pyx_t_25 < 0) __pyx_t_25 += __pyx_bshape_1_out; - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_complex_t *, __pyx_bstruct_out.buf, __pyx_t_24, __pyx_bstride_0_out, __pyx_t_25, __pyx_bstride_1_out)).real = 0; + (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_complex_t *, __pyx_bstruct_out.buf, __pyx_t_24, __pyx_bstride_0_out, __pyx_t_25, __pyx_bstride_1_out)).real = 0.0; __pyx_t_26 = __pyx_v_i; __pyx_t_27 = __pyx_v_k; if (__pyx_t_26 < 0) __pyx_t_26 += __pyx_bshape_0_out; if (__pyx_t_27 < 0) __pyx_t_27 += __pyx_bshape_1_out; - (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_complex_t *, __pyx_bstruct_out.buf, __pyx_t_26, __pyx_bstride_0_out, __pyx_t_27, __pyx_bstride_1_out)).imag = 0; + (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_complex_t *, __pyx_bstruct_out.buf, __pyx_t_26, __pyx_bstride_0_out, __pyx_t_27, __pyx_bstride_1_out)).imag = 0.0; } @@ -3421,13 +3392,13 @@ __pyx_L9_continue:; } } + + { int __pyx_why; __pyx_why = 0; goto __pyx_L8; __pyx_L7: __pyx_why = 4; goto __pyx_L8; __pyx_L8:; - - Py_BLOCK_THREADS switch (__pyx_why) { case 4: goto __pyx_L1_error; @@ -3475,8 +3446,6 @@ __Pyx_XDECREF((PyObject *)__pyx_v_points); __Pyx_XDECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF(__pyx_v_eps); - __Pyx_DECREF(__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3517,7 +3486,7 @@ __pyx_v_ipoint = __pyx_t_2; - (__pyx_v_y[__pyx_v_ipoint]) = 0; + (__pyx_v_y[__pyx_v_ipoint]) = 0.0; } @@ -3526,7 +3495,7 @@ __pyx_v_iiter = __pyx_t_3; - __pyx_v_err = 0; + __pyx_v_err = 0.0; __pyx_t_4 = __pyx_v_d->npoints; @@ -3538,7 +3507,7 @@ __pyx_v_k = __pyx_t_6; - (__pyx_v_Q[__pyx_v_k]) = 0; + (__pyx_v_Q[__pyx_v_k]) = 0.0; } @@ -3546,7 +3515,7 @@ __pyx_v_k = __pyx_t_6; - (__pyx_v_s[__pyx_v_k]) = 0; + (__pyx_v_s[__pyx_v_k]) = 0.0; } @@ -3564,7 +3533,7 @@ __pyx_v_ey = ((__pyx_v_d->points[((2 * __pyx_v_it.vertex2) + 1)]) - (__pyx_v_d->points[((2 * __pyx_v_it.vertex) + 1)])); - __pyx_v_L = sqrt((pow(__pyx_v_ex, 2) + pow(__pyx_v_ey, 2))); + __pyx_v_L = sqrt((pow(__pyx_v_ex, 2.0) + pow(__pyx_v_ey, 2.0))); __pyx_v_L3 = ((__pyx_v_L * __pyx_v_L) * __pyx_v_L); @@ -3579,19 +3548,19 @@ __pyx_v_df2 = (((-__pyx_v_ex) * (__pyx_v_y[((__pyx_v_it.vertex2 * 2) + 0)])) - (__pyx_v_ey * (__pyx_v_y[((__pyx_v_it.vertex2 * 2) + 1)]))); - (__pyx_v_Q[0]) += (((4 * __pyx_v_ex) * __pyx_v_ex) / __pyx_v_L3); + (__pyx_v_Q[0]) += (((4.0 * __pyx_v_ex) * __pyx_v_ex) / __pyx_v_L3); - (__pyx_v_Q[1]) += (((4 * __pyx_v_ex) * __pyx_v_ey) / __pyx_v_L3); + (__pyx_v_Q[1]) += (((4.0 * __pyx_v_ex) * __pyx_v_ey) / __pyx_v_L3); - (__pyx_v_Q[3]) += (((4 * __pyx_v_ey) * __pyx_v_ey) / __pyx_v_L3); + (__pyx_v_Q[3]) += (((4.0 * __pyx_v_ey) * __pyx_v_ey) / __pyx_v_L3); - (__pyx_v_s[0]) += ((((6 * (__pyx_v_f1 - __pyx_v_f2)) - (2 * __pyx_v_df2)) * __pyx_v_ex) / __pyx_v_L3); + (__pyx_v_s[0]) += ((((6.0 * (__pyx_v_f1 - __pyx_v_f2)) - (2.0 * __pyx_v_df2)) * __pyx_v_ex) / __pyx_v_L3); - (__pyx_v_s[1]) += ((((6 * (__pyx_v_f1 - __pyx_v_f2)) - (2 * __pyx_v_df2)) * __pyx_v_ey) / __pyx_v_L3); + (__pyx_v_s[1]) += ((((6.0 * (__pyx_v_f1 - __pyx_v_f2)) - (2.0 * __pyx_v_df2)) * __pyx_v_ey) / __pyx_v_L3); __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next((&__pyx_v_it)); @@ -3722,12 +3691,12 @@ case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxiter); - if (unlikely(value)) { values[2] = value; kw_args--; } + if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tol); - if (unlikely(value)) { values[3] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -3757,12 +3726,10 @@ __Pyx_RaiseArgtupleInvalid("estimate_gradients_2d_global", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.estimate_gradients_2d_global"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_tri); __Pyx_INCREF(__pyx_v_y); - __Pyx_INCREF(__pyx_v_maxiter); - __Pyx_INCREF(__pyx_v_tol); __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_grad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_rg = Py_None; __Pyx_INCREF(Py_None); @@ -4158,13 +4125,13 @@ __pyx_v_ret = __pyx_f_8interpnd__estimate_gradients_2d_global(__pyx_v_info, (((double *)__pyx_v_data->data) + (__pyx_v_info->npoints * __pyx_v_k)), __pyx_t_13, __pyx_t_14, (((double *)__pyx_v_grad->data) + ((2 * __pyx_v_info->npoints) * __pyx_v_k))); } + + { int __pyx_why; __pyx_why = 0; goto __pyx_L15; __pyx_L14: __pyx_why = 4; goto __pyx_L15; __pyx_L15:; - - Py_BLOCK_THREADS switch (__pyx_why) { case 4: goto __pyx_L1_error; @@ -4276,10 +4243,7 @@ __Pyx_DECREF(__pyx_v_r); __Pyx_DECREF(__pyx_v_y_shape); __Pyx_DECREF(__pyx_v_yi); - __Pyx_DECREF(__pyx_v_tri); __Pyx_DECREF(__pyx_v_y); - __Pyx_DECREF(__pyx_v_maxiter); - __Pyx_DECREF(__pyx_v_tol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4364,22 +4328,22 @@ __pyx_v_e31y = ((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_isimplex) + 0)])))]) - (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_isimplex) + 2)])))])); - __pyx_v_e14x = ((__pyx_v_e12x - __pyx_v_e31x) / 3); + __pyx_v_e14x = ((__pyx_v_e12x - __pyx_v_e31x) / 3.0); - __pyx_v_e14y = ((__pyx_v_e12y - __pyx_v_e31y) / 3); + __pyx_v_e14y = ((__pyx_v_e12y - __pyx_v_e31y) / 3.0); - __pyx_v_e24x = (((-__pyx_v_e12x) + __pyx_v_e23x) / 3); + __pyx_v_e24x = (((-__pyx_v_e12x) + __pyx_v_e23x) / 3.0); - __pyx_v_e24y = (((-__pyx_v_e12y) + __pyx_v_e23y) / 3); + __pyx_v_e24y = (((-__pyx_v_e12y) + __pyx_v_e23y) / 3.0); - __pyx_v_e34x = ((__pyx_v_e31x - __pyx_v_e23x) / 3); + __pyx_v_e34x = ((__pyx_v_e31x - __pyx_v_e23x) / 3.0); - __pyx_v_e34y = ((__pyx_v_e31y - __pyx_v_e23y) / 3); + __pyx_v_e34y = ((__pyx_v_e31y - __pyx_v_e23y) / 3.0); __pyx_v_f1 = (__pyx_v_f[0]); @@ -4412,37 +4376,37 @@ __pyx_v_c3000 = __pyx_v_f1; - __pyx_v_c2100 = ((__pyx_v_df12 + (3 * __pyx_v_c3000)) / 3); + __pyx_v_c2100 = ((__pyx_v_df12 + (3.0 * __pyx_v_c3000)) / 3.0); - __pyx_v_c2010 = ((__pyx_v_df13 + (3 * __pyx_v_c3000)) / 3); + __pyx_v_c2010 = ((__pyx_v_df13 + (3.0 * __pyx_v_c3000)) / 3.0); __pyx_v_c0300 = __pyx_v_f2; - __pyx_v_c1200 = ((__pyx_v_df21 + (3 * __pyx_v_c0300)) / 3); + __pyx_v_c1200 = ((__pyx_v_df21 + (3.0 * __pyx_v_c0300)) / 3.0); - __pyx_v_c0210 = ((__pyx_v_df23 + (3 * __pyx_v_c0300)) / 3); + __pyx_v_c0210 = ((__pyx_v_df23 + (3.0 * __pyx_v_c0300)) / 3.0); __pyx_v_c0030 = __pyx_v_f3; - __pyx_v_c1020 = ((__pyx_v_df31 + (3 * __pyx_v_c0030)) / 3); + __pyx_v_c1020 = ((__pyx_v_df31 + (3.0 * __pyx_v_c0030)) / 3.0); - __pyx_v_c0120 = ((__pyx_v_df32 + (3 * __pyx_v_c0030)) / 3); + __pyx_v_c0120 = ((__pyx_v_df32 + (3.0 * __pyx_v_c0030)) / 3.0); - __pyx_v_c2001 = (((__pyx_v_c2100 + __pyx_v_c2010) + __pyx_v_c3000) / 3); + __pyx_v_c2001 = (((__pyx_v_c2100 + __pyx_v_c2010) + __pyx_v_c3000) / 3.0); - __pyx_v_c0201 = (((__pyx_v_c1200 + __pyx_v_c0300) + __pyx_v_c0210) / 3); + __pyx_v_c0201 = (((__pyx_v_c1200 + __pyx_v_c0300) + __pyx_v_c0210) / 3.0); - __pyx_v_c0021 = (((__pyx_v_c1020 + __pyx_v_c0120) + __pyx_v_c0030) / 3); + __pyx_v_c0021 = (((__pyx_v_c1020 + __pyx_v_c0120) + __pyx_v_c0030) / 3.0); for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { @@ -4460,21 +4424,21 @@ case 0: - __pyx_v_g1 = ((-2.0) / 3); + __pyx_v_g1 = ((-2.) / 3.0); break; case 1: - __pyx_v_g2 = ((-2.0) / 3); + __pyx_v_g2 = ((-2.) / 3.0); break; case 2: - __pyx_v_g3 = ((-2.0) / 3); + __pyx_v_g3 = ((-2.) / 3.0); break; } @@ -4485,10 +4449,10 @@ __pyx_L5:; - (__pyx_v_y[0]) = ((((__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3); + (__pyx_v_y[0]) = ((((__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3.0); - (__pyx_v_y[1]) = ((((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3); + (__pyx_v_y[1]) = ((((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3.0); __pyx_f_5scipy_7spatial_5qhull__barycentric_coordinates(2, (__pyx_v_d->transform + ((__pyx_v_isimplex * 2) * 3)), __pyx_v_y, __pyx_v_c); @@ -4498,46 +4462,46 @@ case 0: - __pyx_v_g1 = ((((2 * (__pyx_v_c[2])) + (__pyx_v_c[1])) - 1) / ((2 - (3 * (__pyx_v_c[2]))) - (3 * (__pyx_v_c[1])))); + __pyx_v_g1 = ((((2.0 * (__pyx_v_c[2])) + (__pyx_v_c[1])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[2]))) - (3.0 * (__pyx_v_c[1])))); break; case 1: - __pyx_v_g2 = ((((2 * (__pyx_v_c[0])) + (__pyx_v_c[2])) - 1) / ((2 - (3 * (__pyx_v_c[0]))) - (3 * (__pyx_v_c[2])))); + __pyx_v_g2 = ((((2.0 * (__pyx_v_c[0])) + (__pyx_v_c[2])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[0]))) - (3.0 * (__pyx_v_c[2])))); break; case 2: - __pyx_v_g3 = ((((2 * (__pyx_v_c[1])) + (__pyx_v_c[0])) - 1) / ((2 - (3 * (__pyx_v_c[1]))) - (3 * (__pyx_v_c[0])))); + __pyx_v_g3 = ((((2.0 * (__pyx_v_c[1])) + (__pyx_v_c[0])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[1]))) - (3.0 * (__pyx_v_c[0])))); break; } __pyx_L3_continue:; } - __pyx_v_c0111 = (((__pyx_v_g1 * ((((-__pyx_v_c0300) + (3 * __pyx_v_c0210)) - (3 * __pyx_v_c0120)) + __pyx_v_c0030)) + (((((-__pyx_v_c0300) + (2 * __pyx_v_c0210)) - __pyx_v_c0120) + __pyx_v_c0021) + __pyx_v_c0201)) / 2); + __pyx_v_c0111 = (((__pyx_v_g1 * ((((-__pyx_v_c0300) + (3.0 * __pyx_v_c0210)) - (3.0 * __pyx_v_c0120)) + __pyx_v_c0030)) + (((((-__pyx_v_c0300) + (2.0 * __pyx_v_c0210)) - __pyx_v_c0120) + __pyx_v_c0021) + __pyx_v_c0201)) / 2.0); - __pyx_v_c1011 = (((__pyx_v_g2 * ((((-__pyx_v_c0030) + (3 * __pyx_v_c1020)) - (3 * __pyx_v_c2010)) + __pyx_v_c3000)) + (((((-__pyx_v_c0030) + (2 * __pyx_v_c1020)) - __pyx_v_c2010) + __pyx_v_c2001) + __pyx_v_c0021)) / 2); + __pyx_v_c1011 = (((__pyx_v_g2 * ((((-__pyx_v_c0030) + (3.0 * __pyx_v_c1020)) - (3.0 * __pyx_v_c2010)) + __pyx_v_c3000)) + (((((-__pyx_v_c0030) + (2.0 * __pyx_v_c1020)) - __pyx_v_c2010) + __pyx_v_c2001) + __pyx_v_c0021)) / 2.0); - __pyx_v_c1101 = (((__pyx_v_g3 * ((((-__pyx_v_c3000) + (3 * __pyx_v_c2100)) - (3 * __pyx_v_c1200)) + __pyx_v_c0300)) + (((((-__pyx_v_c3000) + (2 * __pyx_v_c2100)) - __pyx_v_c1200) + __pyx_v_c2001) + __pyx_v_c0201)) / 2); + __pyx_v_c1101 = (((__pyx_v_g3 * ((((-__pyx_v_c3000) + (3.0 * __pyx_v_c2100)) - (3.0 * __pyx_v_c1200)) + __pyx_v_c0300)) + (((((-__pyx_v_c3000) + (2.0 * __pyx_v_c2100)) - __pyx_v_c1200) + __pyx_v_c2001) + __pyx_v_c0201)) / 2.0); - __pyx_v_c1002 = (((__pyx_v_c1101 + __pyx_v_c1011) + __pyx_v_c2001) / 3); + __pyx_v_c1002 = (((__pyx_v_c1101 + __pyx_v_c1011) + __pyx_v_c2001) / 3.0); - __pyx_v_c0102 = (((__pyx_v_c1101 + __pyx_v_c0111) + __pyx_v_c0201) / 3); + __pyx_v_c0102 = (((__pyx_v_c1101 + __pyx_v_c0111) + __pyx_v_c0201) / 3.0); - __pyx_v_c0012 = (((__pyx_v_c1011 + __pyx_v_c0111) + __pyx_v_c0021) / 3); + __pyx_v_c0012 = (((__pyx_v_c1011 + __pyx_v_c0111) + __pyx_v_c0021) / 3.0); - __pyx_v_c0003 = (((__pyx_v_c1002 + __pyx_v_c0102) + __pyx_v_c0012) / 3); + __pyx_v_c0003 = (((__pyx_v_c1002 + __pyx_v_c0102) + __pyx_v_c0012) / 3.0); __pyx_v_minval = (__pyx_v_b[0]); @@ -4567,10 +4531,10 @@ __pyx_v_b3 = ((__pyx_v_b[2]) - __pyx_v_minval); - __pyx_v_b4 = (3 * __pyx_v_minval); + __pyx_v_b4 = (3.0 * __pyx_v_minval); - __pyx_v_w = (((((((((((((((((((pow(__pyx_v_b1, 3) * __pyx_v_c3000) + (((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b2) * __pyx_v_c2100)) + (((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b3) * __pyx_v_c2010)) + (((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b4) * __pyx_v_c2001)) + (((3 * __pyx_v_b1) * pow(__pyx_v_b2, 2)) * __pyx_v_c1200)) + ((((6 * __pyx_v_b1) * __pyx_v_b2) * __pyx_v_b4) * __pyx_v_c1101)) + (((3 * __pyx_v_b1) * pow(__pyx_v_b3, 2)) * __pyx_v_c1020)) + ((((6 * __pyx_v_b1) * __pyx_v_b3) * __pyx_v_b4) * __pyx_v_c1011)) + (((3 * __pyx_v_b1) * pow(__pyx_v_b4, 2)) * __pyx_v_c1002)) + (pow(__pyx_v_b2, 3) * __pyx_v_c0300)) + (((3 * pow(__pyx_v_b2, 2)) * __pyx_v_b3) * __pyx_v_c0210)) + (((3 * pow(__pyx_v_b2, 2)) * __pyx_v_b4) * __pyx_v_c0201)) + (((3 * __pyx_v_b2) * pow(__pyx_v_b3, 2)) * __pyx_v_c0120)) + ((((6 * __pyx_v_b2) * __pyx_v_b3) * __pyx_v_b4) * __pyx_v_c0111)) + (((3 * __pyx_v_b2) * pow(__pyx_v_b4, 2)) * __pyx_v_c0102)) + (pow(__pyx_v_b3, 3) * __pyx_v_c0030)) + (((3 * pow(__pyx_v_b3, 2)) * __pyx_v_b4) * __pyx_v_c0021)) + (((3 * __pyx_v_b3) * pow(__pyx_v_b4, 2)) * __pyx_v_c0012)) + (pow(__pyx_v_b4, 3) * __pyx_v_c0003)); + __pyx_v_w = (((((((((((((((((((pow(__pyx_v_b1, 3.0) * __pyx_v_c3000) + (((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b2) * __pyx_v_c2100)) + (((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b3) * __pyx_v_c2010)) + (((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b4) * __pyx_v_c2001)) + (((3.0 * __pyx_v_b1) * pow(__pyx_v_b2, 2.0)) * __pyx_v_c1200)) + ((((6.0 * __pyx_v_b1) * __pyx_v_b2) * __pyx_v_b4) * __pyx_v_c1101)) + (((3.0 * __pyx_v_b1) * pow(__pyx_v_b3, 2.0)) * __pyx_v_c1020)) + ((((6.0 * __pyx_v_b1) * __pyx_v_b3) * __pyx_v_b4) * __pyx_v_c1011)) + (((3.0 * __pyx_v_b1) * pow(__pyx_v_b4, 2.0)) * __pyx_v_c1002)) + (pow(__pyx_v_b2, 3.0) * __pyx_v_c0300)) + (((3.0 * pow(__pyx_v_b2, 2.0)) * __pyx_v_b3) * __pyx_v_c0210)) + (((3.0 * pow(__pyx_v_b2, 2.0)) * __pyx_v_b4) * __pyx_v_c0201)) + (((3.0 * __pyx_v_b2) * pow(__pyx_v_b3, 2.0)) * __pyx_v_c0120)) + ((((6.0 * __pyx_v_b2) * __pyx_v_b3) * __pyx_v_b4) * __pyx_v_c0111)) + (((3.0 * __pyx_v_b2) * pow(__pyx_v_b4, 2.0)) * __pyx_v_c0102)) + (pow(__pyx_v_b3, 3.0) * __pyx_v_c0030)) + (((3.0 * pow(__pyx_v_b3, 2.0)) * __pyx_v_b4) * __pyx_v_c0021)) + (((3.0 * __pyx_v_b3) * pow(__pyx_v_b4, 2.0)) * __pyx_v_c0012)) + (pow(__pyx_v_b4, 3.0) * __pyx_v_c0003)); __pyx_r = __pyx_v_w; @@ -4660,22 +4624,22 @@ __pyx_v_e31y = ((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_isimplex) + 0)])))]) - (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_isimplex) + 2)])))])); - __pyx_v_e14x = ((__pyx_v_e12x - __pyx_v_e31x) / 3); + __pyx_v_e14x = ((__pyx_v_e12x - __pyx_v_e31x) / 3.0); - __pyx_v_e14y = ((__pyx_v_e12y - __pyx_v_e31y) / 3); + __pyx_v_e14y = ((__pyx_v_e12y - __pyx_v_e31y) / 3.0); - __pyx_v_e24x = (((-__pyx_v_e12x) + __pyx_v_e23x) / 3); + __pyx_v_e24x = (((-__pyx_v_e12x) + __pyx_v_e23x) / 3.0); - __pyx_v_e24y = (((-__pyx_v_e12y) + __pyx_v_e23y) / 3); + __pyx_v_e24y = (((-__pyx_v_e12y) + __pyx_v_e23y) / 3.0); - __pyx_v_e34x = ((__pyx_v_e31x - __pyx_v_e23x) / 3); + __pyx_v_e34x = ((__pyx_v_e31x - __pyx_v_e23x) / 3.0); - __pyx_v_e34y = ((__pyx_v_e31y - __pyx_v_e23y) / 3); + __pyx_v_e34y = ((__pyx_v_e31y - __pyx_v_e23y) / 3.0); __pyx_v_f1 = (__pyx_v_f[0]); @@ -4756,21 +4720,21 @@ case 0: - __pyx_v_g1 = ((-2.0) / 3); + __pyx_v_g1 = ((-2.) / 3.0); break; case 1: - __pyx_v_g2 = ((-2.0) / 3); + __pyx_v_g2 = ((-2.) / 3.0); break; case 2: - __pyx_v_g3 = ((-2.0) / 3); + __pyx_v_g3 = ((-2.) / 3.0); break; } @@ -4781,10 +4745,10 @@ __pyx_L5:; - (__pyx_v_y[0]) = ((((__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3); + (__pyx_v_y[0]) = ((((__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(0 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3.0); - (__pyx_v_y[1]) = ((((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3); + (__pyx_v_y[1]) = ((((__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 0)])))]) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 1)])))])) + (__pyx_v_d->points[(1 + (2 * (__pyx_v_d->vertices[((3 * __pyx_v_itri) + 2)])))])) / 3.0); __pyx_f_5scipy_7spatial_5qhull__barycentric_coordinates(2, (__pyx_v_d->transform + ((__pyx_v_isimplex * 2) * 3)), __pyx_v_y, __pyx_v_c); @@ -4794,21 +4758,21 @@ case 0: - __pyx_v_g1 = ((((2 * (__pyx_v_c[2])) + (__pyx_v_c[1])) - 1) / ((2 - (3 * (__pyx_v_c[2]))) - (3 * (__pyx_v_c[1])))); + __pyx_v_g1 = ((((2.0 * (__pyx_v_c[2])) + (__pyx_v_c[1])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[2]))) - (3.0 * (__pyx_v_c[1])))); break; case 1: - __pyx_v_g2 = ((((2 * (__pyx_v_c[0])) + (__pyx_v_c[2])) - 1) / ((2 - (3 * (__pyx_v_c[0]))) - (3 * (__pyx_v_c[2])))); + __pyx_v_g2 = ((((2.0 * (__pyx_v_c[0])) + (__pyx_v_c[2])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[0]))) - (3.0 * (__pyx_v_c[2])))); break; case 2: - __pyx_v_g3 = ((((2 * (__pyx_v_c[1])) + (__pyx_v_c[0])) - 1) / ((2 - (3 * (__pyx_v_c[1]))) - (3 * (__pyx_v_c[0])))); + __pyx_v_g3 = ((((2.0 * (__pyx_v_c[1])) + (__pyx_v_c[0])) - 1.0) / ((2.0 - (3.0 * (__pyx_v_c[1]))) - (3.0 * (__pyx_v_c[0])))); break; } __pyx_L3_continue:; @@ -4863,10 +4827,10 @@ __pyx_v_b3 = ((__pyx_v_b[2]) - __pyx_v_minval); - __pyx_v_b4 = (3 * __pyx_v_minval); + __pyx_v_b4 = (3.0 * __pyx_v_minval); - __pyx_v_w = __Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b1, 3), 0), __pyx_v_c3000), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b2), 0), __pyx_v_c2100)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b3), 0), __pyx_v_c2010)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b1, 2)) * __pyx_v_b4), 0), __pyx_v_c2001)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b1) * pow(__pyx_v_b2, 2)), 0), __pyx_v_c1200)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6 * __pyx_v_b1) * __pyx_v_b2) * __pyx_v_b4), 0), __pyx_v_c1101)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b1) * pow(__pyx_v_b3, 2)), 0), __pyx_v_c1020)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6 * __pyx_v_b1) * __pyx_v_b3) * __pyx_v_b4), 0), __pyx_v_c1011)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b1) * pow(__pyx_v_b4, 2)), 0), __pyx_v_c1002)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b2, 3), 0), __pyx_v_c0300)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b2, 2)) * __pyx_v_b3), 0), __pyx_v_c0210)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b2, 2)) * __pyx_v_b4), 0), __pyx_v_c0201)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b2) * pow(__pyx_v_b3, 2)), 0), __pyx_v_c0120)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6 * __pyx_v_b2) * __pyx_v_b3) * __pyx_v_b4), 0), __pyx_v_c0111)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b2) * pow(__pyx_v_b4, 2)), 0), __pyx_v_c0102)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b3, 3), 0), __pyx_v_c0030)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * pow(__pyx_v_b3, 2)) * __pyx_v_b4), 0), __pyx_v_c0021)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3 * __pyx_v_b3) * pow(__pyx_v_b4, 2)), 0), __pyx_v_c0012)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b4, 3), 0), __pyx_v_c0003)); + __pyx_v_w = __Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_sum(__Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b1, 3.0), 0), __pyx_v_c3000), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b2), 0), __pyx_v_c2100)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b3), 0), __pyx_v_c2010)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b1, 2.0)) * __pyx_v_b4), 0), __pyx_v_c2001)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b1) * pow(__pyx_v_b2, 2.0)), 0), __pyx_v_c1200)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6.0 * __pyx_v_b1) * __pyx_v_b2) * __pyx_v_b4), 0), __pyx_v_c1101)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b1) * pow(__pyx_v_b3, 2.0)), 0), __pyx_v_c1020)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6.0 * __pyx_v_b1) * __pyx_v_b3) * __pyx_v_b4), 0), __pyx_v_c1011)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b1) * pow(__pyx_v_b4, 2.0)), 0), __pyx_v_c1002)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b2, 3.0), 0), __pyx_v_c0300)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b2, 2.0)) * __pyx_v_b3), 0), __pyx_v_c0210)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b2, 2.0)) * __pyx_v_b4), 0), __pyx_v_c0201)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b2) * pow(__pyx_v_b3, 2.0)), 0), __pyx_v_c0120)), __Pyx_c_prod(__pyx_t_double_complex_from_parts((((6.0 * __pyx_v_b2) * __pyx_v_b3) * __pyx_v_b4), 0), __pyx_v_c0111)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b2) * pow(__pyx_v_b4, 2.0)), 0), __pyx_v_c0102)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b3, 3.0), 0), __pyx_v_c0030)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * pow(__pyx_v_b3, 2.0)) * __pyx_v_b4), 0), __pyx_v_c0021)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(((3.0 * __pyx_v_b3) * pow(__pyx_v_b4, 2.0)), 0), __pyx_v_c0012)), __Pyx_c_prod(__pyx_t_double_complex_from_parts(pow(__pyx_v_b4, 3.0), 0), __pyx_v_c0003)); __pyx_r = __pyx_v_w; @@ -4932,17 +4896,17 @@ case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value); - if (unlikely(value)) { values[3] = value; kw_args--; } + if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tol); - if (unlikely(value)) { values[4] = value; kw_args--; } + if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxiter); - if (unlikely(value)) { values[5] = value; kw_args--; } + if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -4978,6 +4942,7 @@ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator.__init__"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; @@ -5212,10 +5177,9 @@ __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator._evaluate_double"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_xi); __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_eps = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; @@ -5332,7 +5296,7 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); @@ -5524,13 +5488,13 @@ __pyx_L9_continue:; } } + + { int __pyx_why; __pyx_why = 0; goto __pyx_L8; __pyx_L7: __pyx_why = 4; goto __pyx_L8; __pyx_L8:; - - Py_BLOCK_THREADS switch (__pyx_why) { case 4: goto __pyx_L1_error; @@ -5581,8 +5545,6 @@ __Pyx_XDECREF((PyObject *)__pyx_v_points); __Pyx_XDECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF(__pyx_v_eps); - __Pyx_DECREF(__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5744,10 +5706,9 @@ __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator._evaluate_complex"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_xi); __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_eps = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; @@ -5864,7 +5825,7 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); @@ -6107,13 +6068,13 @@ __pyx_L9_continue:; } } + + { int __pyx_why; __pyx_why = 0; goto __pyx_L8; __pyx_L7: __pyx_why = 4; goto __pyx_L8; __pyx_L8:; - - Py_BLOCK_THREADS switch (__pyx_why) { case 4: goto __pyx_L1_error; @@ -6164,8 +6125,6 @@ __Pyx_XDECREF((PyObject *)__pyx_v_points); __Pyx_XDECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF(__pyx_v_eps); - __Pyx_DECREF(__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -6173,8 +6132,8 @@ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; @@ -6199,7 +6158,6 @@ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_endian_detector = 1; @@ -6238,17 +6196,17 @@ if (__pyx_t_3) { - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_17)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_17)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_17)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; @@ -6266,17 +6224,17 @@ if (__pyx_t_2) { - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_18)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_18)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_18)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; @@ -6288,8 +6246,7 @@ __pyx_v_info->ndim = __pyx_v_ndim; - __pyx_t_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); @@ -6399,17 +6356,17 @@ if (__pyx_t_1) { - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_19)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_19)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_19)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; @@ -6535,22 +6492,22 @@ { - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_20), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_20), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; @@ -6574,7 +6531,7 @@ __pyx_v_offset = 0; - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; @@ -6599,18 +6556,16 @@ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); @@ -6632,7 +6587,6 @@ } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } @@ -6645,7 +6599,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6672,7 +6626,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6699,7 +6653,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6726,7 +6680,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6753,7 +6707,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6793,7 +6747,6 @@ int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); @@ -6810,7 +6763,7 @@ if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -6820,9 +6773,9 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -6831,7 +6784,7 @@ if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -6841,40 +6794,40 @@ __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_21)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_21)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_21)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; @@ -6903,29 +6856,29 @@ if (__pyx_t_6) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_19)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_19)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_19)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; @@ -6947,7 +6900,7 @@ if (__pyx_t_6) { - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; @@ -6958,28 +6911,28 @@ if (__pyx_t_6) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_22)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_22)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_22)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -6987,12 +6940,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -7000,12 +6953,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; @@ -7013,12 +6966,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -7026,12 +6979,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; @@ -7039,12 +6992,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -7052,12 +7005,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; @@ -7065,12 +7018,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -7078,12 +7031,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; @@ -7091,12 +7044,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -7104,12 +7057,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; @@ -7117,12 +7070,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; @@ -7130,12 +7083,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; @@ -7143,12 +7096,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7158,12 +7111,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7173,12 +7126,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7188,12 +7141,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -7202,19 +7155,19 @@ { - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_20), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_20), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; @@ -7225,7 +7178,7 @@ { - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; @@ -7251,7 +7204,6 @@ __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7262,8 +7214,6 @@ PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); __pyx_t_1 = (__pyx_v_base == Py_None); @@ -7289,8 +7239,6 @@ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } @@ -7300,7 +7248,6 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); __pyx_t_1 = (__pyx_v_arr->base == NULL); @@ -7325,20 +7272,17 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct PyMethodDef __pyx_methods[] = { +static PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("_ndim_coords_from_arrays"), (PyCFunction)__pyx_pf_8interpnd__ndim_coords_from_arrays, METH_O, __Pyx_DOCSTR(__pyx_doc_8interpnd__ndim_coords_from_arrays)}, {__Pyx_NAMESTR("estimate_gradients_2d_global"), (PyCFunction)__pyx_pf_8interpnd_estimate_gradients_2d_global, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -7400,6 +7344,7 @@ {&__pyx_n_s__ascontiguousarray, __pyx_k__ascontiguousarray, sizeof(__pyx_k__ascontiguousarray), 0, 0, 1, 1}, {&__pyx_n_s__astype, __pyx_k__astype, sizeof(__pyx_k__astype), 0, 0, 1, 1}, {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1}, + {&__pyx_n_s__broadcast_arrays, __pyx_k__broadcast_arrays, sizeof(__pyx_k__broadcast_arrays), 0, 0, 1, 1}, {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1}, {&__pyx_n_s__byteorder, __pyx_k__byteorder, sizeof(__pyx_k__byteorder), 0, 0, 1, 1}, {&__pyx_n_s__complex, __pyx_k__complex, sizeof(__pyx_k__complex), 0, 0, 1, 1}, @@ -7421,7 +7366,6 @@ {&__pyx_n_s__is_complex, __pyx_k__is_complex, sizeof(__pyx_k__is_complex), 0, 0, 1, 1}, {&__pyx_n_s__issubdtype, __pyx_k__issubdtype, sizeof(__pyx_k__issubdtype), 0, 0, 1, 1}, {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1}, - {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1}, {&__pyx_n_s__maxiter, __pyx_k__maxiter, sizeof(__pyx_k__maxiter), 0, 0, 1, 1}, {&__pyx_n_s__names, __pyx_k__names, sizeof(__pyx_k__names), 0, 0, 1, 1}, {&__pyx_n_s__nan, __pyx_k__nan, sizeof(__pyx_k__nan), 0, 0, 1, 1}, @@ -7465,15 +7409,14 @@ __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_Warning = __Pyx_GetName(__pyx_b, __pyx_n_s__Warning); if (!__pyx_builtin_Warning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_map = __Pyx_GetName(__pyx_b, __pyx_n_s__map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -7517,12 +7460,10 @@ } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_interpnd(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif @@ -7555,11 +7496,11 @@ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_ImportModule("scipy.spatial.qhull"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "_get_delaunay_info", (void (**)(void))&__pyx_f_5scipy_7spatial_5qhull__get_delaunay_info, "__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *(PyObject *, int, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7623,7 +7564,7 @@ __pyx_k_1 = __pyx_t_5; __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___init__, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___init__, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -7632,7 +7573,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_init_shape, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_init_shape, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -7641,7 +7582,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_call_shape, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_call_shape, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -7650,7 +7591,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___call__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___call__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -7685,7 +7626,7 @@ __pyx_k_9 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator___init__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -7694,7 +7635,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_double, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -7703,7 +7644,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_complex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); @@ -7730,7 +7671,7 @@ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(9.9999999999999995e-07); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_k_10 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); @@ -7762,14 +7703,14 @@ __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(9.9999999999999995e-07); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_16 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator___init__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -7778,7 +7719,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_double, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -7787,7 +7728,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_complex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -7806,7 +7747,7 @@ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s____init__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); + __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_31), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7816,7 +7757,7 @@ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s___check_init_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); + __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_32), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7826,14 +7767,14 @@ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s____call__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); + __pyx_t_5 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_33), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_34), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7864,15 +7805,14 @@ #endif } -static const char *__pyx_filenames[] = { - "interpnd.pyx", - "numpy.pxd", -}; - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } static void __Pyx_RaiseDoubleKeywordsError( @@ -8025,6 +7965,26 @@ return (double)-1; } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -8430,7 +8390,7 @@ buf->suboffsets = __Pyx_minusones; } -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -8514,6 +8474,10 @@ } +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -8524,67 +8488,25 @@ (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif } -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(index); } } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { @@ -8677,14 +8599,14 @@ #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -8700,23 +8622,15 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - static PyObject *__Pyx_CreateClass( PyObject *bases, PyObject *dict, PyObject *name, const char *modname) { @@ -8852,21 +8766,28 @@ } #endif -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { - const npy_intp neg_one = (npy_intp)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(npy_intp) < sizeof(long)) { +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { + const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(Py_intptr_t) == sizeof(char)) || + (sizeof(Py_intptr_t) == sizeof(short))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_intp) == sizeof(long)) { + } else if ((sizeof(Py_intptr_t) == sizeof(int)) || + (sizeof(Py_intptr_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { + } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); } } @@ -9119,6 +9040,25 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -9366,7 +9306,11 @@ PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -9413,9 +9357,6 @@ void (*fp)(void); void *p; } tmp; -#if PY_VERSION_HEX < 0x03010000 - const char *desc, *s1, *s2; -#endif d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) @@ -9427,7 +9368,16 @@ PyModule_GetName(module), funcname); goto bad; } -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %s.%s has wrong signature (expected %s, got %s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; @@ -9439,15 +9389,7 @@ PyModule_GetName(module), funcname, sig, desc); goto bad; } - tmp.p = PyCObject_AsVoidPtr(cobj); -#else - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %s.%s has wrong signature (expected %s, got %s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); + tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) @@ -9563,8 +9505,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } From scipy-svn at scipy.org Sat Sep 11 15:00:43 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 14:00:43 -0500 (CDT) Subject: [Scipy-svn] r6698 - in trunk/scipy/stats: . tests Message-ID: <20100911190043.52A0139CCC0@scipy.org> Author: warren.weckesser Date: 2010-09-11 14:00:43 -0500 (Sat, 11 Sep 2010) New Revision: 6698 Modified: trunk/scipy/stats/morestats.py trunk/scipy/stats/tests/test_morestats.py Log: BUG: stats.levene() and stats.fligner() raised exceptions in the case center='trimmed' (ticket #1270). Modified: trunk/scipy/stats/morestats.py =================================================================== --- trunk/scipy/stats/morestats.py 2010-09-10 14:27:02 UTC (rev 6697) +++ trunk/scipy/stats/morestats.py 2010-09-11 19:00:43 UTC (rev 6698) @@ -1,5 +1,7 @@ # Author: Travis Oliphant, 2002 # +# Further updates and enhancements by many SciPy developers. +# import math import statlib @@ -833,6 +835,10 @@ center : {'mean', 'median', 'trimmed'}, optional Which function of the data to use in the test. The default is 'median'. + proportiontocut : float, optional + When `center` is 'trimmed', this gives the proportion of data points + to cut from each end. (See `scipy.stats.trim_mean`.) + Default is 0.05. Returns ------- @@ -863,24 +869,35 @@ Statistical Association, 69, 364-367 """ + # Handle keyword arguments. + center = 'median' + proportiontocut = 0.05 + for kw, value in kwds.items(): + if kw not in ['center', 'proportiontocut']: + raise TypeError("levene() got an unexpected keyword argument '%s'" % kw) + if kw == 'center': + center = value + else: + proportiontocut = value + k = len(args) if k < 2: - raise ValueError, "Must enter at least two input sample vectors." + raise ValueError("Must enter at least two input sample vectors.") Ni = zeros(k) Yci = zeros(k,'d') - if 'center' in kwds.keys(): - center = kwds['center'] - else: - center = 'median' + if not center in ['mean','median','trimmed']: - raise ValueError, "Keyword argument

must be 'mean', 'median'"\ - + "or 'trimmed'." + raise ValueError("Keyword argument
must be 'mean', 'median'" + + "or 'trimmed'.") + if center == 'median': func = lambda x: np.median(x, axis=0) elif center == 'mean': func = lambda x: np.mean(x, axis=0) - else: - func = stats.trim_mean + else: # center == 'trimmed' + args = tuple(stats.trimboth(arg, proportiontocut) for arg in args) + func = lambda x: np.mean(x, axis=0) + for j in range(k): Ni[j] = len(args[j]) Yci[j] = func(args[j]) @@ -997,6 +1014,10 @@ keyword argument controlling which function of the data is used in computing the test statistic. The default is 'median'. + proportiontocut : float, optional + When `center` is 'trimmed', this gives the proportion of data points + to cut from each end. (See `scipy.stats.trim_mean`.) + Default is 0.05. Returns ------- @@ -1021,22 +1042,32 @@ 71(353), 210-213. """ + # Handle keyword arguments. + center = 'median' + proportiontocut = 0.05 + for kw, value in kwds.items(): + if kw not in ['center', 'proportiontocut']: + raise TypeError("fligner() got an unexpected keyword argument '%s'" % kw) + if kw == 'center': + center = value + else: + proportiontocut = value + k = len(args) if k < 2: - raise ValueError, "Must enter at least two input sample vectors." - if 'center' in kwds.keys(): - center = kwds['center'] - else: - center = 'median' + raise ValueError("Must enter at least two input sample vectors.") + if not center in ['mean','median','trimmed']: - raise ValueError, "Keyword argument
must be 'mean', 'median'"\ - + "or 'trimmed'." + raise ValueError("Keyword argument
must be 'mean', 'median'" + + "or 'trimmed'.") + if center == 'median': func = lambda x: np.median(x, axis=0) elif center == 'mean': func = lambda x: np.mean(x, axis=0) - else: - func = stats.trim_mean + else: # center == 'trimmed' + args = tuple(stats.trimboth(arg, proportiontocut) for arg in args) + func = lambda x: np.mean(x, axis=0) Ni = asarray([len(args[j]) for j in range(k)]) Yci = asarray([func(args[j]) for j in range(k)]) @@ -1048,16 +1079,15 @@ for i in range(k): allZij.extend(list(Zij[i])) g.append(len(allZij)) + + ranks = stats.rankdata(allZij) + a = distributions.norm.ppf(ranks/(2*(Ntot+1.0)) + 0.5) - a = distributions.norm.ppf(stats.rankdata(allZij)/(2*(Ntot+1.0)) + 0.5) - # compute Aibar Aibar = _apply_func(a,g,sum) / Ni anbar = np.mean(a, axis=0) varsq = np.var(a,axis=0, ddof=1) - Xsq = sum(Ni*(asarray(Aibar)-anbar)**2.0,axis=0)/varsq - pval = distributions.chi2.sf(Xsq,k-1) # 1 - cdf return Xsq, pval @@ -1158,7 +1188,6 @@ return F, pval - def wilcoxon(x,y=None): """ Calculate the Wilcoxon signed-rank test Modified: trunk/scipy/stats/tests/test_morestats.py =================================================================== --- trunk/scipy/stats/tests/test_morestats.py 2010-09-10 14:27:02 UTC (rev 6697) +++ trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:00:43 UTC (rev 6698) @@ -1,15 +1,18 @@ # Author: Travis Oliphant, 2002 # +# Further enhancements and tests added by numerous SciPy developers. +# from numpy.testing import TestCase, run_module_suite, assert_array_equal, \ - assert_almost_equal, assert_array_less, assert_array_almost_equal + assert_almost_equal, assert_array_less, assert_array_almost_equal, \ + assert_raises - import scipy.stats as stats import numpy as np from numpy.random import RandomState + g1 = [1.006, 0.996, 0.998, 1.000, 0.992, 0.993, 1.002, 0.999, 0.994, 1.000] g2 = [0.998, 1.006, 1.000, 1.002, 0.997, 0.998, 0.996, 1.000, 1.006, 0.988] g3 = [0.991, 0.987, 0.997, 0.999, 0.995, 0.994, 1.000, 0.999, 0.996, 0.996] @@ -79,22 +82,53 @@ class TestBartlett(TestCase): def test_data(self): - args = [] - for k in range(1,11): - args.append(eval('g%d'%k)) + args = [g1, g2, g3, g4, g5, g6, g7, g8, g9, g10] T, pval = stats.bartlett(*args) assert_almost_equal(T,20.78587342806484,7) assert_almost_equal(pval,0.0136358632781,7) class TestLevene(TestCase): + def test_data(self): - args = [] - for k in range(1,11): - args.append(eval('g%d'%k)) + args = [g1, g2, g3, g4, g5, g6, g7, g8, g9, g10] W, pval = stats.levene(*args) assert_almost_equal(W,1.7059176930008939,7) assert_almost_equal(pval,0.0990829755522,7) + def test_trimmed1(self): + """Test that center='trimmed' gives the same result as center='mean' when proportiontocut=0.""" + W1, pval1 = stats.levene(g1, g2, g3, center='mean') + W2, pval2 = stats.levene(g1, g2, g3, center='trimmed', proportiontocut=0.0) + assert_almost_equal(W1, W2) + assert_almost_equal(pval1, pval2) + + def test_trimmed2(self): + x = [1.2, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 100.0] + y = [0.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 200.0] + # Use center='trimmed' + W1, pval1 = stats.levene(x, y, center='trimmed', proportiontocut=0.125) + # Trim the data here, and use center='mean' + W2, pval2 = stats.levene(x[1:-1], y[1:-1], center='mean') + # Result should be the same. + assert_almost_equal(W1, W2) + assert_almost_equal(pval1, pval2) + + def test_equal_mean_median(self): + x = np.linspace(-1,1,21) + y = x**3 + W1, pval1 = stats.levene(x, y, center='mean') + W2, pval2 = stats.levene(x, y, center='median') + assert_almost_equal(W1, W2) + assert_almost_equal(pval1, pval2) + + def test_bad_keywod(self): + x = np.linspace(-1,1,21) + assert_raises(TypeError, stats.levene, x, x, portiontocut=0.1) + + def test_bad_center_value(self): + x = np.linspace(-1,1,21) + assert_raises(ValueError, stats.levene, x, x, center='trim') + class TestBinomP(TestCase): def test_data(self): pval = stats.binom_test(100,250) @@ -111,15 +145,58 @@ assert_array_equal(res,[1,2,3,4]) assert_array_equal(nums,[3,3,2,2]) -def test_fligner(): - #numbers from R: fligner.test in package stats - x1=np.arange(5) - assert_array_almost_equal(stats.fligner(x1,x1**2), - (3.2282229927203536, 0.072379187848207877), 11) +class TestFligner(TestCase): + + def test_data(self): + # numbers from R: fligner.test in package stats + x1 = np.arange(5) + assert_array_almost_equal(stats.fligner(x1,x1**2), + (3.2282229927203536, 0.072379187848207877), 11) + + def test_trimmed1(self): + """Test that center='trimmed' gives the same result as center='mean' when proportiontocut=0.""" + Xsq1, pval1 = stats.fligner(g1, g2, g3, center='mean') + Xsq2, pval2 = stats.fligner(g1, g2, g3, center='trimmed', proportiontocut=0.0) + assert_almost_equal(Xsq1, Xsq2) + assert_almost_equal(pval1, pval2) + + def test_trimmed2(self): + x = [1.2, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 100.0] + y = [0.0, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 200.0] + # Use center='trimmed' + Xsq1, pval1 = stats.fligner(x, y, center='trimmed', proportiontocut=0.125) + # Trim the data here, and use center='mean' + Xsq2, pval2 = stats.fligner(x[1:-1], y[1:-1], center='mean') + # Result should be the same. + assert_almost_equal(Xsq1, Xsq2) + assert_almost_equal(pval1, pval2) + + # The following test looks reasonable at first, but fligner() uses the + # function stats.rankdata(), and in one of the cases in this test, + # there are ties, while in the other (because of normal rounding + # errors) there are not. This difference leads to differences in the + # third significant digit of W. + # + #def test_equal_mean_median(self): + # x = np.linspace(-1,1,21) + # y = x**3 + # W1, pval1 = stats.fligner(x, y, center='mean') + # W2, pval2 = stats.fligner(x, y, center='median') + # assert_almost_equal(W1, W2) + # assert_almost_equal(pval1, pval2) + + def test_bad_keywod(self): + x = np.linspace(-1,1,21) + assert_raises(TypeError, stats.fligner, x, x, portiontocut=0.1) + + def test_bad_center_value(self): + x = np.linspace(-1,1,21) + assert_raises(ValueError, stats.levene, x, x, center='trim') + def test_mood(): - #numbers from R: mood.test in package stats - x1=np.arange(5) + # numbers from R: mood.test in package stats + x1 = np.arange(5) assert_array_almost_equal(stats.mood(x1,x1**2), (-1.3830857299399906, 0.16663858066771478), 11) From scipy-svn at scipy.org Sat Sep 11 15:08:46 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 14:08:46 -0500 (CDT) Subject: [Scipy-svn] r6699 - trunk/scipy/stats/tests Message-ID: <20100911190846.0B6E839CCC0@scipy.org> Author: warren.weckesser Date: 2010-09-11 14:08:45 -0500 (Sat, 11 Sep 2010) New Revision: 6699 Modified: trunk/scipy/stats/tests/test_morestats.py Log: TST/BUG: Test called the wrong function. Modified: trunk/scipy/stats/tests/test_morestats.py =================================================================== --- trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:00:43 UTC (rev 6698) +++ trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:08:45 UTC (rev 6699) @@ -192,7 +192,7 @@ def test_bad_center_value(self): x = np.linspace(-1,1,21) - assert_raises(ValueError, stats.levene, x, x, center='trim') + assert_raises(ValueError, stats.fligner, x, x, center='trim') def test_mood(): # numbers from R: mood.test in package stats From scipy-svn at scipy.org Sat Sep 11 15:20:41 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 14:20:41 -0500 (CDT) Subject: [Scipy-svn] r6700 - trunk/scipy/stats/tests Message-ID: <20100911192041.924D239CCC0@scipy.org> Author: warren.weckesser Date: 2010-09-11 14:20:41 -0500 (Sat, 11 Sep 2010) New Revision: 6700 Modified: trunk/scipy/stats/tests/test_morestats.py Log: TST: Fix typo in test function names. Modified: trunk/scipy/stats/tests/test_morestats.py =================================================================== --- trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:08:45 UTC (rev 6699) +++ trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:20:41 UTC (rev 6700) @@ -121,7 +121,7 @@ assert_almost_equal(W1, W2) assert_almost_equal(pval1, pval2) - def test_bad_keywod(self): + def test_bad_keyword(self): x = np.linspace(-1,1,21) assert_raises(TypeError, stats.levene, x, x, portiontocut=0.1) @@ -186,7 +186,7 @@ # assert_almost_equal(W1, W2) # assert_almost_equal(pval1, pval2) - def test_bad_keywod(self): + def test_bad_keyword(self): x = np.linspace(-1,1,21) assert_raises(TypeError, stats.fligner, x, x, portiontocut=0.1) From scipy-svn at scipy.org Sat Sep 11 19:16:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 18:16:47 -0500 (CDT) Subject: [Scipy-svn] r6701 - in trunk/scipy/stats: . tests Message-ID: <20100911231647.711CA39CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-11 18:16:47 -0500 (Sat, 11 Sep 2010) New Revision: 6701 Modified: trunk/scipy/stats/morestats.py trunk/scipy/stats/tests/test_morestats.py Log: ENH: stats.morestats: updated 'raise' statements, tweaked code a bit, added tests that incorrect arguments raise the expected exceptions. Modified: trunk/scipy/stats/morestats.py =================================================================== --- trunk/scipy/stats/morestats.py 2010-09-11 19:20:41 UTC (rev 6700) +++ trunk/scipy/stats/morestats.py 2010-09-11 23:16:47 UTC (rev 6701) @@ -157,7 +157,7 @@ x = ravel(data) n = len(x) if (n < 2): - raise ValueError, "Need at least 2 data-points." + raise ValueError("Need at least 2 data-points.") xbar = x.mean() C = x.var() if (n > 1000): # gaussian approximations for large n @@ -206,8 +206,8 @@ The nth k-statistic is the unique symmetric unbiased estimator of the nth cumulant kappa_n """ - if n>4 or n<1: - raise ValueError, "k-statistics only supported for 1<=n<=4" + if n > 4 or n < 1: + raise ValueError("k-statistics only supported for 1<=n<=4") n = int(n) S = zeros(n+1,'d') data = ravel(data) @@ -225,21 +225,21 @@ 4*N*(N+1)*S[1]*S[3] + N*N*(N+1)*S[4]) / \ (N*(N-1.0)*(N-2.0)*(N-3.0)) else: - raise ValueError, "Should not be here." + raise ValueError("Should not be here.") def kstatvar(data,n=2): """Returns an unbiased estimator of the variance of the k-statistic: n=1 or 2 """ data = ravel(data) N = len(data) - if n==1: + if n == 1: return kstat(data,n=2)*1.0/N - elif n==2: + elif n == 2: k2 = kstat(data,n=2) k4 = kstat(data,n=4) return (2*k2*k2*N + (N-1)*k4)/(N*(N+1)) else: - raise ValueError, "Only n=1 or n=2 supported." + raise ValueError("Only n=1 or n=2 supported.") #__all__ = ['probplot','ppcc_max','ppcc_plot','boxcox','boxcox_llf', @@ -262,9 +262,9 @@ i = arange(2,N) Ui[1:-1] = (i-0.3175)/(N+0.365) try: - ppf_func = eval('distributions.%s.ppf'%dist) + ppf_func = eval('distributions.%s.ppf' % dist) except AttributeError: - raise dist, "is not a valid distribution with a ppf." + raise ValueError("%s is not a valid distribution with a ppf." % dist) if sparams is None: sparams = () if isscalar(sparams): @@ -312,7 +312,7 @@ try: ppf_func = eval('distributions.%s.ppf'%dist) except AttributeError: - raise dist, "is not a valid distribution with a ppf." + raise ValueError("%s is not a valid distribution with a ppf." % dist) """ res = inspect.getargspec(ppf_func) if not ('loc' == res[0][-2] and 'scale' == res[0][-1] and \ @@ -386,18 +386,18 @@ while (rootfunc(newlm,x,target) > 0.0) and (N < 500): newlm += 0.1 N +=1 - if (N==500): - raise RuntimeError, "Could not find endpoint." + if N == 500: + raise RuntimeError("Could not find endpoint.") lmplus = optimize.brentq(rootfunc,lmax,newlm,args=(x,target)) newlm = lmax-0.5 N = 0 while (rootfunc(newlm,x,target) > 0.0) and (N < 500): newlm += 0.1 N +=1 - if (N==500): - raise RuntimeError, "Could not find endpoint." - lmminus = optimize.brentq(rootfunc,newlm,lmax,args=(x,target)) - return lmminus,lmplus + if N == 500: + raise RuntimeError("Could not find endpoint.") + lmminus = optimize.brentq(rootfunc, newlm, lmax, args=(x,target)) + return lmminus, lmplus def boxcox(x,lmbda=None,alpha=None): """Return a positive dataset tranformed by a Box-Cox power transformation. @@ -411,7 +411,7 @@ lambda as the third output argument. """ if any(x < 0): - raise ValueError, "Data must be positive." + raise ValueError("Data must be positive.") if lmbda is not None: # single transformation lmbda = lmbda*(x==x) y = where(lmbda == 0, log(x), (x**lmbda - 1)/lmbda) @@ -506,7 +506,7 @@ """ N = len(x) if N < 3: - raise ValueError, "Data must be at least length 3." + raise ValueError("Data must be at least length 3.") if a is None: a = zeros(N,'f') init = 0 @@ -603,7 +603,8 @@ """ if not dist in ['norm','expon','gumbel','extreme1','logistic']: - raise ValueError, "Invalid distribution." + raise ValueError("Invalid distribution; dist must be 'norm', " + "'expon', 'gumbel', 'extreme1' or 'logistic'.") y = sort(x) xbar = np.mean(x, axis=0) N = len(y) @@ -632,7 +633,7 @@ z = distributions.logistic.cdf(w) sig = array([25,10,5,2.5,1,0.5]) critical = around(_Avals_logistic / (1.0+0.25/N),3) - elif (dist == 'gumbel') or (dist == 'extreme1'): + else: # (dist == 'gumbel') or (dist == 'extreme1'): #the following is incorrect, see ticket:1097 ## def fixedsolve(th,xj,N): ## val = stats.sum(xj)*1.0/N @@ -647,9 +648,7 @@ z = distributions.gumbel_l.cdf(w) sig = array([25,10,5,2.5,1]) critical = around(_Avals_gumbel / (1.0 + 0.2/sqrt(N)),3) - else: - raise ValueError("dist has to be one of 'norm','expon','logistic'", - "'gumbel','extreme1'") + i = arange(1,N+1) S = sum((2*i-1.0)/N*(log(z)+log(1-z[::-1])),axis=0) A2 = -N-S @@ -722,10 +721,10 @@ x,y = asarray(x),asarray(y) n = len(x) m = len(y) - if (m < 1): - raise ValueError, "Not enough other observations." - if (n < 1): - raise ValueError, "Not enough test observations." + if m < 1: + raise ValueError("Not enough other observations.") + if n < 1: + raise ValueError("Not enough test observations.") N = m+n xy = r_[x,y] # combine rank = stats.rankdata(xy) @@ -804,7 +803,7 @@ """ k = len(args) if k < 2: - raise ValueError, "Must enter at least two input sample vectors." + raise ValueError("Must enter at least two input sample vectors.") Ni = zeros(k) ssq = zeros(k,'d') for j in range(k): @@ -966,13 +965,13 @@ elif len(x) == 1: x = x[0] if n is None or n < x: - raise ValueError, "n must be >= x" + raise ValueError("n must be >= x") n = np.int_(n) else: - raise ValueError, "Incorrect length for x." + raise ValueError("Incorrect length for x.") if (p > 1.0) or (p < 0.0): - raise ValueError, "p must be in range [0,1]" + raise ValueError("p must be in range [0,1]") d = distributions.binom.pmf(x,n,p) rerr = 1+1e-7 @@ -1128,8 +1127,8 @@ m = len(y) xy = r_[x,y] N = m+n - if (N < 3): - raise ValueError, "Not enough observations." + if N < 3: + raise ValueError("Not enough observations.") ranks = stats.rankdata(xy) Ri = ranks[:n] M = sum((Ri - (N+1.0)/2)**2,axis=0) @@ -1162,7 +1161,7 @@ """ k = len(args) if k < 2: - raise ValueError, "Must enter at least two input sample vectors." + raise ValueError("Must enter at least two input sample vectors.") if 'equal_var' in kwds.keys(): if kwds['equal_var']: evar = 1 else: evar = 0 @@ -1229,7 +1228,7 @@ else: x, y = map(asarray, (x, y)) if len(x) <> len(y): - raise ValueError, 'Unequal N in wilcoxon. Aborting.' + raise ValueError('Unequal N in wilcoxon. Aborting.') d = x-y d = compress(not_equal(d,0),d,axis=-1) # Keep all non-zero differences count = len(d) @@ -1275,8 +1274,8 @@ """ N = len(cnt) if N < 2: - raise ValueError, "At least two moments must be given to" + \ - "approximate the pdf." + raise ValueError("At least two moments must be given to " + + "approximate the pdf.") totp = poly1d(1) sig = sqrt(cnt[1]) mu = cnt[0] Modified: trunk/scipy/stats/tests/test_morestats.py =================================================================== --- trunk/scipy/stats/tests/test_morestats.py 2010-09-11 19:20:41 UTC (rev 6700) +++ trunk/scipy/stats/tests/test_morestats.py 2010-09-11 23:16:47 UTC (rev 6701) @@ -24,6 +24,7 @@ g9 = [1.002, 0.998, 0.996, 0.995, 0.996, 1.004, 1.004, 0.998, 0.999, 0.991] g10= [0.991, 0.995, 0.984, 0.994, 0.997, 0.997, 0.991, 0.998, 1.004, 0.997] + class TestShapiro(TestCase): def test_basic(self): x1 = [0.11,7.87,4.61,10.14,7.95,3.14,0.46, @@ -39,6 +40,12 @@ assert_almost_equal(w,0.9590270,6) assert_almost_equal(pw,0.52460,3) + def test_bad_arg(self): + # Length of x is less than 3. + x = [1] + assert_raises(ValueError, stats.shapiro, x) + + class TestAnderson(TestCase): def test_normal(self): rs = RandomState(1234567890) @@ -58,7 +65,12 @@ A,crit,sig = stats.anderson(x2,'expon') assert_array_less(crit[:-1], A) + def test_bad_arg(self): + assert_raises(ValueError, stats.anderson, [1], dist='plate_of_shrimp') + + class TestAnsari(TestCase): + def test_small(self): x = [1,2,3,3,4] y = [3,2,6,1,6,1,4,1] @@ -80,13 +92,24 @@ assert_almost_equal(W,10.0,11) assert_almost_equal(pval,0.533333333333333333,7) + def test_bad_arg(self): + assert_raises(ValueError, stats.ansari, [], [1]) + assert_raises(ValueError, stats.ansari, [1], []) + + class TestBartlett(TestCase): + def test_data(self): args = [g1, g2, g3, g4, g5, g6, g7, g8, g9, g10] T, pval = stats.bartlett(*args) assert_almost_equal(T,20.78587342806484,7) assert_almost_equal(pval,0.0136358632781,7) + def test_bad_arg(self): + """Too few args raises ValueError.""" + assert_raises(ValueError, stats.bartlett, [1]) + + class TestLevene(TestCase): def test_data(self): @@ -127,9 +150,14 @@ def test_bad_center_value(self): x = np.linspace(-1,1,21) - assert_raises(ValueError, stats.levene, x, x, center='trim') + assert_raises(ValueError, stats.levene, x, x, center='trim') + + def test_too_few_args(self): + assert_raises(ValueError, stats.levene, [1]) + class TestBinomP(TestCase): + def test_data(self): pval = stats.binom_test(100,250) assert_almost_equal(pval,0.0018833009350757682,11) @@ -138,6 +166,21 @@ pval = stats.binom_test([682,243],p=3.0/4) assert_almost_equal(pval,0.38249155957481695,11) + def test_bad_len_x(self): + """Length of x must be 1 or 2.""" + assert_raises(ValueError, stats.binom_test, [1,2,3]) + + def test_bad_n(self): + """len(x) is 1, but n is invalid.""" + # Missing n + assert_raises(ValueError, stats.binom_test, [100]) + # n less than x[0] + assert_raises(ValueError, stats.binom_test, [100], n=50) + + def test_bad_p(self): + assert_raises(ValueError, stats.binom_test, [50, 50], p=2.0) + + class TestFindRepeats(TestCase): def test_basic(self): a = [1,2,3,4,1,2,3,4,1,2,5] @@ -194,11 +237,60 @@ x = np.linspace(-1,1,21) assert_raises(ValueError, stats.fligner, x, x, center='trim') + def test_bad_num_args(self): + """Too few args raises ValueError.""" + assert_raises(ValueError, stats.fligner, [1]) + + def test_mood(): # numbers from R: mood.test in package stats x1 = np.arange(5) assert_array_almost_equal(stats.mood(x1,x1**2), (-1.3830857299399906, 0.16663858066771478), 11) +def test_mood_bad_arg(): + """Raise ValueError when the sum of the lengths of the args is less than 3.""" + assert_raises(ValueError, stats.mood, [1], []) + +def test_oneway_bad_arg(): + """Raise ValueError is fewer than two args are given.""" + assert_raises(ValueError, stats.oneway, [1]) + +def test_wilcoxon_bad_arg(): + """Raise ValueError when two args of different lengths are given.""" + assert_raises(ValueError, stats.wilcoxon, [1], [1,2]) + +def test_mvsdist_bad_arg(): + """Raise ValueError if fewer than two data points are given.""" + data = [1] + assert_raises(ValueError, stats.mvsdist, data) + +def test_kstat_bad_arg(): + """Raise ValueError if n > 4 or n > 1.""" + data = [1] + n = 10 + assert_raises(ValueError, stats.kstat, data, n=n) + +def test_kstatvar_bad_arg(): + """Raise ValueError is n is not 1 or 2.""" + data = [1] + n = 10 + assert_raises(ValueError, stats.kstatvar, data, n=n) + +def test_probplot_bad_arg(): + """Raise ValueError when given an invalid distribution.""" + data = [1] + assert_raises(ValueError, stats.probplot, data, dist="plate_of_shrimp") + +def test_ppcc_max_bad_arg(): + """Raise ValueError when given an invalid distribution.""" + data = [1] + assert_raises(ValueError, stats.ppcc_max, data, dist="plate_of_shrimp") + +def test_boxcox_bad_arg(): + """Raise ValueError if any data value is negative.""" + x = np.array([-1]) + assert_raises(ValueError, stats.boxcox, x) + if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Sat Sep 11 20:14:09 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:14:09 -0500 (CDT) Subject: [Scipy-svn] r6702 - trunk/scipy/stats Message-ID: <20100912001409.74C7139CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-11 19:14:09 -0500 (Sat, 11 Sep 2010) New Revision: 6702 Modified: trunk/scipy/stats/distributions.py Log: BUG: stats.distributions: loggamma_gen was missing the argument shapes='c' (ticket #1261). Modified: trunk/scipy/stats/distributions.py =================================================================== --- trunk/scipy/stats/distributions.py 2010-09-11 23:16:47 UTC (rev 6701) +++ trunk/scipy/stats/distributions.py 2010-09-12 00:14:09 UTC (rev 6702) @@ -3452,7 +3452,7 @@ def _munp(self,n,*args): # use generic moment calculation using ppf return self._mom0_sc(n,*args) -loggamma = loggamma_gen(name='loggamma', longname="A log gamma", +loggamma = loggamma_gen(name='loggamma', longname="A log gamma", shapes='c', extradoc=""" Log gamma distribution From scipy-svn at scipy.org Sat Sep 11 20:45:19 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:45:19 -0500 (CDT) Subject: [Scipy-svn] r6703 - trunk Message-ID: <20100912004519.CB4F439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:45:19 -0500 (Sat, 11 Sep 2010) New Revision: 6703 Modified: trunk/setup.py Log: 3K: make top setup py3k compatible. Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2010-09-12 00:14:09 UTC (rev 6702) +++ trunk/setup.py 2010-09-12 00:45:19 UTC (rev 6703) @@ -147,7 +147,7 @@ url = "http://www.scipy.org", download_url = "http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531", license = 'BSD', - classifiers=[f for f in CLASSIFIERS.split('\n') if f], + classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f], platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], configuration=configuration ) finally: From scipy-svn at scipy.org Sat Sep 11 20:46:10 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:46:10 -0500 (CDT) Subject: [Scipy-svn] r6704 - trunk/scipy/cluster/src Message-ID: <20100912004610.715C239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:46:10 -0500 (Sat, 11 Sep 2010) New Revision: 6704 Modified: trunk/scipy/cluster/src/hierarchy_wrap.c trunk/scipy/cluster/src/vq_module.c Log: 3K: add py3k compatible module init for cluster. Modified: trunk/scipy/cluster/src/hierarchy_wrap.c =================================================================== --- trunk/scipy/cluster/src/hierarchy_wrap.c 2010-09-12 00:45:19 UTC (rev 6703) +++ trunk/scipy/cluster/src/hierarchy_wrap.c 2010-09-12 00:46:10 UTC (rev 6704) @@ -373,7 +373,31 @@ {NULL, NULL} /* Sentinel - marks the end of this structure */ }; +#if defined(SCIPY_PY3K) +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_vq", + NULL, + -1, + _hierarchyWrapMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__hierarchy_wrap(void) +{ + PyObject *m; + + m = PyModule_Create(&moduledef); + import_array(); + + return m; +} +#else PyMODINIT_FUNC init_hierarchy_wrap(void) { (void) Py_InitModule("_hierarchy_wrap", _hierarchyWrapMethods); import_array(); // Must be present for NumPy. Called first after above line. } +#endif Modified: trunk/scipy/cluster/src/vq_module.c =================================================================== --- trunk/scipy/cluster/src/vq_module.c 2010-09-12 00:45:19 UTC (rev 6703) +++ trunk/scipy/cluster/src/vq_module.c 2010-09-12 00:46:10 UTC (rev 6704) @@ -15,11 +15,35 @@ {NULL, NULL, 0, NULL} }; +#if defined(SCIPY_PY3K) +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_vq", + NULL, + -1, + vqmethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__vq(void) +{ + PyObject *m; + + m = PyModule_Create(&moduledef); + import_array(); + + return m; +} +#else PyMODINIT_FUNC init_vq(void) { Py_InitModule("_vq", vqmethods); import_array(); } +#endif PyObject* compute_vq(PyObject* self, PyObject* args) { From scipy-svn at scipy.org Sat Sep 11 20:46:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:46:23 -0500 (CDT) Subject: [Scipy-svn] r6705 - in trunk: . tools Message-ID: <20100912004623.CF86239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:46:23 -0500 (Sat, 11 Sep 2010) New Revision: 6705 Added: trunk/tools/py3tool.py Modified: trunk/setup.py Log: 3K: copy py3tool from numpy into scipy. Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2010-09-12 00:46:10 UTC (rev 6704) +++ trunk/setup.py 2010-09-12 00:46:23 UTC (rev 6705) @@ -129,10 +129,27 @@ old_path = os.getcwd() local_path = os.path.dirname(os.path.abspath(sys.argv[0])) + src_path = local_path + if sys.version_info[0] == 3: + src_path = os.path.join(local_path, 'build', 'py3k') + sys.path.insert(0, os.path.join(local_path, 'tools')) + import py3tool + print("Converting to Python3 via 2to3...") + py3tool.sync_2to3('scipy', os.path.join(src_path, 'scipy')) + + site_cfg = os.path.join(local_path, 'site.cfg') + if os.path.isfile(site_cfg): + shutil.copy(site_cfg, src_path) + os.chdir(local_path) sys.path.insert(0,local_path) sys.path.insert(0,os.path.join(local_path,'scipy')) # to retrive version + # Run build + old_path = os.getcwd() + os.chdir(src_path) + sys.path.insert(0, src_path) + # Rewrite the version file everytime if os.path.exists('scipy/version.py'): os.remove('scipy/version.py') write_version_py() Added: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py (rev 0) +++ trunk/tools/py3tool.py 2010-09-12 00:46:23 UTC (rev 6705) @@ -0,0 +1,269 @@ +#!/usr/bin/env python3 +# -*- python -*- +""" +%prog SUBMODULE... + +Hack to pipe submodules of Numpy through 2to3 and build them in-place +one-by-one. + +Example usage: + + python3 tools/py3tool.py testing distutils core + +This will copy files to _py3k/numpy, add a dummy __init__.py and +version.py on the top level, and copy and 2to3 the files of the three +submodules. + +When running py3tool again, only changed files are re-processed, which +makes the test-bugfix cycle faster. + +""" +from optparse import OptionParser +import shutil +import os +import sys +import re +import subprocess +import fnmatch + +BASE = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) +TEMP = os.path.normpath(os.path.join(BASE, '_py3k')) + +SCRIPT_2TO3 = os.path.join(BASE, 'tools', '2to3.py') + +EXTRA_2TO3_FLAGS = { + '*/setup.py': '-x import', + #'numpy/core/code_generators/generate_umath.py': '-x import', + #'numpy/core/code_generators/generate_numpy_api.py': '-x import', + #'numpy/core/code_generators/generate_ufunc_api.py': '-x import', + #'numpy/core/defchararray.py': '-x unicode', + #'numpy/compat/py3k.py': '-x unicode', + #'numpy/ma/timer_comparison.py': 'skip', + #'numpy/distutils/system_info.py': '-x reduce', + #'numpy/f2py/auxfuncs.py': '-x reduce', + #'numpy/lib/arrayterator.py': '-x reduce', + #'numpy/lib/tests/test_arrayterator.py': '-x reduce', + #'numpy/ma/core.py': '-x reduce', + #'numpy/ma/tests/test_core.py': '-x reduce', + #'numpy/ma/tests/test_old_ma.py': '-x reduce', + #'numpy/ma/timer_comparison.py': '-x reduce', + #'numpy/oldnumeric/ma.py': '-x reduce', +} + +def main(): + p = OptionParser(usage=__doc__.strip()) + p.add_option("--clean", "-c", action="store_true", + help="clean source directory") + options, args = p.parse_args() + + if not args: + p.error('no submodules given') + else: + dirs = ['scipy/%s' % x for x in map(os.path.basename, args)] + + # Prepare + if not os.path.isdir(TEMP): + os.makedirs(TEMP) + + # Set up dummy files (for building only submodules) + dummy_files = { + '__init__.py': 'from scipy.version import version as __version__', + 'version.py': 'version = "0.8.0.dev"' + } + + for fn, content in dummy_files.items(): + fn = os.path.join(TEMP, 'scipy', fn) + if not os.path.isfile(fn): + try: + os.makedirs(os.path.dirname(fn)) + except OSError: + pass + f = open(fn, 'wb+') + f.write(content.encode('ascii')) + f.close() + + # Environment + pp = [os.path.abspath(TEMP)] + def getenv(): + env = dict(os.environ) + env.update({'PYTHONPATH': ':'.join(pp)}) + return env + + # Copy + for d in dirs: + src = os.path.join(BASE, d) + dst = os.path.join(TEMP, d) + + # Run 2to3 + sync_2to3(dst=dst, + src=src, + patchfile=os.path.join(TEMP, os.path.basename(d) + '.patch'), + clean=options.clean) + + # Run setup.py, falling back to Pdb post-mortem on exceptions + setup_py = os.path.join(dst, 'setup.py') + if os.path.isfile(setup_py): + code = """\ +import pdb, sys, traceback +p = pdb.Pdb() +try: + import __main__ + __main__.__dict__.update({ + "__name__": "__main__", "__file__": "setup.py", + "__builtins__": __builtins__}) + fp = open("setup.py", "rb") + try: + exec(compile(fp.read(), "setup.py", 'exec')) + finally: + fp.close() +except SystemExit: + raise +except: + traceback.print_exc() + t = sys.exc_info()[2] + p.interaction(None, t) +""" + ret = subprocess.call([sys.executable, '-c', code, + 'build_ext', '-i'], + cwd=dst, + env=getenv()) + if ret != 0: + raise RuntimeError("Build failed.") + + # Run nosetests + subprocess.call(['nosetests3', '-v', d], cwd=TEMP) + +def custom_mangling(filename): + import_mangling = [ + os.path.join('cluster', '__init__.py'), + os.path.join('cluster', 'hierarchy.py'), + os.path.join('cluster', 'vq.py'), + ] + + if any(filename.endswith(x) for x in import_mangling): + f = open(filename, 'r') + text = f.read() + f.close() + for mod in ['_vq', '_hierarchy_wrap']: + text = re.sub(r'^(\s*)import %s' % mod, + r'\1from . import %s' % mod, + text, flags=re.M) + text = re.sub(r'^(\s*)from %s import' % mod, + r'\1from .%s import' % mod, + text, flags=re.M) + #text = text.replace('from matrixlib', 'from .matrixlib') + f = open(filename, 'w') + f.write(text) + f.close() + +def walk_sync(dir1, dir2, _seen=None): + if _seen is None: + seen = {} + else: + seen = _seen + + if not dir1.endswith(os.path.sep): + dir1 = dir1 + os.path.sep + + # Walk through stuff (which we haven't yet gone through) in dir1 + for root, dirs, files in os.walk(dir1): + sub = root[len(dir1):] + if sub in seen: + dirs = [x for x in dirs if x not in seen[sub][0]] + files = [x for x in files if x not in seen[sub][1]] + seen[sub][0].extend(dirs) + seen[sub][1].extend(files) + else: + seen[sub] = (dirs, files) + if not dirs and not files: + continue + yield os.path.join(dir1, sub), os.path.join(dir2, sub), dirs, files + + if _seen is None: + # Walk through stuff (which we haven't yet gone through) in dir2 + for root2, root1, dirs, files in walk_sync(dir2, dir1, _seen=seen): + yield root1, root2, dirs, files + +def sync_2to3(src, dst, patchfile=None, clean=False): + import lib2to3.main + from io import StringIO + + to_convert = [] + + for src_dir, dst_dir, dirs, files in walk_sync(src, dst): + for fn in dirs + files: + src_fn = os.path.join(src_dir, fn) + dst_fn = os.path.join(dst_dir, fn) + + # skip temporary etc. files + if fn.startswith('.#') or fn.endswith('~'): + continue + + # remove non-existing + if os.path.exists(dst_fn) and not os.path.exists(src_fn): + if clean: + if os.path.isdir(dst_fn): + shutil.rmtree(dst_fn) + else: + os.unlink(dst_fn) + continue + + # make directories + if os.path.isdir(src_fn): + if not os.path.isdir(dst_fn): + os.makedirs(dst_fn) + continue + + dst_dir = os.path.dirname(dst_fn) + if os.path.isfile(dst_fn) and not os.path.isdir(dst_dir): + os.makedirs(dst_dir) + + # don't replace up-to-date files + try: + if os.path.isfile(dst_fn) and \ + os.stat(dst_fn).st_mtime >= os.stat(src_fn).st_mtime: + continue + except OSError: + pass + + # copy file + shutil.copyfile(src_fn, dst_fn) + + # add .py files to 2to3 list + if dst_fn.endswith('.py'): + to_convert.append((src_fn, dst_fn)) + + # run 2to3 + flag_sets = {} + for fn, dst_fn in to_convert: + flag = '' + for pat, opt in EXTRA_2TO3_FLAGS.items(): + if fnmatch.fnmatch(fn, pat): + flag = opt + break + flag_sets.setdefault(flag, []).append(dst_fn) + + if patchfile: + p = open(patchfile, 'wb+') + else: + p = open(os.devnull, 'wb') + + for flags, filenames in flag_sets.items(): + if flags == 'skip': + continue + + _old_stdout = sys.stdout + try: + sys.stdout = StringIO() + lib2to3.main.main("lib2to3.fixes", ['-w'] + flags.split()+filenames) + finally: + sys.stdout = _old_stdout + + for fn, dst_fn in to_convert: + # perform custom mangling + custom_mangling(dst_fn) + + p.close() + +if __name__ == "__main__": + main() Property changes on: trunk/tools/py3tool.py ___________________________________________________________________ Name: svn:executable + * From scipy-svn at scipy.org Sat Sep 11 20:46:37 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:46:37 -0500 (CDT) Subject: [Scipy-svn] r6706 - trunk/scipy/cluster Message-ID: <20100912004637.DDBC439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:46:37 -0500 (Sat, 11 Sep 2010) New Revision: 6706 Modified: trunk/scipy/cluster/setup.py Log: 3K: add scipy PY3K defines for scipy.cluster. Modified: trunk/scipy/cluster/setup.py =================================================================== --- trunk/scipy/cluster/setup.py 2010-09-12 00:46:23 UTC (rev 6705) +++ trunk/scipy/cluster/setup.py 2010-09-12 00:46:37 UTC (rev 6706) @@ -1,7 +1,13 @@ #!/usr/bin/env python +import sys from os.path import join +if sys.version_info[0] >= 3: + DEFINE_MACROS = [("SCIPY_PY3K", None)] +else: + DEFINE_MACROS = [] + def configuration(parent_package = '', top_path = None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs config = Configuration('cluster', parent_package, top_path) @@ -10,11 +16,13 @@ config.add_extension('_vq', sources=[join('src', 'vq_module.c'), join('src', 'vq.c')], - include_dirs = [get_numpy_include_dirs()]) + include_dirs = [get_numpy_include_dirs()], + define_macros=DEFINE_MACROS) config.add_extension('_hierarchy_wrap', sources=[join('src', 'hierarchy_wrap.c'), join('src', 'hierarchy.c')], - include_dirs = [get_numpy_include_dirs()]) + include_dirs = [get_numpy_include_dirs()], + define_macros=DEFINE_MACROS) return config From scipy-svn at scipy.org Sat Sep 11 20:46:49 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:46:49 -0500 (CDT) Subject: [Scipy-svn] r6707 - trunk/tools Message-ID: <20100912004649.5346939CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:46:49 -0500 (Sat, 11 Sep 2010) New Revision: 6707 Modified: trunk/tools/py3tool.py Log: 3K: minor fftpack fixes to make it work on py3. Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:46:37 UTC (rev 6706) +++ trunk/tools/py3tool.py 2010-09-12 00:46:49 UTC (rev 6707) @@ -138,13 +138,15 @@ os.path.join('cluster', '__init__.py'), os.path.join('cluster', 'hierarchy.py'), os.path.join('cluster', 'vq.py'), + os.path.join('fftpack', 'basic.py'), + os.path.join('fftpack', 'pseudo_diffs.py'), ] if any(filename.endswith(x) for x in import_mangling): f = open(filename, 'r') text = f.read() f.close() - for mod in ['_vq', '_hierarchy_wrap']: + for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:47:01 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:47:01 -0500 (CDT) Subject: [Scipy-svn] r6708 - trunk/tools Message-ID: <20100912004701.7022439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:47:01 -0500 (Sat, 11 Sep 2010) New Revision: 6708 Modified: trunk/tools/py3tool.py Log: 3K: scipy.lib now compiles and pass most tests. Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:46:49 UTC (rev 6707) +++ trunk/tools/py3tool.py 2010-09-12 00:47:01 UTC (rev 6708) @@ -140,13 +140,20 @@ os.path.join('cluster', 'vq.py'), os.path.join('fftpack', 'basic.py'), os.path.join('fftpack', 'pseudo_diffs.py'), + os.path.join('linalg', 'basic.py'), + os.path.join('linalg', 'decomp.py'), + os.path.join('linalg', 'lapack.py'), + os.path.join('linalg', 'flinalg.py'), + os.path.join('lib', 'blas', '__init__.py'), + os.path.join('lib', 'lapack', '__init__.py'), ] if any(filename.endswith(x) for x in import_mangling): f = open(filename, 'r') text = f.read() f.close() - for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve']: + for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve', + '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', 'calc_lwork']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:47:15 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:47:15 -0500 (CDT) Subject: [Scipy-svn] r6709 - in trunk: scipy/special tools Message-ID: <20100912004715.6CFE239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:47:15 -0500 (Sat, 11 Sep 2010) New Revision: 6709 Modified: trunk/scipy/special/_cephesmodule.c trunk/tools/py3tool.py Log: 3K: special now compiles, most tests pass. Modified: trunk/scipy/special/_cephesmodule.c =================================================================== --- trunk/scipy/special/_cephesmodule.c 2010-09-12 00:47:01 UTC (rev 6708) +++ trunk/scipy/special/_cephesmodule.c 2010-09-12 00:47:15 UTC (rev 6709) @@ -25,6 +25,12 @@ #include "cephes_doc.h" +#if PY_VERSION_HEX >= 0x03000000 +#define PyInt_FromLong PyLong_FromLong +#define PyUString_FromString PyUnicode_FromString +#else +#define PyUString_FromString PyString_FromString +#endif static PyUFuncGenericFunction cephes1_functions[] = { NULL, NULL, }; static PyUFuncGenericFunction cephes1rc_functions[] = { NULL, NULL, NULL, NULL}; static PyUFuncGenericFunction cephes1_2_functions[] = { NULL, NULL, NULL, NULL,}; @@ -1086,7 +1092,54 @@ {NULL, NULL, 0} /* sentinel */ }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_cephes", + NULL, + -1, + methods, + NULL, + NULL, + NULL, + NULL +}; +PyObject *PyInit__cephes(void) +{ + PyObject *m, *s, *d; + + m = PyModule_Create(&moduledef); + import_array(); + import_ufunc(); + + /* Add some symbolic constants to the module */ + d = PyModule_GetDict(m); + + s = PyUString_FromString("2.0"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + + /* Add scipy_special_print_error_message global variable */ + /* No, instead acessible through errprint */ + + /* Load the cephes operators into the array module's namespace */ + Cephes_InitOperators(d); + + /* Register and add the warning type object */ + scipy_special_SpecialFunctionWarning = PyErr_NewException( + "scipy.special._cephes.SpecialFunctionWarning", + PyExc_RuntimeWarning, + NULL); + PyModule_AddObject(m, "SpecialFunctionWarning", + scipy_special_SpecialFunctionWarning); + + /* Check for errors */ + if (PyErr_Occurred()) + Py_FatalError("can't initialize module _cephes"); + return m; +} +#else PyMODINIT_FUNC init_cephes(void) { PyObject *m, *d, *s; @@ -1122,3 +1175,4 @@ if (PyErr_Occurred()) Py_FatalError("can't initialize module _cephes"); } +#endif Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:47:01 UTC (rev 6708) +++ trunk/tools/py3tool.py 2010-09-12 00:47:15 UTC (rev 6709) @@ -146,6 +146,9 @@ os.path.join('linalg', 'flinalg.py'), os.path.join('lib', 'blas', '__init__.py'), os.path.join('lib', 'lapack', '__init__.py'), + os.path.join('special', '__init__.py'), + os.path.join('special', 'basic.py'), + os.path.join('special', 'orthogonal.py'), ] if any(filename.endswith(x) for x in import_mangling): @@ -153,7 +156,9 @@ text = f.read() f.close() for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve', - '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', 'calc_lwork']: + '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', + 'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval', + 'lambertw']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:47:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:47:31 -0500 (CDT) Subject: [Scipy-svn] r6710 - in trunk/scipy: lib/lapack linalg Message-ID: <20100912004731.7290239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:47:31 -0500 (Sat, 11 Sep 2010) New Revision: 6710 Modified: trunk/scipy/lib/lapack/setup.py trunk/scipy/linalg/setup.py Log: 3K: make scipy.lib setup py3k compatible. Modified: trunk/scipy/lib/lapack/setup.py =================================================================== --- trunk/scipy/lib/lapack/setup.py 2010-09-12 00:47:15 UTC (rev 6709) +++ trunk/scipy/lib/lapack/setup.py 2010-09-12 00:47:31 UTC (rev 6710) @@ -69,7 +69,7 @@ # clapack: def get_clapack_source(ext, build_dir): name = ext.name.split('.')[-1] - assert name=='clapack',`name` + assert name=='clapack', repr(name) if atlas_version is None: target = os.path.join(build_dir,target_dir,'clapack.pyf') from distutils.dep_util import newer Modified: trunk/scipy/linalg/setup.py =================================================================== --- trunk/scipy/linalg/setup.py 2010-09-12 00:47:15 UTC (rev 6709) +++ trunk/scipy/linalg/setup.py 2010-09-12 00:47:31 UTC (rev 6710) @@ -54,7 +54,7 @@ atlas_version = ([v[3:-3] for k,v in lapack_opt.get('define_macros',[]) \ if k=='ATLAS_INFO']+[None])[0] if atlas_version: - print 'ATLAS version',atlas_version + print ('ATLAS version: %s' % atlas_version) target_dir = '' skip_names = {'clapack':[],'flapack':[],'cblas':[],'fblas':[]} From scipy-svn at scipy.org Sat Sep 11 20:47:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:47:47 -0500 (CDT) Subject: [Scipy-svn] r6711 - in trunk: scipy/spatial/src tools Message-ID: <20100912004747.7C0DA39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:47:47 -0500 (Sat, 11 Sep 2010) New Revision: 6711 Modified: trunk/scipy/spatial/src/distance_wrap.c trunk/tools/py3tool.py Log: 3K: scipy.spatial builds and most tests pass. Modified: trunk/scipy/spatial/src/distance_wrap.c =================================================================== --- trunk/scipy/spatial/src/distance_wrap.c 2010-09-12 00:47:31 UTC (rev 6710) +++ trunk/scipy/spatial/src/distance_wrap.c 2010-09-12 00:47:47 UTC (rev 6711) @@ -1132,7 +1132,32 @@ {NULL, NULL} /* Sentinel - marks the end of this structure */ }; -PyMODINIT_FUNC init_distance_wrap(void) { +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_distance_wrap", + NULL, + -1, + _distanceWrapMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__distance_wrap(void) +{ + PyObject *m; + + m = PyModule_Create(&moduledef); + import_array(); + + return m; +} +#else +PyMODINIT_FUNC init_distance_wrap(void) +{ (void) Py_InitModule("_distance_wrap", _distanceWrapMethods); import_array(); // Must be present for NumPy. Called first after above line. } +#endif Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:47:31 UTC (rev 6710) +++ trunk/tools/py3tool.py 2010-09-12 00:47:47 UTC (rev 6711) @@ -149,6 +149,8 @@ os.path.join('special', '__init__.py'), os.path.join('special', 'basic.py'), os.path.join('special', 'orthogonal.py'), + os.path.join('spatial', '__init__.py'), + os.path.join('spatial', 'distance.py'), ] if any(filename.endswith(x) for x in import_mangling): @@ -158,7 +160,7 @@ for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve', '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', 'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval', - 'lambertw']: + 'lambertw', 'ckdtree', '_distance_wrap']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:48:02 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:48:02 -0500 (CDT) Subject: [Scipy-svn] r6712 - in trunk: scipy/optimize tools Message-ID: <20100912004802.8910C39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:48:02 -0500 (Sat, 11 Sep 2010) New Revision: 6712 Modified: trunk/scipy/optimize/_minpackmodule.c trunk/scipy/optimize/minpack.h trunk/tools/py3tool.py Log: 3K: fix scipy.optimize._minpack wrapper for py3. Modified: trunk/scipy/optimize/_minpackmodule.c =================================================================== --- trunk/scipy/optimize/_minpackmodule.c 2010-09-12 00:47:47 UTC (rev 6711) +++ trunk/scipy/optimize/_minpackmodule.c 2010-09-12 00:48:02 UTC (rev 6712) @@ -13,6 +13,39 @@ {"_chkder", minpack_chkder, METH_VARARGS, doc_chkder}, {NULL, NULL, 0, NULL} }; + +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_minpack", + NULL, + -1, + minpack_module_methods, + NULL, + NULL, + NULL, + NULL +}; +PyObject *PyInit__minpack(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + + d = PyModule_GetDict(m); + + s = PyUnicode_FromString(" 1.10 "); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + minpack_error = PyErr_NewException ("minpack.error", NULL, NULL); + PyDict_SetItemString(d, "error", minpack_error); + if (PyErr_Occurred()) + Py_FatalError("can't initialize module minpack"); + + return m; +} +#else PyMODINIT_FUNC init_minpack(void) { PyObject *m, *d, *s; m = Py_InitModule("_minpack", minpack_module_methods); @@ -27,4 +60,4 @@ if (PyErr_Occurred()) Py_FatalError("can't initialize module minpack"); } - +#endif Modified: trunk/scipy/optimize/minpack.h =================================================================== --- trunk/scipy/optimize/minpack.h 2010-09-12 00:47:47 UTC (rev 6711) +++ trunk/scipy/optimize/minpack.h 2010-09-12 00:48:02 UTC (rev 6712) @@ -29,6 +29,12 @@ */ #include "Python.h" +#if PY_VERSION_HEX >= 0x03000000 + #define PyString_FromString PyBytes_FromString + #define PyString_ConcatAndDel PyBytes_ConcatAndDel + #define PyString_AsString PyBytes_AsString + #define PyInt_FromLong PyLong_FromLong +#endif #include "numpy/arrayobject.h" #define PYERR(errobj,message) {PyErr_SetString(errobj,message); goto fail;} Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:47:47 UTC (rev 6711) +++ trunk/tools/py3tool.py 2010-09-12 00:48:02 UTC (rev 6712) @@ -146,6 +146,8 @@ os.path.join('linalg', 'flinalg.py'), os.path.join('lib', 'blas', '__init__.py'), os.path.join('lib', 'lapack', '__init__.py'), + os.path.join('optimize', 'minpack.py'), + os.path.join('optimize', 'zeros.py'), os.path.join('special', '__init__.py'), os.path.join('special', 'basic.py'), os.path.join('special', 'orthogonal.py'), @@ -160,7 +162,8 @@ for mod in ['_vq', '_hierarchy_wrap', '_fftpack', 'convolve', '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', 'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval', - 'lambertw', 'ckdtree', '_distance_wrap']: + 'lambertw', 'ckdtree', '_distance_wrap', + '_minpack', '_zeros']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:48:16 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:48:16 -0500 (CDT) Subject: [Scipy-svn] r6713 - trunk/scipy/optimize Message-ID: <20100912004816.5845039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:48:16 -0500 (Sat, 11 Sep 2010) New Revision: 6713 Modified: trunk/scipy/optimize/zeros.c Log: 3K: fix scipy.optimize._zeros wrapper for py3. Modified: trunk/scipy/optimize/zeros.c =================================================================== --- trunk/scipy/optimize/zeros.c 2010-09-12 00:48:02 UTC (rev 6712) +++ trunk/scipy/optimize/zeros.c 2010-09-12 00:48:16 UTC (rev 6713) @@ -178,15 +178,42 @@ {NULL, NULL} }; -PyMODINIT_FUNC init_zeros(void) +static double __compute_relative_precision() { - double tol; + double tol; - /* Determine relative precision of doubles, assumes binary */ - for(tol = 1; tol + 1 != 1; tol /= 2); - scipy_zeros_rtol = 2*tol; + /* Determine relative precision of doubles, assumes binary */ + for(tol = 1; tol + 1 != 1; tol /= 2); + return 2*tol; +} +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_zeros", + NULL, + -1, + Zerosmethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__zeros(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + + scipy_zeros_rtol = __compute_relative_precision(); + + return m; +} +#else +PyMODINIT_FUNC init_zeros(void) +{ Py_InitModule("_zeros", Zerosmethods); + scipy_zeros_rtol = __compute_relative_precision(); } - - +#endif From scipy-svn at scipy.org Sat Sep 11 20:48:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:48:31 -0500 (CDT) Subject: [Scipy-svn] r6714 - trunk/scipy/optimize/tnc Message-ID: <20100912004831.E52FA39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:48:31 -0500 (Sat, 11 Sep 2010) New Revision: 6714 Modified: trunk/scipy/optimize/tnc/moduleTNC.c Log: 3K: moduleTNC converted to support py3. Modified: trunk/scipy/optimize/tnc/moduleTNC.c =================================================================== --- trunk/scipy/optimize/tnc/moduleTNC.c 2010-09-12 00:48:16 UTC (rev 6713) +++ trunk/scipy/optimize/tnc/moduleTNC.c 2010-09-12 00:48:31 UTC (rev 6714) @@ -304,7 +304,26 @@ {NULL, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "moduleTNC", + NULL, + -1, + moduleTNC_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit_moduleTNC(void) +{ + return PyModule_Create(&moduledef); +} +#else PyMODINIT_FUNC initmoduleTNC(void) { (void) Py_InitModule("moduleTNC", moduleTNC_methods); } +#endif From scipy-svn at scipy.org Sat Sep 11 20:48:43 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:48:43 -0500 (CDT) Subject: [Scipy-svn] r6715 - trunk/tools Message-ID: <20100912004843.F0D9039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:48:43 -0500 (Sat, 11 Sep 2010) New Revision: 6715 Modified: trunk/tools/py3tool.py Log: 3K: scipy.optimize now builds and passes most tests. Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:48:31 UTC (rev 6714) +++ trunk/tools/py3tool.py 2010-09-12 00:48:43 UTC (rev 6715) @@ -148,6 +148,10 @@ os.path.join('lib', 'lapack', '__init__.py'), os.path.join('optimize', 'minpack.py'), os.path.join('optimize', 'zeros.py'), + os.path.join('optimize', 'lbfgsb.py'), + os.path.join('optimize', 'cobyla.py'), + os.path.join('optimize', 'slsqp.py'), + os.path.join('optimize', 'nnls.py'), os.path.join('special', '__init__.py'), os.path.join('special', 'basic.py'), os.path.join('special', 'orthogonal.py'), @@ -163,7 +167,8 @@ '_flinalg', 'fblas', 'flapack', 'cblas', 'clapack', 'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval', 'lambertw', 'ckdtree', '_distance_wrap', - '_minpack', '_zeros']: + '_minpack', '_zeros', '_lbfgsb', '_cobyla', '_slsqp', + '_nnls']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:48:59 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:48:59 -0500 (CDT) Subject: [Scipy-svn] r6716 - trunk/scipy/interpolate/src Message-ID: <20100912004859.2FF1139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:48:58 -0500 (Sat, 11 Sep 2010) New Revision: 6716 Modified: trunk/scipy/interpolate/src/_fitpackmodule.c trunk/scipy/interpolate/src/_interpolate.cpp trunk/scipy/interpolate/src/multipack.h Log: 3K: scipy.interpolate builds and passes most tests. Modified: trunk/scipy/interpolate/src/_fitpackmodule.c =================================================================== --- trunk/scipy/interpolate/src/_fitpackmodule.c 2010-09-12 00:48:43 UTC (rev 6715) +++ trunk/scipy/interpolate/src/_fitpackmodule.c 2010-09-12 00:48:58 UTC (rev 6716) @@ -46,6 +46,39 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_fitpack", + NULL, + -1, + fitpack_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__fitpack(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + + d = PyModule_GetDict(m); + + s = PyUnicode_FromString(" 1.7 "); + PyDict_SetItemString(d, "__version__", s); + fitpack_error = PyErr_NewException ("fitpack.error", NULL, NULL); + Py_DECREF(s); + if (PyErr_Occurred()) { + Py_FatalError("can't initialize module fitpack"); + } + + return m; +} +#else PyMODINIT_FUNC init_fitpack(void) { PyObject *m, *d, *s; m = Py_InitModule("_fitpack", fitpack_module_methods); @@ -60,3 +93,4 @@ Py_FatalError("can't initialize module fitpack"); } } +#endif Modified: trunk/scipy/interpolate/src/_interpolate.cpp =================================================================== --- trunk/scipy/interpolate/src/_interpolate.cpp 2010-09-12 00:48:43 UTC (rev 6715) +++ trunk/scipy/interpolate/src/_interpolate.cpp 2010-09-12 00:48:58 UTC (rev 6716) @@ -221,7 +221,29 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_interpolate", + NULL, + -1, + interpolate_methods, + NULL, + NULL, + NULL, + NULL +}; +PyObject *PyInit__interpolate(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + + return m; +} +#else PyMODINIT_FUNC init_interpolate(void) { PyObject* m; @@ -232,5 +254,5 @@ return; import_array(); } - +#endif } // extern "C" Modified: trunk/scipy/interpolate/src/multipack.h =================================================================== --- trunk/scipy/interpolate/src/multipack.h 2010-09-12 00:48:43 UTC (rev 6715) +++ trunk/scipy/interpolate/src/multipack.h 2010-09-12 00:48:58 UTC (rev 6716) @@ -31,6 +31,24 @@ #include "Python.h" #include "numpy/arrayobject.h" +#if PY_VERSION_HEX >= 0x03000000 + #define PyString_AsString PyBytes_AsString + #define PyString_FromString PyBytes_FromString + #define PyString_ConcatAndDel PyBytes_ConcatAndDel + + #define PyInt_AsLong PyLong_AsLong + + /* Return True only if the long fits in a C long */ + static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); + } +#endif + #define PYERR(errobj,message) {PyErr_SetString(errobj,message); goto fail;} #define PYERR2(errobj,message) {PyErr_Print(); PyErr_SetString(errobj, message); goto fail;} #define ISCONTIGUOUS(m) ((m)->flags & CONTIGUOUS) From scipy-svn at scipy.org Sat Sep 11 20:49:18 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:49:18 -0500 (CDT) Subject: [Scipy-svn] r6717 - in trunk: scipy/integrate tools Message-ID: <20100912004918.3277139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:49:17 -0500 (Sat, 11 Sep 2010) New Revision: 6717 Added: trunk/scipy/integrate/npy_3kcompat.h Modified: trunk/scipy/integrate/_odepackmodule.c trunk/scipy/integrate/_quadpackmodule.c trunk/scipy/integrate/multipack.h trunk/scipy/integrate/quadpack.h trunk/tools/py3tool.py Log: 3K: scipy.integrate now builds and all tests pass. Modified: trunk/scipy/integrate/_odepackmodule.c =================================================================== --- trunk/scipy/integrate/_odepackmodule.c 2010-09-12 00:48:58 UTC (rev 6716) +++ trunk/scipy/integrate/_odepackmodule.c 2010-09-12 00:49:17 UTC (rev 6717) @@ -8,17 +8,50 @@ {"odeint", (PyCFunction) odepack_odeint, METH_VARARGS|METH_KEYWORDS, doc_odeint}, {NULL, NULL, 0, NULL} }; + +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_odepack", + NULL, + -1, + odepack_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__odepack(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + d = PyModule_GetDict(m); + + s = PyUString_FromString(" 1.9 "); + PyDict_SetItemString(d, "__version__", s); + odepack_error = PyErr_NewException ("odpack.error", NULL, NULL); + Py_DECREF(s); + PyDict_SetItemString(d, "error", odepack_error); + if (PyErr_Occurred()) { + Py_FatalError("can't initialize module odepack"); + } + return m; +} +#else PyMODINIT_FUNC init_odepack(void) { PyObject *m, *d, *s; m = Py_InitModule("_odepack", odepack_module_methods); import_array(); d = PyModule_GetDict(m); - s = PyString_FromString(" 1.9 "); + s = PyUSString_FromString(" 1.9 "); PyDict_SetItemString(d, "__version__", s); odepack_error = PyErr_NewException ("odepack.error", NULL, NULL); Py_DECREF(s); if (PyErr_Occurred()) Py_FatalError("can't initialize module odepack"); } - +#endif Modified: trunk/scipy/integrate/_quadpackmodule.c =================================================================== --- trunk/scipy/integrate/_quadpackmodule.c 2010-09-12 00:48:58 UTC (rev 6716) +++ trunk/scipy/integrate/_quadpackmodule.c 2010-09-12 00:49:17 UTC (rev 6717) @@ -14,13 +14,46 @@ {"_qawce", quadpack_qawce, METH_VARARGS, doc_qawce}, {NULL, NULL, 0, NULL} }; + +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_quadpack", + NULL, + -1, + quadpack_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__quadpack(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + d = PyModule_GetDict(m); + + s = PyUString_FromString(" 1.13 "); + PyDict_SetItemString(d, "__version__", s); + quadpack_error = PyErr_NewException ("quadpack.error", NULL, NULL); + Py_DECREF(s); + PyDict_SetItemString(d, "error", quadpack_error); + if (PyErr_Occurred()) { + Py_FatalError("can't initialize module quadpack"); + } + return m; +} +#else PyMODINIT_FUNC init_quadpack(void) { PyObject *m, *d, *s; m = Py_InitModule("_quadpack", quadpack_module_methods); import_array(); d = PyModule_GetDict(m); - s = PyString_FromString(" 1.13 "); + s = PyUString_FromString(" 1.13 "); PyDict_SetItemString(d, "__version__", s); quadpack_error = PyErr_NewException ("quadpack.error", NULL, NULL); Py_DECREF(s); @@ -28,4 +61,4 @@ if (PyErr_Occurred()) Py_FatalError("can't initialize module quadpack"); } - +#endif Modified: trunk/scipy/integrate/multipack.h =================================================================== --- trunk/scipy/integrate/multipack.h 2010-09-12 00:48:58 UTC (rev 6716) +++ trunk/scipy/integrate/multipack.h 2010-09-12 00:49:17 UTC (rev 6717) @@ -29,6 +29,8 @@ */ #include "Python.h" +#include "npy_3kcompat.h" + #include "numpy/arrayobject.h" #define PYERR(errobj,message) {PyErr_SetString(errobj,message); goto fail;} Added: trunk/scipy/integrate/npy_3kcompat.h =================================================================== --- trunk/scipy/integrate/npy_3kcompat.h (rev 0) +++ trunk/scipy/integrate/npy_3kcompat.h 2010-09-12 00:49:17 UTC (rev 6717) @@ -0,0 +1,305 @@ +#ifndef _NPY_3KCOMPAT_H_ +#define _NPY_3KCOMPAT_H_ + +#include +#include + +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +/* + * PyInt -> PyLong + */ + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#endif /* NPY_PY3K */ + + +static NPY_INLINE void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + Py_DECREF(right); + *left = new; +} + +static NPY_INLINE void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + *left = new; +} + + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyFile_AsFile + */ +#if defined(NPY_PY3K) +static NPY_INLINE FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); +} +#endif + +static NPY_INLINE PyObject* +npy_PyFile_OpenFile(PyObject *filename, char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static NPY_INLINE int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 0) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 0) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 0) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +#if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + +#endif + +#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/integrate/quadpack.h =================================================================== --- trunk/scipy/integrate/quadpack.h 2010-09-12 00:48:58 UTC (rev 6716) +++ trunk/scipy/integrate/quadpack.h 2010-09-12 00:49:17 UTC (rev 6717) @@ -28,6 +28,8 @@ */ #include "Python.h" + +#include "npy_3kcompat.h" #include "numpy/arrayobject.h" #include Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:48:58 UTC (rev 6716) +++ trunk/tools/py3tool.py 2010-09-12 00:49:17 UTC (rev 6717) @@ -140,6 +140,13 @@ os.path.join('cluster', 'vq.py'), os.path.join('fftpack', 'basic.py'), os.path.join('fftpack', 'pseudo_diffs.py'), + os.path.join('integrate', 'odepack.py'), + os.path.join('integrate', 'quadpack.py'), + os.path.join('integrate', 'ode.py'), + os.path.join('interpolate', 'fitpack.py'), + os.path.join('interpolate', 'fitpack2.py'), + os.path.join('interpolate', 'interpolate.py'), + os.path.join('interpolate', 'interpolate_wrapper.py'), os.path.join('linalg', 'basic.py'), os.path.join('linalg', 'decomp.py'), os.path.join('linalg', 'lapack.py'), @@ -152,6 +159,8 @@ os.path.join('optimize', 'cobyla.py'), os.path.join('optimize', 'slsqp.py'), os.path.join('optimize', 'nnls.py'), + os.path.join('signal', '__init__.py'), + os.path.join('signal', 'bsplines.py'), os.path.join('special', '__init__.py'), os.path.join('special', 'basic.py'), os.path.join('special', 'orthogonal.py'), @@ -168,7 +177,10 @@ 'calc_lwork', '_cephes', 'specfun', 'orthogonal_eval', 'lambertw', 'ckdtree', '_distance_wrap', '_minpack', '_zeros', '_lbfgsb', '_cobyla', '_slsqp', - '_nnls']: + '_nnls', + 'sigtools', 'spline', + '_fitpack', 'dfitpack', '_interpolate', + '_odepack', '_quadpack', 'vode', '_dop']: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:49:39 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:49:39 -0500 (CDT) Subject: [Scipy-svn] r6718 - in trunk: scipy/ndimage/src scipy/odr tools Message-ID: <20100912004939.D149039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:49:39 -0500 (Sat, 11 Sep 2010) New Revision: 6718 Added: trunk/scipy/ndimage/src/npy_3kcompat.h trunk/scipy/odr/npy_3kcompat.h Modified: trunk/scipy/ndimage/src/nd_image.c trunk/scipy/ndimage/src/nd_image.h trunk/scipy/odr/__odrpack.c trunk/scipy/odr/odrpack.h trunk/tools/py3tool.py Log: 3K: odr now builds and passes most tests. Modified: trunk/scipy/ndimage/src/nd_image.c =================================================================== --- trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:49:17 UTC (rev 6717) +++ trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:49:39 UTC (rev 6718) @@ -28,7 +28,6 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #define ND_IMPORT_ARRAY #include "nd_image.h" #undef ND_IMPORT_ARRAY @@ -914,8 +913,32 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_nd_image", + NULL, + -1, + methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__nd_image(void) +{ + PyObject *m, *s, *d; + + m = PyModule_Create(&moduledef); + import_array(); + + return m; +} +#else PyMODINIT_FUNC init_nd_image(void) { Py_InitModule("_nd_image", methods); import_array(); } +#endif Modified: trunk/scipy/ndimage/src/nd_image.h =================================================================== --- trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:49:17 UTC (rev 6717) +++ trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:49:39 UTC (rev 6718) @@ -41,6 +41,8 @@ #include #undef NO_IMPORT_ARRAY +#include "npy_3kcompat.h" + /* Eventually get rid of everything below this line */ typedef enum Added: trunk/scipy/ndimage/src/npy_3kcompat.h =================================================================== --- trunk/scipy/ndimage/src/npy_3kcompat.h (rev 0) +++ trunk/scipy/ndimage/src/npy_3kcompat.h 2010-09-12 00:49:39 UTC (rev 6718) @@ -0,0 +1,305 @@ +#ifndef _NPY_3KCOMPAT_H_ +#define _NPY_3KCOMPAT_H_ + +#include +#include + +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +/* + * PyInt -> PyLong + */ + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#endif /* NPY_PY3K */ + + +static NPY_INLINE void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + Py_DECREF(right); + *left = new; +} + +static NPY_INLINE void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + *left = new; +} + + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyFile_AsFile + */ +#if defined(NPY_PY3K) +static NPY_INLINE FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); +} +#endif + +static NPY_INLINE PyObject* +npy_PyFile_OpenFile(PyObject *filename, char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static NPY_INLINE int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 0) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 0) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 0) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +#if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + +#endif + +#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/odr/__odrpack.c =================================================================== --- trunk/scipy/odr/__odrpack.c 2010-09-12 00:49:17 UTC (rev 6717) +++ trunk/scipy/odr/__odrpack.c 2010-09-12 00:49:39 UTC (rev 6718) @@ -1356,6 +1356,35 @@ {NULL, NULL}, }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_odrpack", + NULL, + -1, + methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit___odrpack(void) +{ + PyObject *m, *s, *d; + + m = PyModule_Create(&moduledef); + import_array(); + + d = PyModule_GetDict(m); + odr_error = PyErr_NewException("odr.odrpack.odr_error", NULL, NULL); + odr_stop = PyErr_NewException("odr.odrpack.odr_stop", NULL, NULL); + PyDict_SetItemString(d, "odr_error", odr_error); + PyDict_SetItemString(d, "odr_stop", odr_stop); + + return m; +} +#else PyMODINIT_FUNC init__odrpack(void) { PyObject *m, *d; @@ -1369,3 +1398,4 @@ PyDict_SetItemString(d, "odr_error", odr_error); PyDict_SetItemString(d, "odr_stop", odr_stop); } +#endif Added: trunk/scipy/odr/npy_3kcompat.h =================================================================== --- trunk/scipy/odr/npy_3kcompat.h (rev 0) +++ trunk/scipy/odr/npy_3kcompat.h 2010-09-12 00:49:39 UTC (rev 6718) @@ -0,0 +1,305 @@ +#ifndef _NPY_3KCOMPAT_H_ +#define _NPY_3KCOMPAT_H_ + +#include +#include + +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +/* + * PyInt -> PyLong + */ + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#endif /* NPY_PY3K */ + + +static NPY_INLINE void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + Py_DECREF(right); + *left = new; +} + +static NPY_INLINE void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + *left = new; +} + + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyFile_AsFile + */ +#if defined(NPY_PY3K) +static NPY_INLINE FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); +} +#endif + +static NPY_INLINE PyObject* +npy_PyFile_OpenFile(PyObject *filename, char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static NPY_INLINE int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 0) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 0) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 0) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +#if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + +#endif + +#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/odr/odrpack.h =================================================================== --- trunk/scipy/odr/odrpack.h 2010-09-12 00:49:17 UTC (rev 6717) +++ trunk/scipy/odr/odrpack.h 2010-09-12 00:49:39 UTC (rev 6718) @@ -1,6 +1,8 @@ #include "Python.h" #include "numpy/arrayobject.h" +#include "npy_3kcompat.h" + #if defined(NO_APPEND_FORTRAN) #if defined(UPPERCASE_FORTRAN) #define F_FUNC(f,F) F Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:49:17 UTC (rev 6717) +++ trunk/tools/py3tool.py 2010-09-12 00:49:39 UTC (rev 6718) @@ -153,6 +153,11 @@ os.path.join('linalg', 'flinalg.py'), os.path.join('lib', 'blas', '__init__.py'), os.path.join('lib', 'lapack', '__init__.py'), + os.path.join('ndimage', 'filters.py'), + os.path.join('ndimage', 'fourier.py'), + os.path.join('ndimage', 'interpolation.py'), + os.path.join('ndimage', 'measurements.py'), + os.path.join('ndimage', 'morphology.py'), os.path.join('optimize', 'minpack.py'), os.path.join('optimize', 'zeros.py'), os.path.join('optimize', 'lbfgsb.py'), @@ -180,7 +185,11 @@ '_nnls', 'sigtools', 'spline', '_fitpack', 'dfitpack', '_interpolate', - '_odepack', '_quadpack', 'vode', '_dop']: + '_odepack', '_quadpack', 'vode', '_dop', + 'vonmises_cython', + 'futil', 'mvn', + '_nd_image', + ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, text, flags=re.M) From scipy-svn at scipy.org Sat Sep 11 20:49:54 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:49:54 -0500 (CDT) Subject: [Scipy-svn] r6719 - trunk/scipy/signal Message-ID: <20100912004954.90F1E39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:49:54 -0500 (Sat, 11 Sep 2010) New Revision: 6719 Modified: trunk/scipy/signal/lfilter.c.src trunk/scipy/signal/sigtools.h trunk/scipy/signal/sigtoolsmodule.c trunk/scipy/signal/splinemodule.c Log: 3K: signal now builds and passes most tests. Modified: trunk/scipy/signal/lfilter.c.src =================================================================== --- trunk/scipy/signal/lfilter.c.src 2010-09-12 00:49:39 UTC (rev 6718) +++ trunk/scipy/signal/lfilter.c.src 2010-09-12 00:49:54 UTC (rev 6719) @@ -7,6 +7,10 @@ #define NO_IMPORT_ARRAY #include +#if PY_VERSION_HEX >= 0x03000000 +#define PyNumber_Divide PyNumber_TrueDivide +#endif + #include "sigtools.h" static void FLOAT_filt(char *b, char *a, char *x, char *y, char *Z, Modified: trunk/scipy/signal/sigtools.h =================================================================== --- trunk/scipy/signal/sigtools.h 2010-09-12 00:49:39 UTC (rev 6718) +++ trunk/scipy/signal/sigtools.h 2010-09-12 00:49:54 UTC (rev 6719) @@ -2,6 +2,12 @@ #define _SCIPY_PRIVATE_SIGNAL_SIGTOOLS_H_ #include "Python.h" + +#if PY_VERSION_HEX >= 0x03000000 + #define PyString_AsString PyBytes_AsString + #define PyString_FromFormat PyBytes_FromFormat +#endif + #include "numpy/noprefix.h" #define BOUNDARY_MASK 12 Modified: trunk/scipy/signal/sigtoolsmodule.c =================================================================== --- trunk/scipy/signal/sigtoolsmodule.c 2010-09-12 00:49:39 UTC (rev 6718) +++ trunk/scipy/signal/sigtoolsmodule.c 2010-09-12 00:49:54 UTC (rev 6719) @@ -5,6 +5,7 @@ is granted under the SciPy License. */ #include + #define PY_ARRAY_UNIQUE_SYMBOL _scipy_signal_ARRAY_API #include @@ -822,10 +823,11 @@ int OBJECT_compare(PyObject **ip1, PyObject **ip2) { - return PyObject_Compare(*ip1, *ip2); + /*return PyObject_Compare(*ip1, *ip2); */ + return PyObject_RichCompareBool(*ip1, *ip2, Py_EQ) != 1; } -typedef int (*CompareFunction) Py_FPROTO((const void *, const void *)); +typedef int (*CompareFunction)(const void *, const void *); CompareFunction compare_functions[] = \ {NULL, (CompareFunction)BYTE_compare,(CompareFunction)UBYTE_compare,\ @@ -1312,6 +1314,30 @@ {NULL, NULL, 0, NULL} /* sentinel */ }; +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "sigtools", + NULL, + -1, + toolbox_module_methods, + NULL, + NULL, + NULL, + NULL +}; +PyObject *PyInit_sigtools(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + + scipy_signal_sigtools_linear_filter_module_init(); + + return m; +} +#else /* Initialization function for the module (*must* be called initsigtools) */ PyMODINIT_FUNC initsigtools(void) { @@ -1346,3 +1372,4 @@ Py_FatalError("can't initialize module array"); } } +#endif Modified: trunk/scipy/signal/splinemodule.c =================================================================== --- trunk/scipy/signal/splinemodule.c 2010-09-12 00:49:39 UTC (rev 6718) +++ trunk/scipy/signal/splinemodule.c 2010-09-12 00:49:54 UTC (rev 6719) @@ -469,7 +469,40 @@ }; /* Initialization function for the module (*must* be called initXXXXX) */ +#if PY_VERSION_HEX >= 0x03000000 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "spline", + NULL, + -1, + toolbox_module_methods, + NULL, + NULL, + NULL, + NULL +}; +PyObject *PyInit_spline(void) +{ + PyObject *m, *d, *s; + + m = PyModule_Create(&moduledef); + import_array(); + + /* Add some symbolic constants to the module */ + d = PyModule_GetDict(m); + + s = PyUnicode_FromString("0.2"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + + /* Check for errors */ + if (PyErr_Occurred()) { + Py_FatalError("can't initialize module array"); + } + return m; +} +#else PyMODINIT_FUNC initspline(void) { PyObject *m, *d, *s; @@ -490,18 +523,4 @@ if (PyErr_Occurred()) Py_FatalError("can't initialize module array"); } - - - - - - - - - - - - - - - +#endif From scipy-svn at scipy.org Sat Sep 11 20:50:10 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:50:10 -0500 (CDT) Subject: [Scipy-svn] r6720 - in trunk: scipy/io tools Message-ID: <20100912005010.A2FF439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:50:10 -0500 (Sat, 11 Sep 2010) New Revision: 6720 Added: trunk/scipy/io/npy_3kcompat.h Modified: trunk/scipy/io/setup.py trunk/tools/py3tool.py Log: 3K: io builds, except matlab part. Added: trunk/scipy/io/npy_3kcompat.h =================================================================== --- trunk/scipy/io/npy_3kcompat.h (rev 0) +++ trunk/scipy/io/npy_3kcompat.h 2010-09-12 00:50:10 UTC (rev 6720) @@ -0,0 +1,305 @@ +#ifndef _NPY_3KCOMPAT_H_ +#define _NPY_3KCOMPAT_H_ + +#include +#include + +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +/* + * PyInt -> PyLong + */ + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#endif /* NPY_PY3K */ + + +static NPY_INLINE void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + Py_DECREF(right); + *left = new; +} + +static NPY_INLINE void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + *left = new; +} + + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyFile_AsFile + */ +#if defined(NPY_PY3K) +static NPY_INLINE FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); +} +#endif + +static NPY_INLINE PyObject* +npy_PyFile_OpenFile(PyObject *filename, char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static NPY_INLINE int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 0) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 0) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 0) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +#if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + +#endif + +#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/io/setup.py =================================================================== --- trunk/scipy/io/setup.py 2010-09-12 00:49:54 UTC (rev 6719) +++ trunk/scipy/io/setup.py 2010-09-12 00:50:10 UTC (rev 6720) @@ -6,7 +6,7 @@ config.add_data_dir('tests') config.add_data_dir('docs') - config.add_subpackage('matlab') + #config.add_subpackage('matlab') config.add_subpackage('arff') return config Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:49:54 UTC (rev 6719) +++ trunk/tools/py3tool.py 2010-09-12 00:50:10 UTC (rev 6720) @@ -147,6 +147,8 @@ os.path.join('interpolate', 'fitpack2.py'), os.path.join('interpolate', 'interpolate.py'), os.path.join('interpolate', 'interpolate_wrapper.py'), + os.path.join('io', 'array_import.py'), + os.path.join('io', '__init__.py'), os.path.join('linalg', 'basic.py'), os.path.join('linalg', 'decomp.py'), os.path.join('linalg', 'lapack.py'), @@ -189,6 +191,7 @@ 'vonmises_cython', 'futil', 'mvn', '_nd_image', + 'numpyio', ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 20:50:25 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:50:25 -0500 (CDT) Subject: [Scipy-svn] r6721 - in trunk/scipy: lib/lapack linalg Message-ID: <20100912005025.B806F39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:50:25 -0500 (Sat, 11 Sep 2010) New Revision: 6721 Modified: trunk/scipy/lib/lapack/setup.py trunk/scipy/linalg/setup.py Log: 3K: BUG: fix build of scipy.lib.lapack and scipy.linalg when Atlas is not installed Modified: trunk/scipy/lib/lapack/setup.py =================================================================== --- trunk/scipy/lib/lapack/setup.py 2010-09-12 00:50:10 UTC (rev 6720) +++ trunk/scipy/lib/lapack/setup.py 2010-09-12 00:50:25 UTC (rev 6721) @@ -55,7 +55,7 @@ skip_names['clapack'].extend(\ 'sgetri dgetri cgetri zgetri spotri dpotri cpotri zpotri'\ ' slauum dlauum clauum zlauum strtri dtrtri ctrtri ztrtri'.split()) - elif atlas_version>'3.4.0' and atlas_version<='3.5.12': + elif atlas_version and atlas_version>'3.4.0' and atlas_version<='3.5.12': skip_names['clapack'].extend('cpotrf zpotrf'.split()) # flapack: Modified: trunk/scipy/linalg/setup.py =================================================================== --- trunk/scipy/linalg/setup.py 2010-09-12 00:50:10 UTC (rev 6720) +++ trunk/scipy/linalg/setup.py 2010-09-12 00:50:25 UTC (rev 6721) @@ -87,7 +87,7 @@ skip_names['clapack'].extend(\ 'sgetri dgetri cgetri zgetri spotri dpotri cpotri zpotri'\ ' slauum dlauum clauum zlauum strtri dtrtri ctrtri ztrtri'.split()) - elif atlas_version>'3.4.0' and atlas_version<='3.5.12': + elif atlas_version and atlas_version>'3.4.0' and atlas_version<='3.5.12': skip_names['clapack'].extend('cpotrf zpotrf'.split()) def generate_pyf(extension, build_dir): From scipy-svn at scipy.org Sat Sep 11 20:50:39 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:50:39 -0500 (CDT) Subject: [Scipy-svn] r6722 - trunk/scipy/integrate Message-ID: <20100912005039.8335D39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:50:39 -0500 (Sat, 11 Sep 2010) New Revision: 6722 Modified: trunk/scipy/integrate/_odepackmodule.c Log: Fix a typo in _odepackmodule.c Modified: trunk/scipy/integrate/_odepackmodule.c =================================================================== --- trunk/scipy/integrate/_odepackmodule.c 2010-09-12 00:50:25 UTC (rev 6721) +++ trunk/scipy/integrate/_odepackmodule.c 2010-09-12 00:50:39 UTC (rev 6722) @@ -47,7 +47,7 @@ import_array(); d = PyModule_GetDict(m); - s = PyUSString_FromString(" 1.9 "); + s = PyUString_FromString(" 1.9 "); PyDict_SetItemString(d, "__version__", s); odepack_error = PyErr_NewException ("odepack.error", NULL, NULL); Py_DECREF(s); From scipy-svn at scipy.org Sat Sep 11 20:51:05 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:51:05 -0500 (CDT) Subject: [Scipy-svn] r6723 - in trunk: scipy/sparse/linalg/dsolve scipy/sparse/linalg/eigen/arpack scipy/sparse/linalg/isolve scipy/sparse/sparsetools tools Message-ID: <20100912005105.3331F39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:51:04 -0500 (Sat, 11 Sep 2010) New Revision: 6723 Added: trunk/scipy/sparse/linalg/dsolve/py3k.h trunk/scipy/sparse/sparsetools/py3k.h Modified: trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c trunk/scipy/sparse/linalg/dsolve/_superlumodule.c trunk/scipy/sparse/linalg/dsolve/_superluobject.c trunk/scipy/sparse/linalg/eigen/arpack/setup.py trunk/scipy/sparse/linalg/isolve/setup.py trunk/scipy/sparse/sparsetools/sparsetools.i trunk/tools/py3tool.py Log: 3K: scipy.sparse now compiles, most tests pass. Modified: trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:51:04 UTC (rev 6723) @@ -1,3 +1,5 @@ +/* Should be imported before Python.h */ +#include "py3k.h" #include "Python.h" #include Modified: trunk/scipy/sparse/linalg/dsolve/_superlumodule.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:51:04 UTC (rev 6723) @@ -240,6 +240,39 @@ {NULL, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_superlu", + NULL, + -1, + SuperLU_Methods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit__superlu(void) +{ + PyObject *m, *d; + + m = PyModule_Create(&moduledef); + d = PyModule_GetDict(m); + + PyDict_SetItemString(d, "SciPyLUType", (PyObject *)&SciPySuperLUType); + + import_array(); + + if (PyErr_Occurred()) + Py_FatalError("can't initialize module _superlu"); + + return m; +} + +#else + PyMODINIT_FUNC init_superlu(void) { @@ -254,3 +287,5 @@ import_array(); } + +#endif Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:51:04 UTC (rev 6723) @@ -6,6 +6,7 @@ */ #include +#include "py3k.h" #define NO_IMPORT_ARRAY #include "_superluobject.h" @@ -157,7 +158,7 @@ PyObject *list = PyList_New(sizeof(members)/sizeof(char *)); if (list != NULL) { for (i = 0; i < sizeof(members)/sizeof(char *); i ++) - PyList_SetItem(list, i, PyString_FromString(members[i])); + PyList_SetItem(list, i, PyUstring_FromString(members[i])); if (PyErr_Occurred()) { Py_DECREF(list); list = NULL; @@ -165,7 +166,17 @@ } return list; } +#if PY_VERSION_HEX >= 0x03000000 + if (1) { + PyObject *str, *ret; + str = PyUnicode_FromString(name); + ret = PyObject_GenericGetAttr((PyObject *)self, str); + Py_DECREF(str); + return ret; + } +#else return Py_FindMethod(SciPyLU_methods, (PyObject *)self, name); +#endif } Added: trunk/scipy/sparse/linalg/dsolve/py3k.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/py3k.h (rev 0) +++ trunk/scipy/sparse/linalg/dsolve/py3k.h 2010-09-12 00:51:04 UTC (rev 6723) @@ -0,0 +1,13 @@ +#ifndef __NPY_PY3H__ +#define __NPY_PY3H__ + +#include + +#if PY_VERSION_HEX >= 0x03000000 + #define PyUstring_FromString PyUnicode_FromString + #define PyInt_FromLong PyLong_FromLong +#else + #define PyUstring_FromString PyString_FromString +#endif + +#endif Modified: trunk/scipy/sparse/linalg/eigen/arpack/setup.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/setup.py 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/linalg/eigen/arpack/setup.py 2010-09-12 00:51:04 UTC (rev 6723) @@ -27,7 +27,7 @@ lapack_opt = get_info('lapack_opt') if not lapack_opt: - raise NotFoundError,'no lapack/blas resources found' + raise NotFoundError('no lapack/blas resources found') config = Configuration('arpack', parent_package, top_path) Modified: trunk/scipy/sparse/linalg/isolve/setup.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/setup.py 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/linalg/isolve/setup.py 2010-09-12 00:51:04 UTC (rev 6723) @@ -17,7 +17,7 @@ lapack_opt = get_info('lapack_opt') if not lapack_opt: - raise NotFoundError,'no lapack/blas resources found' + raise NotFoundError('no lapack/blas resources found') # iterative methods methods = ['BiCGREVCOM.f.src', Added: trunk/scipy/sparse/sparsetools/py3k.h =================================================================== --- trunk/scipy/sparse/sparsetools/py3k.h (rev 0) +++ trunk/scipy/sparse/sparsetools/py3k.h 2010-09-12 00:51:04 UTC (rev 6723) @@ -0,0 +1,22 @@ +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#include +#error YOYOYO +#endif +#include + +#if PY_VERSION_HEX >= 0x03000000 + #define PyString_Check PyUnicode_Check + static int __pyfile_check_guard(PyObject *x) + { + fprintf(stderr, "PY3K error: PyFile_Check called !\n"); + return 0; + } + #define PyFile_Check(x) __pyfile_check_guard((x)) + static int __pyinstance_check_guard(PyObject *x) + { + fprintf(stderr, "PY3K error: PyInstance_Check calleed !\n"); + return 0; + } + #define PyInstance_Check(x) __pyinstance_check_guard((x)) +#endif Modified: trunk/scipy/sparse/sparsetools/sparsetools.i =================================================================== --- trunk/scipy/sparse/sparsetools/sparsetools.i 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/scipy/sparse/sparsetools/sparsetools.i 2010-09-12 00:51:04 UTC (rev 6723) @@ -5,6 +5,7 @@ #pragma SWIG nowarn=467 %{ +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:50:39 UTC (rev 6722) +++ trunk/tools/py3tool.py 2010-09-12 00:51:04 UTC (rev 6723) @@ -153,6 +153,7 @@ os.path.join('linalg', 'decomp.py'), os.path.join('linalg', 'lapack.py'), os.path.join('linalg', 'flinalg.py'), + os.path.join('linalg', 'iterative.py'), os.path.join('lib', 'blas', '__init__.py'), os.path.join('lib', 'lapack', '__init__.py'), os.path.join('ndimage', 'filters.py'), @@ -173,9 +174,15 @@ os.path.join('special', 'orthogonal.py'), os.path.join('spatial', '__init__.py'), os.path.join('spatial', 'distance.py'), + os.path.join('sparse', 'linalg', 'isolve', 'iterative.py'), + os.path.join('sparse', 'linalg', 'dsolve', '_superlu.py'), + os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'arpack.py'), + os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'speigs.py'), + os.path.join('sparse', 'linalg', 'iterative', 'isolve', 'iterative.py'), ] if any(filename.endswith(x) for x in import_mangling): + print(filename) f = open(filename, 'r') text = f.read() f.close() @@ -192,6 +199,8 @@ 'futil', 'mvn', '_nd_image', 'numpyio', + '_zsuperlu', '_ssuperlu', '_dsuperlu', '_csuperlu', + '_arpack', '_iterative', ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 20:51:30 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:51:30 -0500 (CDT) Subject: [Scipy-svn] r6724 - trunk/scipy/sparse/sparsetools Message-ID: <20100912005130.2E71639CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:51:29 -0500 (Sat, 11 Sep 2010) New Revision: 6724 Modified: trunk/scipy/sparse/sparsetools/bsr.py trunk/scipy/sparse/sparsetools/bsr_wrap.cxx trunk/scipy/sparse/sparsetools/coo.py trunk/scipy/sparse/sparsetools/coo_wrap.cxx trunk/scipy/sparse/sparsetools/csc.py trunk/scipy/sparse/sparsetools/csc_wrap.cxx trunk/scipy/sparse/sparsetools/csr.py trunk/scipy/sparse/sparsetools/csr_wrap.cxx trunk/scipy/sparse/sparsetools/dia.py trunk/scipy/sparse/sparsetools/dia_wrap.cxx Log: GEN: sparse: regenerate sparsetools SWIG files Modified: trunk/scipy/sparse/sparsetools/bsr.py =================================================================== --- trunk/scipy/sparse/sparsetools/bsr.py 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/bsr.py 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import _bsr -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_bsr', [dirname(__file__)]) + except ImportError: + import _bsr + return _bsr + if fp is not None: + try: + _mod = imp.load_module('_bsr', fp, pathname, description) + finally: + fp.close() + return _mod + _bsr = swig_import_helper() + del swig_import_helper +else: + import _bsr +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types Modified: trunk/scipy/sparse/sparsetools/bsr_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/bsr_wrap.cxx 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/bsr_wrap.cxx 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,7 +749,68 @@ +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) @@ -777,6 +856,7 @@ # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2518,11 +2699,16 @@ /*----------------------------------------------- @(target):= _bsr.so ------------------------------------------------*/ -#define SWIG_init init_bsr +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__bsr +#else +# define SWIG_init init_bsr + +#endif #define SWIG_name "_bsr" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2534,28 +2720,28 @@ namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2563,7 +2749,7 @@ return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2582,10 +2768,10 @@ namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2595,6 +2781,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" @@ -41705,6 +41892,7 @@ static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"bsr_diagonal", _wrap_bsr_diagonal, METH_VARARGS, (char *)"\n" "bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, \n" " signed char Ax, signed char Yx)\n" @@ -42444,26 +42632,58 @@ SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -42521,12 +42741,17 @@ if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -42537,7 +42762,7 @@ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -42558,7 +42783,10 @@ #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -42683,13 +42911,37 @@ #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -42699,5 +42951,10 @@ import_array(); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } Modified: trunk/scipy/sparse/sparsetools/coo.py =================================================================== --- trunk/scipy/sparse/sparsetools/coo.py 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/coo.py 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import _coo -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_coo', [dirname(__file__)]) + except ImportError: + import _coo + return _coo + if fp is not None: + try: + _mod = imp.load_module('_coo', fp, pathname, description) + finally: + fp.close() + return _mod + _coo = swig_import_helper() + del swig_import_helper +else: + import _coo +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types Modified: trunk/scipy/sparse/sparsetools/coo_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/coo_wrap.cxx 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/coo_wrap.cxx 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,7 +749,68 @@ +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) @@ -777,6 +856,7 @@ # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2518,11 +2699,16 @@ /*----------------------------------------------- @(target):= _coo.so ------------------------------------------------*/ -#define SWIG_init init_coo +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__coo +#else +# define SWIG_init init_coo + +#endif #define SWIG_name "_coo" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2534,28 +2720,28 @@ namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2563,7 +2749,7 @@ return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2582,10 +2768,10 @@ namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2595,6 +2781,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" @@ -13039,6 +13226,7 @@ static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"coo_tocsr", _wrap_coo_tocsr, METH_VARARGS, (char *)"\n" "coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, \n" " int Bp, int Bj, signed char Bx)\n" @@ -13449,26 +13637,58 @@ SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -13526,12 +13746,17 @@ if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -13542,7 +13767,7 @@ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -13563,7 +13788,10 @@ #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -13688,13 +13916,37 @@ #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -13704,5 +13956,10 @@ import_array(); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } Modified: trunk/scipy/sparse/sparsetools/csc.py =================================================================== --- trunk/scipy/sparse/sparsetools/csc.py 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/csc.py 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import _csc -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_csc', [dirname(__file__)]) + except ImportError: + import _csc + return _csc + if fp is not None: + try: + _mod = imp.load_module('_csc', fp, pathname, description) + finally: + fp.close() + return _mod + _csc = swig_import_helper() + del swig_import_helper +else: + import _csc +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types Modified: trunk/scipy/sparse/sparsetools/csc_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/csc_wrap.cxx 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/csc_wrap.cxx 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,7 +749,68 @@ +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) @@ -777,6 +856,7 @@ # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2518,11 +2699,16 @@ /*----------------------------------------------- @(target):= _csc.so ------------------------------------------------*/ -#define SWIG_init init_csc +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__csc +#else +# define SWIG_init init_csc + +#endif #define SWIG_name "_csc" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2534,28 +2720,28 @@ namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2563,7 +2749,7 @@ return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2582,10 +2768,10 @@ namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2595,6 +2781,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" @@ -31215,6 +31402,7 @@ static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"csc_matmat_pass1", _wrap_csc_matmat_pass1, METH_VARARGS, (char *)"\n" "csc_matmat_pass1(int n_row, int n_col, int Ap, int Ai, int Bp, int Bi, \n" " int Cp)\n" @@ -31832,26 +32020,58 @@ SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -31909,12 +32129,17 @@ if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -31925,7 +32150,7 @@ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -31946,7 +32171,10 @@ #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -32071,13 +32299,37 @@ #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -32087,5 +32339,10 @@ import_array(); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } Modified: trunk/scipy/sparse/sparsetools/csr.py =================================================================== --- trunk/scipy/sparse/sparsetools/csr.py 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/csr.py 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import _csr -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_csr', [dirname(__file__)]) + except ImportError: + import _csr + return _csr + if fp is not None: + try: + _mod = imp.load_module('_csr', fp, pathname, description) + finally: + fp.close() + return _mod + _csr = swig_import_helper() + del swig_import_helper +else: + import _csr +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types @@ -568,51 +586,33 @@ def get_csr_submatrix(*args): """ get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, signed char Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(signed char)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(unsigned char)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, short Ax, int ir0, - int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(short)> Bx) + int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(unsigned short)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, int Ax, int ir0, - int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(int)> Bx) + int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(unsigned int)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long long Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(long long)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, - int ir0, int ir1, int ic0, int ic1, - std::vector<(int)> Bp, std::vector<(int)> Bj, - std::vector<(unsigned long long)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, float Ax, int ir0, - int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(float)> Bx) + int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, double Ax, int ir0, - int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(double)> Bx) + int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long double Ax, - int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, - std::vector<(int)> Bj, std::vector<(long double)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, - int ir0, int ir1, int ic0, int ic1, - std::vector<(int)> Bp, std::vector<(int)> Bj, - std::vector<(npy_cfloat_wrapper)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, - int ir0, int ir1, int ic0, int ic1, - std::vector<(int)> Bp, std::vector<(int)> Bj, - std::vector<(npy_cdouble_wrapper)> Bx) + int ir0, int ir1, int ic0, int ic1) get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, - int ir0, int ir1, int ic0, int ic1, - std::vector<(int)> Bp, std::vector<(int)> Bj, - std::vector<(npy_clongdouble_wrapper)> Bx) + int ir0, int ir1, int ic0, int ic1) """ return _csr.get_csr_submatrix(*args) Modified: trunk/scipy/sparse/sparsetools/csr_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/csr_wrap.cxx 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/csr_wrap.cxx 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,7 +749,68 @@ +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) @@ -777,6 +856,7 @@ # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2532,11 +2713,16 @@ /*----------------------------------------------- @(target):= _csr.so ------------------------------------------------*/ -#define SWIG_init init_csr +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__csr +#else +# define SWIG_init init_csr + +#endif #define SWIG_name "_csr" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2548,28 +2734,28 @@ namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2577,7 +2763,7 @@ return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2596,10 +2782,10 @@ namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2609,6 +2795,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" @@ -48536,6 +48723,7 @@ static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"expandptr", _wrap_expandptr, METH_VARARGS, (char *)"expandptr(int n_row, int Ap, int Bi)"}, { (char *)"csr_matmat_pass1", _wrap_csr_matmat_pass1, METH_VARARGS, (char *)"\n" "csr_matmat_pass1(int n_row, int n_col, int Ap, int Aj, int Bp, int Bj, \n" @@ -48996,51 +49184,33 @@ ""}, { (char *)"get_csr_submatrix", _wrap_get_csr_submatrix, METH_VARARGS, (char *)"\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, signed char Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(signed char)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(unsigned char)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, short Ax, int ir0, \n" - " int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(short)> Bx)\n" + " int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(unsigned short)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, int Ax, int ir0, \n" - " int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(int)> Bx)\n" + " int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(unsigned int)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long long Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(long long)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, \n" - " int ir0, int ir1, int ic0, int ic1, \n" - " std::vector<(int)> Bp, std::vector<(int)> Bj, \n" - " std::vector<(unsigned long long)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, float Ax, int ir0, \n" - " int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(float)> Bx)\n" + " int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, double Ax, int ir0, \n" - " int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(double)> Bx)\n" + " int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long double Ax, \n" - " int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, \n" - " std::vector<(int)> Bj, std::vector<(long double)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, \n" - " int ir0, int ir1, int ic0, int ic1, \n" - " std::vector<(int)> Bp, std::vector<(int)> Bj, \n" - " std::vector<(npy_cfloat_wrapper)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, \n" - " int ir0, int ir1, int ic0, int ic1, \n" - " std::vector<(int)> Bp, std::vector<(int)> Bj, \n" - " std::vector<(npy_cdouble_wrapper)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" "get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, \n" - " int ir0, int ir1, int ic0, int ic1, \n" - " std::vector<(int)> Bp, std::vector<(int)> Bj, \n" - " std::vector<(npy_clongdouble_wrapper)> Bx)\n" + " int ir0, int ir1, int ic0, int ic1)\n" ""}, { (char *)"csr_sample_values", _wrap_csr_sample_values, METH_VARARGS, (char *)"\n" "csr_sample_values(int n_row, int n_col, int Ap, int Aj, signed char Ax, \n" @@ -49422,26 +49592,58 @@ SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -49499,12 +49701,17 @@ if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -49515,7 +49722,7 @@ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -49536,7 +49743,10 @@ #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -49661,13 +49871,37 @@ #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -49677,5 +49911,10 @@ import_array(); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } Modified: trunk/scipy/sparse/sparsetools/dia.py =================================================================== --- trunk/scipy/sparse/sparsetools/dia.py 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/dia.py 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,12 +1,32 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.36 +# Version 1.3.40 # -# Don't modify this file, modify the SWIG interface instead. +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. # This file is compatible with both classic and new-style classes. -import _dia -import new -new_instancemethod = new.instancemethod +from sys import version_info +if version_info >= (2,6,0): + def swig_import_helper(): + from os.path import dirname + import imp + fp = None + try: + fp, pathname, description = imp.find_module('_dia', [dirname(__file__)]) + except ImportError: + import _dia + return _dia + if fp is not None: + try: + _mod = imp.load_module('_dia', fp, pathname, description) + finally: + fp.close() + return _mod + _dia = swig_import_helper() + del swig_import_helper +else: + import _dia +del version_info try: _swig_property = property except NameError: @@ -14,7 +34,7 @@ def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): - if type(value).__name__ == 'PySwigObject': + if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) @@ -31,21 +51,19 @@ if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) - raise AttributeError,name + raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) -import types try: - _object = types.ObjectType + _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 -del types Modified: trunk/scipy/sparse/sparsetools/dia_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/dia_wrap.cxx 2010-09-12 00:51:04 UTC (rev 6723) +++ trunk/scipy/sparse/sparsetools/dia_wrap.cxx 2010-09-12 00:51:29 UTC (rev 6724) @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.36 + * Version 1.3.40 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -11,19 +11,23 @@ #define SWIGPYTHON #define SWIG_PYTHON_DIRECTOR_NO_VTABLE + #ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ template class SwigValueWrapper { - T *tt; + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } }; template T SwigValueInit() { @@ -147,7 +151,7 @@ /* ----------------------------------------------------------------------------- * swigrun.swg * - * This file contains generic CAPI SWIG runtime support for pointer + * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ @@ -166,11 +170,11 @@ /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. */ #ifndef SWIGRUNTIME @@ -197,14 +201,14 @@ /* Flags/methods for returning states. - The swig conversion methods, as ConvertPtr, return and integer + The SWIG conversion methods, as ConvertPtr, return and integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. - In old swig versions, you usually write code as: + In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code @@ -212,7 +216,7 @@ //fail code } - Now you can be more explicit as: + Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { @@ -221,7 +225,7 @@ // fail code } - that seems to be the same, but now you can also do + which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); @@ -239,7 +243,7 @@ I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as + also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { @@ -257,7 +261,7 @@ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. + SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this @@ -271,9 +275,8 @@ fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() +*/ - - */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) @@ -298,7 +301,6 @@ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank @@ -321,8 +323,6 @@ #endif - - #include #ifdef __cplusplus @@ -419,40 +419,58 @@ } -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } -/* Same as previous function, except strcmp is replaced with a pointer comparison */ +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; } /* @@ -731,7 +749,68 @@ +/* Compatibility macros for Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 +#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) +#define PyInt_Check(x) PyLong_Check(x) +#define PyInt_AsLong(x) PyLong_AsLong(x) +#define PyInt_FromLong(x) PyLong_FromLong(x) +#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + +#endif + +#ifndef Py_TYPE +# define Py_TYPE(op) ((op)->ob_type) +#endif + +/* SWIG APIs for compatibility of both Python 2 & 3 */ + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_FromFormat PyUnicode_FromFormat +#else +# define SWIG_Python_str_FromFormat PyString_FromFormat +#endif + + +/* Warning: This function will allocate a new string in Python 3, + * so please call SWIG_Python_str_DelForPy3(x) to free the space. + */ +SWIGINTERN char* +SWIG_Python_str_AsChar(PyObject *str) +{ +#if PY_VERSION_HEX >= 0x03000000 + char *cstr; + char *newstr; + Py_ssize_t len; + str = PyUnicode_AsUTF8String(str); + PyBytes_AsStringAndSize(str, &cstr, &len); + newstr = (char *) malloc(len+1); + memcpy(newstr, cstr, len+1); + Py_XDECREF(str); + return newstr; +#else + return PyString_AsString(str); +#endif +} + +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) +#else +# define SWIG_Python_str_DelForPy3(x) +#endif + + +SWIGINTERN PyObject* +SWIG_Python_str_FromChar(const char *c) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_FromString(c); +#else + return PyString_FromString(c); +#endif +} + /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) @@ -777,6 +856,7 @@ # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -784,7 +864,6 @@ # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -799,7 +878,6 @@ # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static @@ -877,10 +955,13 @@ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { @@ -888,8 +969,6 @@ } } - - #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -986,6 +1065,20 @@ swig_type_info **ptype; } swig_const_info; + +/* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ +SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) +{ +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return NULL; +#endif +} + #ifdef __cplusplus #if 0 { /* cc-mode */ @@ -1038,7 +1131,7 @@ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) +#define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg @@ -1234,7 +1327,7 @@ return none; } -/* PySwigClientData */ +/* SwigPyClientData */ typedef struct { PyObject *klass; @@ -1243,30 +1336,30 @@ PyObject *destroy; int delargs; int implicitconv; -} PySwigClientData; +} SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { - PySwigClientData *data = (PySwigClientData *)ty->clientdata; + SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) +SWIGRUNTIME SwigPyClientData * +SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); @@ -1314,14 +1407,14 @@ } SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) +SwigPyClientData_Del(SwigPyClientData* data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } -/* =============== PySwigObject =====================*/ +/* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD @@ -1329,24 +1422,28 @@ swig_type_info *ty; int own; PyObject *next; -} PySwigObject; +} SwigPyObject; SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) +SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) +SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); + if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { + PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { +#if PY_VERSION_HEX >= 0x03000000 + res = PyUnicode_Format(ofmt,args); +#else res = PyString_Format(ofmt,args); +#endif Py_DECREF(ofmt); } Py_DECREF(args); @@ -1356,49 +1453,57 @@ } SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) +SwigPyObject_oct(SwigPyObject *v) { - return PySwigObject_format("%o",v); + return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) +SwigPyObject_hex(SwigPyObject *v) { - return PySwigObject_format("%x",v); + return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) +SwigPyObject_repr(SwigPyObject *v) #else -PySwigObject_repr(PySwigObject *v, PyObject *args) +SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); - Py_DECREF(hex); + PyObject *repr = SWIG_Python_str_FromFormat("", name, v); if (v->next) { #ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); #else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); + PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); #endif +#if PY_VERSION_HEX >= 0x03000000 + PyObject *joined = PyUnicode_Concat(repr, nrep); + Py_DecRef(repr); + Py_DecRef(nrep); + repr = joined; +#else PyString_ConcatAndDel(&repr,nrep); +#endif } return repr; } SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *str; #ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); + PyObject *repr = SwigPyObject_repr(v); #else - PyObject *repr = PySwigObject_repr(v, NULL); + PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { - fputs(PyString_AsString(repr), fp); + str = SWIG_Python_str_AsChar(repr); + fputs(str, fp); + SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { @@ -1407,53 +1512,71 @@ } SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) +SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; + SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) +SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } +/* Added for Python 3.x, would it also be useful for Python 2.x? */ +SWIGRUNTIME PyObject* +SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) +{ + PyObject* res; + if( op != Py_EQ && op != Py_NE ) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) + res = Py_True; + else + res = Py_False; + Py_INCREF(res); + return res; +} + + SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { +SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); return type; } SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +SwigPyObject_Check(PyObject *op) { + return (Py_TYPE(op) == SwigPyObject_type()) + || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); +SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) +SwigPyObject_dealloc(PyObject *v) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + /* we need to create a temporary object to carry the destroy operation */ + PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { @@ -1475,15 +1598,15 @@ } SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) +SwigPyObject_append(PyObject* v, PyObject* next) { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif - if (!PySwigObject_Check(next)) { + if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; @@ -1493,12 +1616,12 @@ SWIGRUNTIME PyObject* #ifdef METH_NOARGS -PySwigObject_next(PyObject* v) +SwigPyObject_next(PyObject* v) #else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *) v; + SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; @@ -1509,30 +1632,30 @@ SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) +SwigPyObject_disown(PyObject *v) #else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) +SwigPyObject_acquire(PyObject *v) #else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) +SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) @@ -1545,20 +1668,20 @@ } else { - PySwigObject *sobj = (PySwigObject *)v; + SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); + SwigPyObject_acquire(v); } else { - PySwigObject_disown(v); + SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); + SwigPyObject_acquire(v,args); } else { - PySwigObject_disown(v,args); + SwigPyObject_disown(v,args); } #endif } @@ -1569,30 +1692,30 @@ #ifdef METH_O static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) +SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } @@ -1602,11 +1725,14 @@ _PySwigObject_type(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyNumberMethods PySwigObject_as_number = { + static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ + /* nb_divide removed in Python 3 */ +#if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ +#endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ @@ -1620,13 +1746,23 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ +#if PY_VERSION_HEX < 0x03000000 + 0, /*nb_coerce*/ +#endif + (unaryfunc)SwigPyObject_long, /*nb_int*/ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_long, /*nb_long*/ +#else + 0, /*nb_reserved*/ +#endif (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ +#if PY_VERSION_HEX < 0x03000000 + (unaryfunc)SwigPyObject_oct, /*nb_oct*/ + (unaryfunc)SwigPyObject_hex, /*nb_hex*/ +#endif +#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ +#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ @@ -1635,32 +1771,41 @@ #endif }; - static PyTypeObject pyswigobject_type; + static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ +#endif + (char *)"SwigPyObject", /* tp_name */ + sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ + (destructor)SwigPyObject_dealloc, /* tp_dealloc */ + (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ + (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ +#if PY_VERSION_HEX >= 0x03000000 + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ +#else + (cmpfunc)SwigPyObject_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyObject_repr, /* tp_repr */ + &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ + (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1668,7 +1813,7 @@ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ @@ -1685,11 +1830,11 @@ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ - 0, /* tp_is_gc */ + 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ - 0, /* tp_subclasses */ + 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 @@ -1699,17 +1844,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; + swigpyobject_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpyobject_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigobject_type; + return &swigpyobject_type; } SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) +SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; @@ -1728,10 +1876,10 @@ void *pack; swig_type_info *ty; size_t size; -} PySwigPacked; +} SwigPyPacked; SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("", result, v->ty->name); + return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { - return PyString_FromFormat("", v->ty->name); + return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) +SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); + return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { - return PyString_FromString(v->ty->name); + return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; @@ -1778,22 +1926,22 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { +SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); return type; } SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { +SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); + || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) +SwigPyPacked_dealloc(PyObject *v) { - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; + if (SwigPyPacked_Check(v)) { + SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); @@ -1802,28 +1950,37 @@ SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; + static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX>=0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* ob_size */ +#endif + (char *)"SwigPyPacked", /* tp_name */ + sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ + (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ + (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ +#if PY_VERSION_HEX>=0x03000000 + 0, /* tp_reserved in 3.0.1 */ +#else + (cmpfunc)SwigPyPacked_compare, /* tp_compare */ +#endif + (reprfunc)SwigPyPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1862,17 +2019,20 @@ 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; + swigpypacked_type = tmp; + /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 + swigpypacked_type.ob_type = &PyType_Type; +#endif type_init = 1; } - return &pyswigpacked_type; + return &swigpypacked_type; } SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { @@ -1889,10 +2049,10 @@ } SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; + if (SwigPyPacked_Check(obj)) { + SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; @@ -1908,7 +2068,7 @@ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { - return PyString_FromString("this"); + return SWIG_Python_str_FromChar("this"); } SWIGRUNTIME PyObject * @@ -1920,11 +2080,16 @@ /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ -SWIGRUNTIME PySwigObject * +/* TODO: I don't know how to implement the fast getset in Python 3 right now */ +#if PY_VERSION_HEX>=0x03000000 +#define SWIG_PYTHON_SLOW_GETSET_THIS +#endif + +SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; + if (SwigPyObject_Check(pyobj)) { + return (SwigPyObject *) pyobj; } else { PyObject *obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) @@ -1960,12 +2125,12 @@ return 0; } #endif - if (obj && !PySwigObject_Check(obj)) { + if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ + SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } - return (PySwigObject *)obj; + return (SwigPyObject *)obj; } } @@ -1974,7 +2139,7 @@ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; @@ -1993,7 +2158,7 @@ if (ptr) *ptr = 0; return SWIG_OK; } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { @@ -2007,7 +2172,7 @@ } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { - sobj = (PySwigObject *)sobj->next; + sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; @@ -2036,7 +2201,7 @@ } else { int res = SWIG_ERROR; if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { @@ -2049,7 +2214,7 @@ impconv = 0; } if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); @@ -2087,10 +2252,10 @@ /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { + if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } + if (!desc) + return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { @@ -2111,7 +2276,7 @@ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { @@ -2128,12 +2293,12 @@ * ----------------------------------------------------------------------------- */ /* - Create a new instance object, whitout calling __init__, and set the + Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; @@ -2157,10 +2322,16 @@ #endif } } else { +#if PY_VERSION_HEX >= 0x03000000 + inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); + PyObject_SetAttr(inst, SWIG_This(), swig_this); + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; +#else PyObject *dict = PyDict_New(); PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); +#endif } return inst; #else @@ -2223,9 +2394,9 @@ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { return NULL; } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); + SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } @@ -2241,8 +2412,8 @@ return SWIG_Py_Void(); } else { int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + PyObject *robj = SwigPyObject_New(ptr, type, own); + SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); if (inst) { @@ -2258,7 +2429,7 @@ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); + return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* @@ -2329,8 +2500,8 @@ for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); + SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; + if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); @@ -2340,8 +2511,13 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ +#if PY_VERSION_HEX >= 0x03000000 + /* Add a dummy module object into sys.modules */ + PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); +#else PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); +#endif PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); @@ -2361,7 +2537,7 @@ SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); + PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { @@ -2388,21 +2564,23 @@ SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ +{ if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { + char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; @@ -2425,9 +2603,9 @@ } SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) +SwigPyObject_GetDesc(PyObject *self) { - PySwigObject *v = (PySwigObject *)self; + SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : (char*)""; } @@ -2437,10 +2615,10 @@ { if (type) { #if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (obj && SwigPyObject_Check(obj)) { + const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } @@ -2450,10 +2628,11 @@ const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; + const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); + SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); @@ -2475,10 +2654,12 @@ void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { +#if SWIG_POINTER_EXCEPTION + if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } +#endif } return result; } @@ -2518,11 +2699,16 @@ /*----------------------------------------------- @(target):= _dia.so ------------------------------------------------*/ -#define SWIG_init init_dia +#if PY_VERSION_HEX >= 0x03000000 +# define SWIG_init PyInit__dia +#else +# define SWIG_init init_dia + +#endif #define SWIG_name "_dia" -#define SWIGVERSION 0x010336 +#define SWIGVERSION 0x010340 #define SWIG_VERSION SWIGVERSION @@ -2534,28 +2720,28 @@ namespace swig { - class PyObject_ptr { + class SwigPtr_PyObject { protected: PyObject *_obj; public: - PyObject_ptr() :_obj(0) + SwigPtr_PyObject() :_obj(0) { } - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj) { Py_XINCREF(_obj); } - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj) { if (initial_ref) { Py_XINCREF(_obj); } } - PyObject_ptr & operator=(const PyObject_ptr& item) + SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) { Py_XINCREF(item._obj); Py_XDECREF(_obj); @@ -2563,7 +2749,7 @@ return *this; } - ~PyObject_ptr() + ~SwigPtr_PyObject() { Py_XDECREF(_obj); } @@ -2582,10 +2768,10 @@ namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + struct SwigVar_PyObject : SwigPtr_PyObject { + SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { } - PyObject_var & operator = (PyObject* obj) + SwigVar_PyObject & operator = (PyObject* obj) { Py_XDECREF(_obj); _obj = obj; @@ -2595,6 +2781,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" @@ -5583,6 +5770,7 @@ static PyMethodDef SwigMethods[] = { + { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"dia_matvec", _wrap_dia_matvec, METH_VARARGS, (char *)"\n" "dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, \n" " signed char diags, signed char Xx, signed char Yx)\n" @@ -5911,26 +6099,58 @@ SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { +#if PY_VERSION_HEX >= 0x03000000 + return PyUnicode_InternFromString(""); +#else return PyString_FromString(""); +#endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { +#if PY_VERSION_HEX >= 0x03000000 + PyObject *str = PyUnicode_InternFromString("("); + PyObject *tail; + PyObject *joined; + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + tail = PyUnicode_FromString(var->name); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + if (var->next) { + tail = PyUnicode_InternFromString(", "); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; + } + } + tail = PyUnicode_InternFromString(")"); + joined = PyUnicode_Concat(str, tail); + Py_DecRef(str); + Py_DecRef(tail); + str = joined; +#else PyObject *str = PyString_FromString("("); - swig_globalvar *var; + swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); +#endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); + fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); + SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } @@ -5988,12 +6208,17 @@ if (!type_init) { const PyTypeObject tmp = { + /* PyObject header changed in Python 3 */ +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else PyObject_HEAD_INIT(NULL) 0, /* Number of items in variable part (ob_size) */ +#endif (char *)"swigvarlink", /* Type name (tp_name) */ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ (printfunc) swig_varlink_print, /* Print (tp_print) */ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ @@ -6004,7 +6229,7 @@ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ + (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -6025,7 +6250,10 @@ #endif }; varlink_type = tmp; + /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ +#if PY_VERSION_HEX < 0x03000000 varlink_type.ob_type = &PyType_Type; +#endif type_init = 1; } return &varlink_type; @@ -6150,13 +6378,37 @@ #ifdef __cplusplus extern "C" #endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; + +SWIGEXPORT +#if PY_VERSION_HEX >= 0x03000000 +PyObject* +#else +void +#endif +SWIG_init(void) { + PyObject *m, *d; +#if PY_VERSION_HEX >= 0x03000000 + static struct PyModuleDef SWIG_module = { + PyModuleDef_HEAD_INIT, + (char *) SWIG_name, + NULL, + -1, + SwigMethods, + NULL, + NULL, + NULL, + NULL + }; +#endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); +#if PY_VERSION_HEX >= 0x03000000 + m = PyModule_Create(&SWIG_module); +#else m = Py_InitModule((char *) SWIG_name, SwigMethods); +#endif d = PyModule_GetDict(m); SWIG_InitializeModule(0); @@ -6166,5 +6418,10 @@ import_array(); +#if PY_VERSION_HEX >= 0x03000000 + return m; +#else + return; +#endif } From scipy-svn at scipy.org Sat Sep 11 20:51:50 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:51:50 -0500 (CDT) Subject: [Scipy-svn] r6725 - trunk/scipy/sparse/linalg/dsolve Message-ID: <20100912005150.E1E2439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:51:49 -0500 (Sat, 11 Sep 2010) New Revision: 6725 Modified: trunk/scipy/sparse/linalg/dsolve/py3k.h Log: 3K: Fixing up sparse.linalg.dsolve again Modified: trunk/scipy/sparse/linalg/dsolve/py3k.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/py3k.h 2010-09-12 00:51:29 UTC (rev 6724) +++ trunk/scipy/sparse/linalg/dsolve/py3k.h 2010-09-12 00:51:49 UTC (rev 6725) @@ -6,6 +6,7 @@ #if PY_VERSION_HEX >= 0x03000000 #define PyUstring_FromString PyUnicode_FromString #define PyInt_FromLong PyLong_FromLong + #define PyInt_Check PyLong_Check #else #define PyUstring_FromString PyString_FromString #endif From scipy-svn at scipy.org Sat Sep 11 20:52:12 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:52:12 -0500 (CDT) Subject: [Scipy-svn] r6726 - in trunk: scipy/sparse/linalg/dsolve tools Message-ID: <20100912005212.13EE639CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:52:11 -0500 (Sat, 11 Sep 2010) New Revision: 6726 Added: trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h Removed: trunk/scipy/sparse/linalg/dsolve/py3k.h Modified: trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c trunk/scipy/sparse/linalg/dsolve/_superlumodule.c trunk/scipy/sparse/linalg/dsolve/_superluobject.c trunk/scipy/sparse/linalg/dsolve/_superluobject.h trunk/tools/py3tool.py Log: 3K: sparse: fix superlu module build on Py3 Modified: trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:52:11 UTC (rev 6726) @@ -1,7 +1,12 @@ /* Should be imported before Python.h */ -#include "py3k.h" -#include "Python.h" +#include + +#define NO_IMPORT_ARRAY +#define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API + +#include "_superluobject.h" +#include "npy_3kcompat.h" #include jmp_buf _superlu_py_jmpbuf; Modified: trunk/scipy/sparse/linalg/dsolve/_superlumodule.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:52:11 UTC (rev 6726) @@ -14,7 +14,11 @@ #include #include +#define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API +#include + #include "_superluobject.h" +#include "npy_3kcompat.h" extern jmp_buf _superlu_py_jmpbuf; @@ -258,13 +262,18 @@ { PyObject *m, *d; + import_array(); + + if (PyType_Ready(&SciPySuperLUType) < 0) { + return; + } + m = PyModule_Create(&moduledef); d = PyModule_GetDict(m); + Py_INCREF(&PyArrayFlags_Type); PyDict_SetItemString(d, "SciPyLUType", (PyObject *)&SciPySuperLUType); - import_array(); - if (PyErr_Occurred()) Py_FatalError("can't initialize module _superlu"); @@ -278,14 +287,18 @@ { PyObject *m, *d; + import_array(); + SciPySuperLUType.ob_type = &PyType_Type; + if (PyType_Ready(&SciPySuperLUType) < 0) { + return; + } m = Py_InitModule("_superlu", SuperLU_Methods); d = PyModule_GetDict(m); + Py_INCREF(&PyArrayFlags_Type); PyDict_SetItemString(d, "SciPyLUType", (PyObject *)&SciPySuperLUType); - - import_array(); } #endif Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:52:11 UTC (rev 6726) @@ -6,10 +6,12 @@ */ #include -#include "py3k.h" #define NO_IMPORT_ARRAY +#define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API + #include "_superluobject.h" +#include "npy_3kcompat.h" #include #include @@ -158,7 +160,7 @@ PyObject *list = PyList_New(sizeof(members)/sizeof(char *)); if (list != NULL) { for (i = 0; i < sizeof(members)/sizeof(char *); i ++) - PyList_SetItem(list, i, PyUstring_FromString(members[i])); + PyList_SetItem(list, i, PyUString_FromString(members[i])); if (PyErr_Occurred()) { Py_DECREF(list); list = NULL; @@ -206,8 +208,12 @@ "; PyTypeObject SciPySuperLUType = { +#if defined(NPY_PY3K) + PyVarObject_HEAD_INIT(NULL, 0) +#else PyObject_HEAD_INIT(NULL) 0, +#endif "factored_lu", sizeof(SciPyLUObject), 0, @@ -215,7 +221,7 @@ 0, /* tp_print */ (getattrfunc)SciPyLU_getattr, /* tp_getattr */ 0, /* tp_setattr */ - 0, /* tp_compare */ + 0, /* tp_compare / tp_reserved */ 0, /* tp_repr */ 0, /* tp_as_number*/ 0, /* tp_as_sequence*/ @@ -226,8 +232,36 @@ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - 0, /* tp_flags */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ factored_lu_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + SciPyLU_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif }; Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superluobject.h 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/scipy/sparse/linalg/dsolve/_superluobject.h 2010-09-12 00:52:11 UTC (rev 6726) @@ -10,7 +10,6 @@ #include "Python.h" #include "SuperLU/SRC/slu_zdefs.h" -#define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API #include "numpy/arrayobject.h" #include "SuperLU/SRC/slu_util.h" #include "SuperLU/SRC/slu_dcomplex.h" @@ -23,7 +22,7 @@ * SuperLUObject definition */ typedef struct { - PyObject_VAR_HEAD + PyObject_HEAD npy_intp m,n; SuperMatrix L; SuperMatrix U; Added: trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h (rev 0) +++ trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h 2010-09-12 00:52:11 UTC (rev 6726) @@ -0,0 +1,305 @@ +#ifndef _NPY_3KCOMPAT_H_ +#define _NPY_3KCOMPAT_H_ + +#include +#include + +#if PY_VERSION_HEX >= 0x03000000 +#define NPY_PY3K +#endif + +#include "numpy/npy_common.h" +#include "numpy/ndarrayobject.h" + +/* + * PyInt -> PyLong + */ + +#if defined(NPY_PY3K) +/* Return True only if the long fits in a C long */ +static NPY_INLINE int PyInt_Check(PyObject *op) { + int overflow = 0; + if (!PyLong_Check(op)) { + return 0; + } + PyLong_AsLongAndOverflow(op, &overflow); + return (overflow == 0); +} + +#define PyInt_FromLong PyLong_FromLong +#define PyInt_AsLong PyLong_AsLong +#define PyInt_AS_LONG PyLong_AsLong +#define PyInt_AsSsize_t PyLong_AsSsize_t + +/* NOTE: + * + * Since the PyLong type is very different from the fixed-range PyInt, + * we don't define PyInt_Type -> PyLong_Type. + */ +#endif /* NPY_PY3K */ + +/* + * PyString -> PyBytes + */ + +#if defined(NPY_PY3K) + +#define PyString_Type PyBytes_Type +#define PyString_Check PyBytes_Check +#define PyStringObject PyBytesObject +#define PyString_FromString PyBytes_FromString +#define PyString_FromStringAndSize PyBytes_FromStringAndSize +#define PyString_AS_STRING PyBytes_AS_STRING +#define PyString_AsStringAndSize PyBytes_AsStringAndSize +#define PyString_FromFormat PyBytes_FromFormat +#define PyString_Concat PyBytes_Concat +#define PyString_ConcatAndDel PyBytes_ConcatAndDel +#define PyString_AsString PyBytes_AsString +#define PyString_GET_SIZE PyBytes_GET_SIZE +#define PyString_Size PyBytes_Size + +#define PyUString_Type PyUnicode_Type +#define PyUString_Check PyUnicode_Check +#define PyUStringObject PyUnicodeObject +#define PyUString_FromString PyUnicode_FromString +#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize +#define PyUString_FromFormat PyUnicode_FromFormat +#define PyUString_Concat PyUnicode_Concat2 +#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel +#define PyUString_GET_SIZE PyUnicode_GET_SIZE +#define PyUString_Size PyUnicode_Size +#define PyUString_InternFromString PyUnicode_InternFromString +#define PyUString_Format PyUnicode_Format + +#else + +#define PyBytes_Type PyString_Type +#define PyBytes_Check PyString_Check +#define PyBytesObject PyStringObject +#define PyBytes_FromString PyString_FromString +#define PyBytes_FromStringAndSize PyString_FromStringAndSize +#define PyBytes_AS_STRING PyString_AS_STRING +#define PyBytes_AsStringAndSize PyString_AsStringAndSize +#define PyBytes_FromFormat PyString_FromFormat +#define PyBytes_Concat PyString_Concat +#define PyBytes_ConcatAndDel PyString_ConcatAndDel +#define PyBytes_AsString PyString_AsString +#define PyBytes_GET_SIZE PyString_GET_SIZE +#define PyBytes_Size PyString_Size + +#define PyUString_Type PyString_Type +#define PyUString_Check PyString_Check +#define PyUStringObject PyStringObject +#define PyUString_FromString PyString_FromString +#define PyUString_FromStringAndSize PyString_FromStringAndSize +#define PyUString_FromFormat PyString_FromFormat +#define PyUString_Concat PyString_Concat +#define PyUString_ConcatAndDel PyString_ConcatAndDel +#define PyUString_GET_SIZE PyString_GET_SIZE +#define PyUString_Size PyString_Size +#define PyUString_InternFromString PyString_InternFromString +#define PyUString_Format PyString_Format + +#endif /* NPY_PY3K */ + + +static NPY_INLINE void +PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + Py_DECREF(right); + *left = new; +} + +static NPY_INLINE void +PyUnicode_Concat2(PyObject **left, PyObject *right) +{ + PyObject *new; + new = PyUnicode_Concat(*left, right); + Py_DECREF(*left); + *left = new; +} + + +/* + * Accessing items of ob_base + */ + +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + +/* + * PyFile_AsFile + */ +#if defined(NPY_PY3K) +static NPY_INLINE FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); +} +#endif + +static NPY_INLINE PyObject* +npy_PyFile_OpenFile(PyObject *filename, char *mode) +{ + PyObject *open; + open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); + if (open == NULL) { + return NULL; + } + return PyObject_CallFunction(open, "Os", filename, mode); +} + +/* + * PyObject_Cmp + */ +#if defined(NPY_PY3K) +static NPY_INLINE int +PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) +{ + int v; + v = PyObject_RichCompareBool(i1, i2, Py_LT); + if (v == 0) { + *cmp = -1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_GT); + if (v == 0) { + *cmp = 1; + return 1; + } + else if (v == -1) { + return -1; + } + + v = PyObject_RichCompareBool(i1, i2, Py_EQ); + if (v == 0) { + *cmp = 0; + return 1; + } + else { + *cmp = 0; + return -1; + } +} +#endif + +/* + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... + */ +#if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + +#endif + +#endif /* _NPY_3KCOMPAT_H_ */ Deleted: trunk/scipy/sparse/linalg/dsolve/py3k.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/py3k.h 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/scipy/sparse/linalg/dsolve/py3k.h 2010-09-12 00:52:11 UTC (rev 6726) @@ -1,14 +0,0 @@ -#ifndef __NPY_PY3H__ -#define __NPY_PY3H__ - -#include - -#if PY_VERSION_HEX >= 0x03000000 - #define PyUstring_FromString PyUnicode_FromString - #define PyInt_FromLong PyLong_FromLong - #define PyInt_Check PyLong_Check -#else - #define PyUstring_FromString PyString_FromString -#endif - -#endif Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:51:49 UTC (rev 6725) +++ trunk/tools/py3tool.py 2010-09-12 00:52:11 UTC (rev 6726) @@ -175,7 +175,7 @@ os.path.join('spatial', '__init__.py'), os.path.join('spatial', 'distance.py'), os.path.join('sparse', 'linalg', 'isolve', 'iterative.py'), - os.path.join('sparse', 'linalg', 'dsolve', '_superlu.py'), + os.path.join('sparse', 'linalg', 'dsolve', 'linsolve.py'), os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'arpack.py'), os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'speigs.py'), os.path.join('sparse', 'linalg', 'iterative', 'isolve', 'iterative.py'), @@ -199,8 +199,7 @@ 'futil', 'mvn', '_nd_image', 'numpyio', - '_zsuperlu', '_ssuperlu', '_dsuperlu', '_csuperlu', - '_arpack', '_iterative', + '_superlu', '_arpack', '_iterative', ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 20:52:27 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:52:27 -0500 (CDT) Subject: [Scipy-svn] r6727 - trunk/scipy/sparse/sparsetools Message-ID: <20100912005227.2CA0739CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:52:26 -0500 (Sat, 11 Sep 2010) New Revision: 6727 Modified: trunk/scipy/sparse/sparsetools/py3k.h Log: 3K: sparse: add py3k.h for sparsetools Modified: trunk/scipy/sparse/sparsetools/py3k.h =================================================================== --- trunk/scipy/sparse/sparsetools/py3k.h 2010-09-12 00:52:11 UTC (rev 6726) +++ trunk/scipy/sparse/sparsetools/py3k.h 2010-09-12 00:52:26 UTC (rev 6727) @@ -1,22 +1,23 @@ -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#include -#error YOYOYO +/* + * Undefine macros defined by SWIG + */ +#if PY_VERSION_HEX >= 0x03000000 + +#ifdef PyInt_Check +#undef PyInt_Check #endif -#include -#if PY_VERSION_HEX >= 0x03000000 - #define PyString_Check PyUnicode_Check - static int __pyfile_check_guard(PyObject *x) - { - fprintf(stderr, "PY3K error: PyFile_Check called !\n"); - return 0; - } - #define PyFile_Check(x) __pyfile_check_guard((x)) - static int __pyinstance_check_guard(PyObject *x) - { - fprintf(stderr, "PY3K error: PyInstance_Check calleed !\n"); - return 0; - } - #define PyInstance_Check(x) __pyinstance_check_guard((x)) +static int __pyfile_check_guard(PyObject *x) +{ + return 0; +} +#define PyFile_Check(x) __pyfile_check_guard((x)) +static int __pyinstance_check_guard(PyObject *x) +{ + return 0; +} +#define PyInstance_Check(x) __pyinstance_check_guard((x)) + #endif + +#include "numpy/npy_3kcompat.h" From scipy-svn at scipy.org Sat Sep 11 20:52:41 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:52:41 -0500 (CDT) Subject: [Scipy-svn] r6728 - trunk/scipy/sparse/sparsetools Message-ID: <20100912005241.9E01239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:52:41 -0500 (Sat, 11 Sep 2010) New Revision: 6728 Modified: trunk/scipy/sparse/sparsetools/csgraph_wrap.cxx Log: GEN: sparse: regenerate sparsetools/csgraph_wrap.i Modified: trunk/scipy/sparse/sparsetools/csgraph_wrap.cxx =================================================================== --- trunk/scipy/sparse/sparsetools/csgraph_wrap.cxx 2010-09-12 00:52:26 UTC (rev 6727) +++ trunk/scipy/sparse/sparsetools/csgraph_wrap.cxx 2010-09-12 00:52:41 UTC (rev 6728) @@ -2781,6 +2781,7 @@ } +#include "py3k.h" #define SWIG_FILE_WITH_INIT #include "Python.h" #include "numpy/arrayobject.h" From scipy-svn at scipy.org Sat Sep 11 20:52:56 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:52:56 -0500 (CDT) Subject: [Scipy-svn] r6729 - trunk/scipy/sparse Message-ID: <20100912005256.391B039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:52:55 -0500 (Sat, 11 Sep 2010) New Revision: 6729 Modified: trunk/scipy/sparse/bsr.py trunk/scipy/sparse/compressed.py trunk/scipy/sparse/csr.py trunk/scipy/sparse/spfuncs.py Log: 3K: sparse: fix several integer divisions Modified: trunk/scipy/sparse/bsr.py =================================================================== --- trunk/scipy/sparse/bsr.py 2010-09-12 00:52:41 UTC (rev 6728) +++ trunk/scipy/sparse/bsr.py 2010-09-12 00:52:55 UTC (rev 6729) @@ -121,7 +121,7 @@ if (M % R) != 0 or (N % C) != 0: raise ValueError, 'shape must be multiple of blocksize' - self.indptr = np.zeros(M/R + 1, dtype=np.intc ) + self.indptr = np.zeros(M//R + 1, dtype=np.intc ) elif len(arg1) == 2: # (data,(row,col)) format @@ -205,10 +205,10 @@ raise ValueError,"data should be rank 3" # check index pointer - if (len(self.indptr) != M/R + 1 ): + if (len(self.indptr) != M//R + 1 ): raise ValueError, \ "index pointer size (%d) should be (%d)" % \ - (len(self.indptr), M/R + 1) + (len(self.indptr), M//R + 1) if (self.indptr[0] != 0): raise ValueError,"index pointer should start with 0" @@ -225,9 +225,9 @@ if full_check: #check format validity (more expensive) if self.nnz > 0: - if self.indices.max() >= N/C: + if self.indices.max() >= N//C: print "max index",self.indices.max() - raise ValueError, "column index values must be < %d" % (N/C) + raise ValueError, "column index values must be < %d" % (N//C) if self.indices.min() < 0: raise ValueError, "column index values must be >= 0" if diff(self.indptr).min() < 0: @@ -262,7 +262,7 @@ M,N = self.shape R,C = self.blocksize y = np.empty(min(M,N), dtype=upcast(self.dtype)) - sparsetools.bsr_diagonal(M/R, N/C, R, C, \ + sparsetools.bsr_diagonal(M//R, N//C, R, C, \ self.indptr, self.indices, np.ravel(self.data), y) return y @@ -295,7 +295,7 @@ result = np.zeros(self.shape[0], dtype=upcast(self.dtype, other.dtype)) - bsr_matvec(M/R, N/C, R, C, \ + bsr_matvec(M//R, N//C, R, C, \ self.indptr, self.indices, self.data.ravel(), other, result) @@ -308,7 +308,7 @@ result = np.zeros((M,n_vecs), dtype=upcast(self.dtype,other.dtype)) - bsr_matvecs(M/R, N/C, n_vecs, R, C, \ + bsr_matvecs(M//R, N//C, n_vecs, R, C, \ self.indptr, self.indices, self.data.ravel(), \ other.ravel(), result.ravel()) @@ -335,7 +335,7 @@ else: other = other.tobsr(blocksize=(n,C)) - csr_matmat_pass1( M/R, N/C, \ + csr_matmat_pass1( M//R, N//C, \ self.indptr, self.indices, \ other.indptr, other.indices, \ indptr) @@ -344,7 +344,7 @@ indices = np.empty(bnnz, dtype=np.intc) data = np.empty(R*C*bnnz, dtype=upcast(self.dtype,other.dtype)) - bsr_matmat_pass2( M/R, N/C, R, C, n, \ + bsr_matmat_pass2( M//R, N//C, R, C, n, \ self.indptr, self.indices, np.ravel(self.data), \ other.indptr, other.indices, np.ravel(other.data), \ indptr, indices, data) @@ -387,7 +387,7 @@ M,N = self.shape R,C = self.blocksize - row = (R * np.arange(M/R)).repeat(np.diff(self.indptr)) + row = (R * np.arange(M//R)).repeat(np.diff(self.indptr)) row = row.repeat(R*C).reshape(-1,R,C) row += np.tile(np.arange(R).reshape(-1,1), (1,C)) row = row.reshape(-1) @@ -409,16 +409,16 @@ R,C = self.blocksize M,N = self.shape - NBLK = self.nnz/(R*C) + NBLK = self.nnz//(R*C) if self.nnz == 0: return bsr_matrix((N,M), blocksize=(C,R)) - indptr = np.empty( N/C + 1, dtype=self.indptr.dtype) + indptr = np.empty( N//C + 1, dtype=self.indptr.dtype) indices = np.empty( NBLK, dtype=self.indices.dtype) data = np.empty( (NBLK,C,R), dtype=self.data.dtype) - bsr_transpose(M/R, N/C, R, C, \ + bsr_transpose(M//R, N//C, R, C, \ self.indptr, self.indices, self.data.ravel(), \ indptr, indices, data.ravel()) @@ -445,7 +445,7 @@ from csr import csr_matrix # modifies self.indptr and self.indices *in place* - proxy = csr_matrix((mask,self.indices,self.indptr),shape=(M/R,N/C)) + proxy = csr_matrix((mask,self.indices,self.indptr),shape=(M//R,N//C)) proxy.eliminate_zeros() self.prune() @@ -463,7 +463,7 @@ R,C = self.blocksize M,N = self.shape - bsr_sort_indices(M/R, N/C, R, C, self.indptr, self.indices, self.data.ravel()) + bsr_sort_indices(M//R, N//C, R, C, self.indptr, self.indices, self.data.ravel()) self.has_sorted_indices = True @@ -474,7 +474,7 @@ R,C = self.blocksize M,N = self.shape - if len(self.indptr) != M/R + 1: + if len(self.indptr) != M//R + 1: raise ValueError, "index pointer has invalid length" bnnz = self.indptr[-1] @@ -505,7 +505,7 @@ indices = np.empty(max_bnnz, dtype=np.intc) data = np.empty(R*C*max_bnnz, dtype=upcast(self.dtype,other.dtype)) - fn(self.shape[0]/R, self.shape[1]/C, R, C, + fn(self.shape[0]//R, self.shape[1]//C, R, C, self.indptr, self.indices, np.ravel(self.data), other.indptr, other.indices, np.ravel(other.data), indptr, indices, data) Modified: trunk/scipy/sparse/compressed.py =================================================================== --- trunk/scipy/sparse/compressed.py 2010-09-12 00:52:41 UTC (rev 6728) +++ trunk/scipy/sparse/compressed.py 2010-09-12 00:52:55 UTC (rev 6729) @@ -698,7 +698,7 @@ actual_nnz = indptr[-1] indices = indices[:actual_nnz] data = data[:actual_nnz] - if actual_nnz < maxnnz / 2: + if actual_nnz < maxnnz // 2: #too much waste, trim arrays indices = indices.copy() data = data.copy() Modified: trunk/scipy/sparse/csr.py =================================================================== --- trunk/scipy/sparse/csr.py 2010-09-12 00:52:41 UTC (rev 6728) +++ trunk/scipy/sparse/csr.py 2010-09-12 00:52:55 UTC (rev 6729) @@ -159,7 +159,7 @@ blks = csr_count_blocks(M,N,R,C,self.indptr,self.indices) - indptr = np.empty(M/R + 1, dtype=np.intc) + indptr = np.empty(M//R + 1, dtype=np.intc) indices = np.empty(blks, dtype=np.intc) data = np.zeros((blks,R,C), dtype=self.dtype) Modified: trunk/scipy/sparse/spfuncs.py =================================================================== --- trunk/scipy/sparse/spfuncs.py 2010-09-12 00:52:41 UTC (rev 6728) +++ trunk/scipy/sparse/spfuncs.py 2010-09-12 00:52:55 UTC (rev 6729) @@ -22,7 +22,7 @@ # M,N = A.shape # R,C = A.blocksize # y = empty( min(M,N), dtype=upcast(A.dtype) ) -# fn = sparsetools.bsr_diagonal(M/R, N/C, R, C, \ +# fn = sparsetools.bsr_diagonal(M//R, N//C, R, C, \ # A.indptr, A.indices, ravel(A.data), y) # return y # else: From scipy-svn at scipy.org Sat Sep 11 20:53:10 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:53:10 -0500 (CDT) Subject: [Scipy-svn] r6730 - trunk/scipy/sparse/linalg/dsolve Message-ID: <20100912005310.E06F839CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:53:10 -0500 (Sat, 11 Sep 2010) New Revision: 6730 Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.c Log: 3K: sparse.linalg: fix PyString/PyUnicode issues in _superluobject Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:52:55 UTC (rev 6729) +++ trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:53:10 UTC (rev 6730) @@ -41,7 +41,11 @@ SciPyLU_solve(SciPyLUObject *self, PyObject *args, PyObject *kwds) { PyArrayObject *b, *x=NULL; SuperMatrix B; +#ifndef NPY_PY3K char itrans = 'N'; +#else + int itrans = 'N'; +#endif int info; trans_t trans; SuperLUStat_t stat; @@ -53,7 +57,11 @@ return NULL; } +#ifndef NPY_PY3K if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|c", kwlist, +#else + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|C", kwlist, +#endif &PyArray_Type, &b, &itrans)) return NULL; @@ -474,20 +482,31 @@ #define ENUM_CHECK_INIT \ long i = -1; \ char *s = ""; \ + PyObject *tmpobj = NULL; \ if (input == Py_None) return 1; \ if (PyString_Check(input)) { \ s = PyString_AS_STRING(input); \ } \ - if (PyInt_Check(input)) { \ + else if (PyUnicode_Check(input)) { \ + tmpobj = PyUnicode_AsASCIIString(input);\ + if (tmpobj == NULL) return 0; \ + s = PyString_AS_STRING(tmpobj); \ + } \ + else if (PyInt_Check(input)) { \ i = PyInt_AsLong(input); \ } #define ENUM_CHECK_FINISH(message) \ + Py_XDECREF(tmpobj); \ PyErr_SetString(PyExc_ValueError, message); \ return 0; -#define ENUM_CHECK(name) \ - if (my_strxcmp(s, #name) == 0 || i == (long)name) { *value = name; return 1; } +#define ENUM_CHECK(name) \ + if (my_strxcmp(s, #name) == 0 || i == (long)name) { \ + *value = name; \ + Py_XDECREF(tmpobj); \ + return 1; \ + } /* * Compare strings ignoring case, underscores and whitespace @@ -628,6 +647,18 @@ if (seq == NULL || !PySequence_Check(seq)) goto fail; } + else if (PyUnicode_Check(input)) { + /* Comma-separated string */ + PyObject *s; + int ret; + s = PyUnicode_AsASCIIString(input); + if (s == NULL) { + goto fail; + } + ret = droprule_cvt(s, value); + Py_DECREF(s); + return ret; + } else if (PySequence_Check(input)) { /* Sequence of strings or integers */ seq = input; From scipy-svn at scipy.org Sat Sep 11 20:53:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:53:23 -0500 (CDT) Subject: [Scipy-svn] r6731 - trunk/scipy/sparse Message-ID: <20100912005323.10EB239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:53:22 -0500 (Sat, 11 Sep 2010) New Revision: 6731 Modified: trunk/scipy/sparse/dok.py Log: 3K: sparse: operator module no longer contains isSequenceType Modified: trunk/scipy/sparse/dok.py =================================================================== --- trunk/scipy/sparse/dok.py 2010-09-12 00:53:10 UTC (rev 6730) +++ trunk/scipy/sparse/dok.py 2010-09-12 00:53:22 UTC (rev 6731) @@ -4,7 +4,6 @@ __all__ = ['dok_matrix', 'isspmatrix_dok'] -import operator from itertools import izip import numpy as np @@ -12,6 +11,13 @@ from base import spmatrix, isspmatrix from sputils import isdense, getdtype, isshape, isintlike, isscalarlike, upcast +try: + from operator import isSequenceType as _is_sequence +except ImportError: + def _is_sequence(x): + return (hasattr(x, '__len__') or hasattr(x, '__next__') + or hasattr(x, 'next')) + class dok_matrix(spmatrix, dict): """ Dictionary Of Keys based sparse matrix. @@ -137,7 +143,7 @@ if isinstance(i, slice): # Is there an easier way to do this? seq = xrange(i.start or 0, i.stop or self.shape[0], i.step or 1) - elif operator.isSequenceType(i): + elif _is_sequence(i): seq = i else: # Make sure i is an integer. (But allow it to be a subclass of int). @@ -176,7 +182,7 @@ if isinstance(j, slice): # Is there an easier way to do this? seq = xrange(j.start or 0, j.stop or self.shape[1], j.step or 1) - elif operator.isSequenceType(j): + elif _is_sequence(j): seq = j else: # j is not an integer @@ -232,7 +238,7 @@ if isinstance(i, slice): # Is there an easier way to do this? seq = xrange(i.start or 0, i.stop or self.shape[0], i.step or 1) - elif operator.isSequenceType(i): + elif _is_sequence(i): seq = i else: # Make sure i is an integer. (But allow it to be a subclass of int). @@ -273,7 +279,7 @@ # Process j if isinstance(j, slice): seq = xrange(j.start or 0, j.stop or self.shape[1], j.step or 1) - elif operator.isSequenceType(j): + elif _is_sequence(j): seq = j else: # j is not an integer From scipy-svn at scipy.org Sat Sep 11 20:53:38 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:53:38 -0500 (CDT) Subject: [Scipy-svn] r6732 - trunk/scipy/sparse/linalg/eigen/lobpcg Message-ID: <20100912005338.3CBCB39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:53:38 -0500 (Sat, 11 Sep 2010) New Revision: 6732 Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py Log: 3K: sparse.linalg.eigen: inject __call__ in a Py3 compatible way Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2010-09-12 00:53:22 UTC (rev 6731) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/lobpcg.py 2010-09-12 00:53:38 UTC (rev 6732) @@ -10,6 +10,7 @@ Examples in tests directory contributed by Nils Wagner. """ +import sys import numpy as np import scipy as sp @@ -81,6 +82,10 @@ aux.shape = (ar.shape[0], 1) return aux +class CallableLinearOperator(LinearOperator): + def __call__(self, x): + return self.matmat(x) + def makeOperator( operatorInput, expectedShape ): """Internal. Takes a dense numpy array or a sparse matrix or a function and makes an operator performing matrix * blockvector @@ -103,7 +108,11 @@ if operator.shape != expectedShape: raise ValueError('operator has invalid shape') - operator.__call__ = operator.matmat + if sys.version_info[0] >= 3: + # special methods are looked up on the class -- so make a new one + operator.__class__ = CallableLinearOperator + else: + operator.__call__ = operator.matmat return operator From scipy-svn at scipy.org Sat Sep 11 20:53:57 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:53:57 -0500 (CDT) Subject: [Scipy-svn] r6733 - in trunk/scipy/sparse: linalg/eigen/arpack/tests tests Message-ID: <20100912005357.A052539CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:53:57 -0500 (Sat, 11 Sep 2010) New Revision: 6733 Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py trunk/scipy/sparse/tests/test_spfuncs.py Log: 3K: sparse: fix integer division in tests Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-12 00:53:38 UTC (rev 6732) +++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-12 00:53:57 UTC (rev 6733) @@ -84,8 +84,8 @@ return eval[:k] if which=='BE': # one ev from each end - if k is odd, extra ev on high end - l=k/2 - h=k/2+k%2 + l=k//2 + h=k//2+k%2 low=range(len(eval))[:l] high=range(len(eval))[-h:] return eval[low+high] Modified: trunk/scipy/sparse/tests/test_spfuncs.py =================================================================== --- trunk/scipy/sparse/tests/test_spfuncs.py 2010-09-12 00:53:38 UTC (rev 6732) +++ trunk/scipy/sparse/tests/test_spfuncs.py 2010-09-12 00:53:57 UTC (rev 6733) @@ -73,7 +73,7 @@ def gold(A,bs): R,C = bs I,J = A.nonzero() - return len( set( zip(I/R,J/C) ) ) + return len( set( zip(I//R,J//C) ) ) mats = [] mats.append( [[0]] ) From scipy-svn at scipy.org Sat Sep 11 20:54:09 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:54:09 -0500 (CDT) Subject: [Scipy-svn] r6734 - trunk/tools Message-ID: <20100912005409.63ED039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:54:09 -0500 (Sat, 11 Sep 2010) New Revision: 6734 Modified: trunk/tools/py3tool.py Log: 3K: handle scipy.sparse.linalg.dsolve.umfpack._umfpack imports properly Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:53:57 UTC (rev 6733) +++ trunk/tools/py3tool.py 2010-09-12 00:54:09 UTC (rev 6734) @@ -176,6 +176,7 @@ os.path.join('spatial', 'distance.py'), os.path.join('sparse', 'linalg', 'isolve', 'iterative.py'), os.path.join('sparse', 'linalg', 'dsolve', 'linsolve.py'), + os.path.join('sparse', 'linalg', 'dsolve', 'umfpack', 'umfpack.py'), os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'arpack.py'), os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'speigs.py'), os.path.join('sparse', 'linalg', 'iterative', 'isolve', 'iterative.py'), @@ -199,7 +200,7 @@ 'futil', 'mvn', '_nd_image', 'numpyio', - '_superlu', '_arpack', '_iterative', + '_superlu', '_arpack', '_iterative', '_umfpack' ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 20:54:22 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:54:22 -0500 (CDT) Subject: [Scipy-svn] r6735 - trunk/scipy/fftpack Message-ID: <20100912005422.BE6C039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:54:22 -0500 (Sat, 11 Sep 2010) New Revision: 6735 Modified: trunk/scipy/fftpack/basic.py trunk/scipy/fftpack/helper.py Log: 3K: fftpack: fix integer division in rfftfreq, and remove its duplicated copy Modified: trunk/scipy/fftpack/basic.py =================================================================== --- trunk/scipy/fftpack/basic.py 2010-09-12 00:54:09 UTC (rev 6734) +++ trunk/scipy/fftpack/basic.py 2010-09-12 00:54:22 UTC (rev 6735) @@ -4,7 +4,7 @@ # Created by Pearu Peterson, August,September 2002 __all__ = ['fft','ifft','fftn','ifftn','rfft','irfft', - 'fft2','ifft2', 'rfftfreq'] + 'fft2','ifft2'] from numpy import zeros, swapaxes, integer, array import numpy @@ -251,22 +251,6 @@ return _raw_fft(tmp,n,axis,1,overwrite_x,work_function) -def rfftfreq(n,d=1.0): - """ rfftfreq(n, d=1.0) -> f - - DFT sample frequencies (for usage with rfft,irfft). - - The returned float array contains the frequency bins in - cycles/unit (with zero at the start) given a window length n and a - sample spacing d: - - f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2]/(d*n) if n is even - f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2,n/2]/(d*n) if n is odd - """ - assert isinstance(n,int) or isinstance(n,integer) - return array(range(1,n+1),dtype=int)/2/float(n*d) - - def irfft(x, n=None, axis=-1, overwrite_x=0): """ irfft(x, n=None, axis=-1, overwrite_x=0) -> y Modified: trunk/scipy/fftpack/helper.py =================================================================== --- trunk/scipy/fftpack/helper.py 2010-09-12 00:54:09 UTC (rev 6734) +++ trunk/scipy/fftpack/helper.py 2010-09-12 00:54:22 UTC (rev 6735) @@ -16,4 +16,4 @@ f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2,n/2]/(d*n) if n is odd """ assert isinstance(n,int) - return array(range(1,n+1),dtype=int)/2/float(n*d) + return (array(range(1,n+1),dtype=int)//2)/float(n*d) From scipy-svn at scipy.org Sat Sep 11 20:54:36 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:54:36 -0500 (CDT) Subject: [Scipy-svn] r6736 - trunk/scipy/interpolate/tests Message-ID: <20100912005436.2B36D39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:54:35 -0500 (Sat, 11 Sep 2010) New Revision: 6736 Modified: trunk/scipy/interpolate/tests/test_interpolate.py Log: 3K: interpolate/tests: don't use test generators since they work badly on Py3 Modified: trunk/scipy/interpolate/tests/test_interpolate.py =================================================================== --- trunk/scipy/interpolate/tests/test_interpolate.py 2010-09-12 00:54:22 UTC (rev 6735) +++ trunk/scipy/interpolate/tests/test_interpolate.py 2010-09-12 00:54:35 UTC (rev 6736) @@ -219,8 +219,8 @@ def test_bounds(self): for kind in ('linear', 'cubic', 'nearest', 'slinear', 'zero', 'quadratic'): - yield self._bounds_check, kind - yield self._bounds_check_int_nan_fill, kind + self._bounds_check(kind) + self._bounds_check_int_nan_fill(kind) def _nd_check_interp(self, kind='linear'): """Check the behavior when the inputs and outputs are multidimensional. @@ -289,8 +289,8 @@ def test_nd(self): for kind in ('linear', 'cubic', 'slinear', 'quadratic', 'nearest'): - yield self._nd_check_interp, kind - yield self._nd_check_shape, kind + self._nd_check_interp(kind) + self._nd_check_shape(kind) def _check_complex(self, dtype=np.complex_, kind='linear'): x = np.array([1, 2.5, 3, 3.1, 4, 6.4, 7.9, 8.0, 9.5, 10]) @@ -311,8 +311,8 @@ def test_complex(self): for kind in ('linear', 'nearest', 'cubic', 'slinear', 'quadratic', 'zero'): - yield self._check_complex, np.complex64, kind - yield self._check_complex, np.complex128, kind + self._check_complex(np.complex64, kind) + self._check_complex(np.complex128, kind) @dec.knownfailureif(True, "zero-order splines fail for the last point") def test_nd_zero_spline(self): From scipy-svn at scipy.org Sat Sep 11 20:54:54 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:54:54 -0500 (CDT) Subject: [Scipy-svn] r6737 - trunk/scipy/linalg Message-ID: <20100912005454.E909639CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:54:54 -0500 (Sat, 11 Sep 2010) New Revision: 6737 Modified: trunk/scipy/linalg/atlas_version.c Log: 3K: linalg: convert atlas_version.c module init to Py3 Modified: trunk/scipy/linalg/atlas_version.c =================================================================== --- trunk/scipy/linalg/atlas_version.c 2010-09-12 00:54:35 UTC (rev 6736) +++ trunk/scipy/linalg/atlas_version.c 2010-09-12 00:54:54 UTC (rev 6737) @@ -20,14 +20,40 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "atlas_version", + NULL, + -1, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit_atlas_version(void) +{ +#define RETVAL m + PyObject *m; + m = PyModule_Create(&moduledef); +#else +#define RETVAL PyMODINIT_FUNC initatlas_version(void) { PyObject *m = NULL; m = Py_InitModule("atlas_version", module_methods); +#endif + if (m == NULL) { + return RETVAL; + } #if defined(ATLAS_INFO) { PyObject *d = PyModule_GetDict(m); PyDict_SetItemString(d,"ATLAS_VERSION",PyString_FromString(ATLAS_INFO)); } #endif + return RETVAL; } From scipy-svn at scipy.org Sat Sep 11 20:55:09 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:55:09 -0500 (CDT) Subject: [Scipy-svn] r6738 - trunk/scipy/linalg/tests Message-ID: <20100912005509.16D3F39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:55:08 -0500 (Sat, 11 Sep 2010) New Revision: 6738 Modified: trunk/scipy/linalg/tests/test_build.py Log: 3K: linalg: fix a bytes vs strings issue in a test Modified: trunk/scipy/linalg/tests/test_build.py =================================================================== --- trunk/scipy/linalg/tests/test_build.py 2010-09-12 00:54:54 UTC (rev 6737) +++ trunk/scipy/linalg/tests/test_build.py 2010-09-12 00:55:08 UTC (rev 6738) @@ -4,6 +4,7 @@ import numpy as np from numpy.testing import TestCase, dec +from numpy.compat import asbytes from scipy.linalg import flapack @@ -29,7 +30,7 @@ def grep_dependencies(self, file, deps): stdout = self.get_dependencies(file) - rdeps = dict([(dep, re.compile(dep)) for dep in deps]) + rdeps = dict([(asbytes(dep), re.compile(asbytes(dep))) for dep in deps]) founds = [] for l in stdout.splitlines(): for k, v in rdeps.items(): From scipy-svn at scipy.org Sat Sep 11 20:55:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:55:23 -0500 (CDT) Subject: [Scipy-svn] r6739 - trunk/scipy/linalg Message-ID: <20100912005523.43D4239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:55:22 -0500 (Sat, 11 Sep 2010) New Revision: 6739 Modified: trunk/scipy/linalg/decomp.py Log: 3K: linalg: fix an integer division issue in _make_complex_eigvecs Modified: trunk/scipy/linalg/decomp.py =================================================================== --- trunk/scipy/linalg/decomp.py 2010-09-12 00:55:08 UTC (rev 6738) +++ trunk/scipy/linalg/decomp.py 2010-09-12 00:55:22 UTC (rev 6739) @@ -38,7 +38,7 @@ vnew.imag = numpy.take(vin, ind[1::2],1) count = 0 conj = numpy.conjugate - for i in range(len(ind)/2): + for i in range(len(ind)//2): v[:, ind[2*i]] = vnew[:, count] v[:, ind[2*i+1]] = conj(vnew[:, count]) count += 1 From scipy-svn at scipy.org Sat Sep 11 20:55:36 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:55:36 -0500 (CDT) Subject: [Scipy-svn] r6740 - trunk/scipy/ndimage Message-ID: <20100912005536.1255439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:55:35 -0500 (Sat, 11 Sep 2010) New Revision: 6740 Modified: trunk/scipy/ndimage/filters.py Log: 3K: ndimage: avoid clash with filter() and 2to3 Modified: trunk/scipy/ndimage/filters.py =================================================================== --- trunk/scipy/ndimage/filters.py 2010-09-12 00:55:22 UTC (rev 6739) +++ trunk/scipy/ndimage/filters.py 2010-09-12 00:55:35 UTC (rev 6740) @@ -750,12 +750,12 @@ axes = [(axes[ii], sizes[ii], origins[ii]) for ii in range(len(axes)) if sizes[ii] > 1] if minimum: - filter = minimum_filter1d + filter_ = minimum_filter1d else: - filter = maximum_filter1d + filter_ = maximum_filter1d if len(axes) > 0: for axis, size, origin in axes: - filter(input, int(size), axis, output, mode, cval, origin) + filter_(input, int(size), axis, output, mode, cval, origin) input = output else: output[...] = input[...] From scipy-svn at scipy.org Sat Sep 11 20:55:48 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:55:48 -0500 (CDT) Subject: [Scipy-svn] r6741 - trunk/scipy/ndimage Message-ID: <20100912005548.8262D39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:55:48 -0500 (Sat, 11 Sep 2010) New Revision: 6741 Modified: trunk/scipy/ndimage/interpolation.py Log: 3K: ndimage: fix integer division in rotate Modified: trunk/scipy/ndimage/interpolation.py =================================================================== --- trunk/scipy/ndimage/interpolation.py 2010-09-12 00:55:35 UTC (rev 6740) +++ trunk/scipy/ndimage/interpolation.py 2010-09-12 00:55:48 UTC (rev 6741) @@ -652,8 +652,8 @@ else: coordinates = [] size = numpy.product(input.shape,axis=0) - size /= input.shape[axes[0]] - size /= input.shape[axes[1]] + size //= input.shape[axes[0]] + size //= input.shape[axes[1]] for ii in range(input.ndim): if ii not in axes: coordinates.append(0) From scipy-svn at scipy.org Sat Sep 11 20:56:02 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:56:02 -0500 (CDT) Subject: [Scipy-svn] r6742 - trunk/scipy/ndimage/tests Message-ID: <20100912005602.12AB939CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:56:01 -0500 (Sat, 11 Sep 2010) New Revision: 6742 Modified: trunk/scipy/ndimage/tests/test_ndimage.py Log: 3K: ndimage: fix another 2to3 clash with filter keyword Modified: trunk/scipy/ndimage/tests/test_ndimage.py =================================================================== --- trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 00:55:48 UTC (rev 6741) +++ trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 00:56:01 UTC (rev 6742) @@ -1138,7 +1138,7 @@ def test_generic_filter01(self): "generic filter 1" - filter = numpy.array([[1.0, 2.0], [3.0, 4.0]]) + filter_ = numpy.array([[1.0, 2.0], [3.0, 4.0]]) footprint = numpy.array([[1, 0], [0, 1]]) cf = numpy.array([1., 4.]) def _filter_func(buffer, weights, total = 1.0): @@ -1147,7 +1147,7 @@ for type in self.types: a = numpy.arange(12, dtype = type) a.shape = (3,4) - r1 = ndimage.correlate(a, filter * footprint) / 5 + r1 = ndimage.correlate(a, filter_ * footprint) / 5 r2 = ndimage.generic_filter(a, _filter_func, footprint = footprint, extra_arguments = (cf,), extra_keywords = {'total': cf.sum()}) From scipy-svn at scipy.org Sat Sep 11 20:56:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:56:29 -0500 (CDT) Subject: [Scipy-svn] r6743 - in trunk/scipy: integrate io ndimage/src odr sparse/linalg/dsolve Message-ID: <20100912005629.5E73139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:56:29 -0500 (Sat, 11 Sep 2010) New Revision: 6743 Removed: trunk/scipy/integrate/npy_3kcompat.h trunk/scipy/io/npy_3kcompat.h trunk/scipy/ndimage/src/npy_3kcompat.h trunk/scipy/odr/npy_3kcompat.h trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h Modified: trunk/scipy/integrate/multipack.h trunk/scipy/integrate/quadpack.h trunk/scipy/ndimage/src/nd_image.h trunk/scipy/odr/odrpack.h trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c trunk/scipy/sparse/linalg/dsolve/_superlumodule.c trunk/scipy/sparse/linalg/dsolve/_superluobject.c Log: 3K: use npy_3kcompat.h directly from Numpy Modified: trunk/scipy/integrate/multipack.h =================================================================== --- trunk/scipy/integrate/multipack.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/integrate/multipack.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -29,7 +29,7 @@ */ #include "Python.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "numpy/arrayobject.h" Deleted: trunk/scipy/integrate/npy_3kcompat.h =================================================================== --- trunk/scipy/integrate/npy_3kcompat.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/integrate/npy_3kcompat.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,305 +0,0 @@ -#ifndef _NPY_3KCOMPAT_H_ -#define _NPY_3KCOMPAT_H_ - -#include -#include - -#if PY_VERSION_HEX >= 0x03000000 -#define NPY_PY3K -#endif - -#include "numpy/npy_common.h" -#include "numpy/ndarrayobject.h" - -/* - * PyInt -> PyLong - */ - -#if defined(NPY_PY3K) -/* Return True only if the long fits in a C long */ -static NPY_INLINE int PyInt_Check(PyObject *op) { - int overflow = 0; - if (!PyLong_Check(op)) { - return 0; - } - PyLong_AsLongAndOverflow(op, &overflow); - return (overflow == 0); -} - -#define PyInt_FromLong PyLong_FromLong -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AS_LONG PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -/* NOTE: - * - * Since the PyLong type is very different from the fixed-range PyInt, - * we don't define PyInt_Type -> PyLong_Type. - */ -#endif /* NPY_PY3K */ - -/* - * PyString -> PyBytes - */ - -#if defined(NPY_PY3K) - -#define PyString_Type PyBytes_Type -#define PyString_Check PyBytes_Check -#define PyStringObject PyBytesObject -#define PyString_FromString PyBytes_FromString -#define PyString_FromStringAndSize PyBytes_FromStringAndSize -#define PyString_AS_STRING PyBytes_AS_STRING -#define PyString_AsStringAndSize PyBytes_AsStringAndSize -#define PyString_FromFormat PyBytes_FromFormat -#define PyString_Concat PyBytes_Concat -#define PyString_ConcatAndDel PyBytes_ConcatAndDel -#define PyString_AsString PyBytes_AsString -#define PyString_GET_SIZE PyBytes_GET_SIZE -#define PyString_Size PyBytes_Size - -#define PyUString_Type PyUnicode_Type -#define PyUString_Check PyUnicode_Check -#define PyUStringObject PyUnicodeObject -#define PyUString_FromString PyUnicode_FromString -#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize -#define PyUString_FromFormat PyUnicode_FromFormat -#define PyUString_Concat PyUnicode_Concat2 -#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel -#define PyUString_GET_SIZE PyUnicode_GET_SIZE -#define PyUString_Size PyUnicode_Size -#define PyUString_InternFromString PyUnicode_InternFromString -#define PyUString_Format PyUnicode_Format - -#else - -#define PyBytes_Type PyString_Type -#define PyBytes_Check PyString_Check -#define PyBytesObject PyStringObject -#define PyBytes_FromString PyString_FromString -#define PyBytes_FromStringAndSize PyString_FromStringAndSize -#define PyBytes_AS_STRING PyString_AS_STRING -#define PyBytes_AsStringAndSize PyString_AsStringAndSize -#define PyBytes_FromFormat PyString_FromFormat -#define PyBytes_Concat PyString_Concat -#define PyBytes_ConcatAndDel PyString_ConcatAndDel -#define PyBytes_AsString PyString_AsString -#define PyBytes_GET_SIZE PyString_GET_SIZE -#define PyBytes_Size PyString_Size - -#define PyUString_Type PyString_Type -#define PyUString_Check PyString_Check -#define PyUStringObject PyStringObject -#define PyUString_FromString PyString_FromString -#define PyUString_FromStringAndSize PyString_FromStringAndSize -#define PyUString_FromFormat PyString_FromFormat -#define PyUString_Concat PyString_Concat -#define PyUString_ConcatAndDel PyString_ConcatAndDel -#define PyUString_GET_SIZE PyString_GET_SIZE -#define PyUString_Size PyString_Size -#define PyUString_InternFromString PyString_InternFromString -#define PyUString_Format PyString_Format - -#endif /* NPY_PY3K */ - - -static NPY_INLINE void -PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - Py_DECREF(right); - *left = new; -} - -static NPY_INLINE void -PyUnicode_Concat2(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - *left = new; -} - - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyFile_AsFile - */ -#if defined(NPY_PY3K) -static NPY_INLINE FILE* -npy_PyFile_Dup(PyObject *file, char *mode) -{ - int fd, fd2; - PyObject *ret, *os; - /* Flush first to ensure things end up in the file in the correct order */ - ret = PyObject_CallMethod(file, "flush", ""); - if (ret == NULL) { - return NULL; - } - Py_DECREF(ret); - fd = PyObject_AsFileDescriptor(file); - if (fd == -1) { - return NULL; - } - os = PyImport_ImportModule("os"); - if (os == NULL) { - return NULL; - } - ret = PyObject_CallMethod(os, "dup", "i", fd); - Py_DECREF(os); - if (ret == NULL) { - return NULL; - } - fd2 = PyNumber_AsSsize_t(ret, NULL); - Py_DECREF(ret); - return fdopen(fd2, mode); -} -#endif - -static NPY_INLINE PyObject* -npy_PyFile_OpenFile(PyObject *filename, char *mode) -{ - PyObject *open; - open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); - if (open == NULL) { - return NULL; - } - return PyObject_CallFunction(open, "Os", filename, mode); -} - -/* - * PyObject_Cmp - */ -#if defined(NPY_PY3K) -static NPY_INLINE int -PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) -{ - int v; - v = PyObject_RichCompareBool(i1, i2, Py_LT); - if (v == 0) { - *cmp = -1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_GT); - if (v == 0) { - *cmp = 1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_EQ); - if (v == 0) { - *cmp = 0; - return 1; - } - else { - *cmp = 0; - return -1; - } -} -#endif - -/* - * PyCObject functions adapted to PyCapsules. - * - * The main job here is to get rid of the improved error handling - * of PyCapsules. It's a shame... - */ -#if defined(NPY_PY3K) - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) -{ - PyObject *ret = PyCapsule_New(ptr, NULL, dtor); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) -{ - PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); - if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { - PyErr_Clear(); - Py_DECREF(ret); - ret = NULL; - } - return ret; -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *obj) -{ - void *ret = PyCapsule_GetPointer(obj, NULL); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCapsule_CheckExact(ptr); -} - -static void -simple_capsule_dtor(PyObject *cap) -{ - PyArray_free(PyCapsule_GetPointer(cap, NULL)); -} - -#else - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtr(ptr, dtor); -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *ptr) -{ - return PyCObject_AsVoidPtr(ptr); -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCObject_Check(ptr); -} - -static void -simple_capsule_dtor(void *ptr) -{ - PyArray_free(ptr); -} - -#endif - -#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/integrate/quadpack.h =================================================================== --- trunk/scipy/integrate/quadpack.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/integrate/quadpack.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -29,7 +29,7 @@ #include "Python.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include "numpy/arrayobject.h" #include Deleted: trunk/scipy/io/npy_3kcompat.h =================================================================== --- trunk/scipy/io/npy_3kcompat.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/io/npy_3kcompat.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,305 +0,0 @@ -#ifndef _NPY_3KCOMPAT_H_ -#define _NPY_3KCOMPAT_H_ - -#include -#include - -#if PY_VERSION_HEX >= 0x03000000 -#define NPY_PY3K -#endif - -#include "numpy/npy_common.h" -#include "numpy/ndarrayobject.h" - -/* - * PyInt -> PyLong - */ - -#if defined(NPY_PY3K) -/* Return True only if the long fits in a C long */ -static NPY_INLINE int PyInt_Check(PyObject *op) { - int overflow = 0; - if (!PyLong_Check(op)) { - return 0; - } - PyLong_AsLongAndOverflow(op, &overflow); - return (overflow == 0); -} - -#define PyInt_FromLong PyLong_FromLong -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AS_LONG PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -/* NOTE: - * - * Since the PyLong type is very different from the fixed-range PyInt, - * we don't define PyInt_Type -> PyLong_Type. - */ -#endif /* NPY_PY3K */ - -/* - * PyString -> PyBytes - */ - -#if defined(NPY_PY3K) - -#define PyString_Type PyBytes_Type -#define PyString_Check PyBytes_Check -#define PyStringObject PyBytesObject -#define PyString_FromString PyBytes_FromString -#define PyString_FromStringAndSize PyBytes_FromStringAndSize -#define PyString_AS_STRING PyBytes_AS_STRING -#define PyString_AsStringAndSize PyBytes_AsStringAndSize -#define PyString_FromFormat PyBytes_FromFormat -#define PyString_Concat PyBytes_Concat -#define PyString_ConcatAndDel PyBytes_ConcatAndDel -#define PyString_AsString PyBytes_AsString -#define PyString_GET_SIZE PyBytes_GET_SIZE -#define PyString_Size PyBytes_Size - -#define PyUString_Type PyUnicode_Type -#define PyUString_Check PyUnicode_Check -#define PyUStringObject PyUnicodeObject -#define PyUString_FromString PyUnicode_FromString -#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize -#define PyUString_FromFormat PyUnicode_FromFormat -#define PyUString_Concat PyUnicode_Concat2 -#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel -#define PyUString_GET_SIZE PyUnicode_GET_SIZE -#define PyUString_Size PyUnicode_Size -#define PyUString_InternFromString PyUnicode_InternFromString -#define PyUString_Format PyUnicode_Format - -#else - -#define PyBytes_Type PyString_Type -#define PyBytes_Check PyString_Check -#define PyBytesObject PyStringObject -#define PyBytes_FromString PyString_FromString -#define PyBytes_FromStringAndSize PyString_FromStringAndSize -#define PyBytes_AS_STRING PyString_AS_STRING -#define PyBytes_AsStringAndSize PyString_AsStringAndSize -#define PyBytes_FromFormat PyString_FromFormat -#define PyBytes_Concat PyString_Concat -#define PyBytes_ConcatAndDel PyString_ConcatAndDel -#define PyBytes_AsString PyString_AsString -#define PyBytes_GET_SIZE PyString_GET_SIZE -#define PyBytes_Size PyString_Size - -#define PyUString_Type PyString_Type -#define PyUString_Check PyString_Check -#define PyUStringObject PyStringObject -#define PyUString_FromString PyString_FromString -#define PyUString_FromStringAndSize PyString_FromStringAndSize -#define PyUString_FromFormat PyString_FromFormat -#define PyUString_Concat PyString_Concat -#define PyUString_ConcatAndDel PyString_ConcatAndDel -#define PyUString_GET_SIZE PyString_GET_SIZE -#define PyUString_Size PyString_Size -#define PyUString_InternFromString PyString_InternFromString -#define PyUString_Format PyString_Format - -#endif /* NPY_PY3K */ - - -static NPY_INLINE void -PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - Py_DECREF(right); - *left = new; -} - -static NPY_INLINE void -PyUnicode_Concat2(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - *left = new; -} - - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyFile_AsFile - */ -#if defined(NPY_PY3K) -static NPY_INLINE FILE* -npy_PyFile_Dup(PyObject *file, char *mode) -{ - int fd, fd2; - PyObject *ret, *os; - /* Flush first to ensure things end up in the file in the correct order */ - ret = PyObject_CallMethod(file, "flush", ""); - if (ret == NULL) { - return NULL; - } - Py_DECREF(ret); - fd = PyObject_AsFileDescriptor(file); - if (fd == -1) { - return NULL; - } - os = PyImport_ImportModule("os"); - if (os == NULL) { - return NULL; - } - ret = PyObject_CallMethod(os, "dup", "i", fd); - Py_DECREF(os); - if (ret == NULL) { - return NULL; - } - fd2 = PyNumber_AsSsize_t(ret, NULL); - Py_DECREF(ret); - return fdopen(fd2, mode); -} -#endif - -static NPY_INLINE PyObject* -npy_PyFile_OpenFile(PyObject *filename, char *mode) -{ - PyObject *open; - open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); - if (open == NULL) { - return NULL; - } - return PyObject_CallFunction(open, "Os", filename, mode); -} - -/* - * PyObject_Cmp - */ -#if defined(NPY_PY3K) -static NPY_INLINE int -PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) -{ - int v; - v = PyObject_RichCompareBool(i1, i2, Py_LT); - if (v == 0) { - *cmp = -1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_GT); - if (v == 0) { - *cmp = 1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_EQ); - if (v == 0) { - *cmp = 0; - return 1; - } - else { - *cmp = 0; - return -1; - } -} -#endif - -/* - * PyCObject functions adapted to PyCapsules. - * - * The main job here is to get rid of the improved error handling - * of PyCapsules. It's a shame... - */ -#if defined(NPY_PY3K) - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) -{ - PyObject *ret = PyCapsule_New(ptr, NULL, dtor); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) -{ - PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); - if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { - PyErr_Clear(); - Py_DECREF(ret); - ret = NULL; - } - return ret; -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *obj) -{ - void *ret = PyCapsule_GetPointer(obj, NULL); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCapsule_CheckExact(ptr); -} - -static void -simple_capsule_dtor(PyObject *cap) -{ - PyArray_free(PyCapsule_GetPointer(cap, NULL)); -} - -#else - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtr(ptr, dtor); -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *ptr) -{ - return PyCObject_AsVoidPtr(ptr); -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCObject_Check(ptr); -} - -static void -simple_capsule_dtor(void *ptr) -{ - PyArray_free(ptr); -} - -#endif - -#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/ndimage/src/nd_image.h =================================================================== --- trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -41,7 +41,7 @@ #include #undef NO_IMPORT_ARRAY -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" /* Eventually get rid of everything below this line */ Deleted: trunk/scipy/ndimage/src/npy_3kcompat.h =================================================================== --- trunk/scipy/ndimage/src/npy_3kcompat.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/ndimage/src/npy_3kcompat.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,305 +0,0 @@ -#ifndef _NPY_3KCOMPAT_H_ -#define _NPY_3KCOMPAT_H_ - -#include -#include - -#if PY_VERSION_HEX >= 0x03000000 -#define NPY_PY3K -#endif - -#include "numpy/npy_common.h" -#include "numpy/ndarrayobject.h" - -/* - * PyInt -> PyLong - */ - -#if defined(NPY_PY3K) -/* Return True only if the long fits in a C long */ -static NPY_INLINE int PyInt_Check(PyObject *op) { - int overflow = 0; - if (!PyLong_Check(op)) { - return 0; - } - PyLong_AsLongAndOverflow(op, &overflow); - return (overflow == 0); -} - -#define PyInt_FromLong PyLong_FromLong -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AS_LONG PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -/* NOTE: - * - * Since the PyLong type is very different from the fixed-range PyInt, - * we don't define PyInt_Type -> PyLong_Type. - */ -#endif /* NPY_PY3K */ - -/* - * PyString -> PyBytes - */ - -#if defined(NPY_PY3K) - -#define PyString_Type PyBytes_Type -#define PyString_Check PyBytes_Check -#define PyStringObject PyBytesObject -#define PyString_FromString PyBytes_FromString -#define PyString_FromStringAndSize PyBytes_FromStringAndSize -#define PyString_AS_STRING PyBytes_AS_STRING -#define PyString_AsStringAndSize PyBytes_AsStringAndSize -#define PyString_FromFormat PyBytes_FromFormat -#define PyString_Concat PyBytes_Concat -#define PyString_ConcatAndDel PyBytes_ConcatAndDel -#define PyString_AsString PyBytes_AsString -#define PyString_GET_SIZE PyBytes_GET_SIZE -#define PyString_Size PyBytes_Size - -#define PyUString_Type PyUnicode_Type -#define PyUString_Check PyUnicode_Check -#define PyUStringObject PyUnicodeObject -#define PyUString_FromString PyUnicode_FromString -#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize -#define PyUString_FromFormat PyUnicode_FromFormat -#define PyUString_Concat PyUnicode_Concat2 -#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel -#define PyUString_GET_SIZE PyUnicode_GET_SIZE -#define PyUString_Size PyUnicode_Size -#define PyUString_InternFromString PyUnicode_InternFromString -#define PyUString_Format PyUnicode_Format - -#else - -#define PyBytes_Type PyString_Type -#define PyBytes_Check PyString_Check -#define PyBytesObject PyStringObject -#define PyBytes_FromString PyString_FromString -#define PyBytes_FromStringAndSize PyString_FromStringAndSize -#define PyBytes_AS_STRING PyString_AS_STRING -#define PyBytes_AsStringAndSize PyString_AsStringAndSize -#define PyBytes_FromFormat PyString_FromFormat -#define PyBytes_Concat PyString_Concat -#define PyBytes_ConcatAndDel PyString_ConcatAndDel -#define PyBytes_AsString PyString_AsString -#define PyBytes_GET_SIZE PyString_GET_SIZE -#define PyBytes_Size PyString_Size - -#define PyUString_Type PyString_Type -#define PyUString_Check PyString_Check -#define PyUStringObject PyStringObject -#define PyUString_FromString PyString_FromString -#define PyUString_FromStringAndSize PyString_FromStringAndSize -#define PyUString_FromFormat PyString_FromFormat -#define PyUString_Concat PyString_Concat -#define PyUString_ConcatAndDel PyString_ConcatAndDel -#define PyUString_GET_SIZE PyString_GET_SIZE -#define PyUString_Size PyString_Size -#define PyUString_InternFromString PyString_InternFromString -#define PyUString_Format PyString_Format - -#endif /* NPY_PY3K */ - - -static NPY_INLINE void -PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - Py_DECREF(right); - *left = new; -} - -static NPY_INLINE void -PyUnicode_Concat2(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - *left = new; -} - - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyFile_AsFile - */ -#if defined(NPY_PY3K) -static NPY_INLINE FILE* -npy_PyFile_Dup(PyObject *file, char *mode) -{ - int fd, fd2; - PyObject *ret, *os; - /* Flush first to ensure things end up in the file in the correct order */ - ret = PyObject_CallMethod(file, "flush", ""); - if (ret == NULL) { - return NULL; - } - Py_DECREF(ret); - fd = PyObject_AsFileDescriptor(file); - if (fd == -1) { - return NULL; - } - os = PyImport_ImportModule("os"); - if (os == NULL) { - return NULL; - } - ret = PyObject_CallMethod(os, "dup", "i", fd); - Py_DECREF(os); - if (ret == NULL) { - return NULL; - } - fd2 = PyNumber_AsSsize_t(ret, NULL); - Py_DECREF(ret); - return fdopen(fd2, mode); -} -#endif - -static NPY_INLINE PyObject* -npy_PyFile_OpenFile(PyObject *filename, char *mode) -{ - PyObject *open; - open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); - if (open == NULL) { - return NULL; - } - return PyObject_CallFunction(open, "Os", filename, mode); -} - -/* - * PyObject_Cmp - */ -#if defined(NPY_PY3K) -static NPY_INLINE int -PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) -{ - int v; - v = PyObject_RichCompareBool(i1, i2, Py_LT); - if (v == 0) { - *cmp = -1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_GT); - if (v == 0) { - *cmp = 1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_EQ); - if (v == 0) { - *cmp = 0; - return 1; - } - else { - *cmp = 0; - return -1; - } -} -#endif - -/* - * PyCObject functions adapted to PyCapsules. - * - * The main job here is to get rid of the improved error handling - * of PyCapsules. It's a shame... - */ -#if defined(NPY_PY3K) - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) -{ - PyObject *ret = PyCapsule_New(ptr, NULL, dtor); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) -{ - PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); - if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { - PyErr_Clear(); - Py_DECREF(ret); - ret = NULL; - } - return ret; -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *obj) -{ - void *ret = PyCapsule_GetPointer(obj, NULL); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCapsule_CheckExact(ptr); -} - -static void -simple_capsule_dtor(PyObject *cap) -{ - PyArray_free(PyCapsule_GetPointer(cap, NULL)); -} - -#else - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtr(ptr, dtor); -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *ptr) -{ - return PyCObject_AsVoidPtr(ptr); -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCObject_Check(ptr); -} - -static void -simple_capsule_dtor(void *ptr) -{ - PyArray_free(ptr); -} - -#endif - -#endif /* _NPY_3KCOMPAT_H_ */ Deleted: trunk/scipy/odr/npy_3kcompat.h =================================================================== --- trunk/scipy/odr/npy_3kcompat.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/odr/npy_3kcompat.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,305 +0,0 @@ -#ifndef _NPY_3KCOMPAT_H_ -#define _NPY_3KCOMPAT_H_ - -#include -#include - -#if PY_VERSION_HEX >= 0x03000000 -#define NPY_PY3K -#endif - -#include "numpy/npy_common.h" -#include "numpy/ndarrayobject.h" - -/* - * PyInt -> PyLong - */ - -#if defined(NPY_PY3K) -/* Return True only if the long fits in a C long */ -static NPY_INLINE int PyInt_Check(PyObject *op) { - int overflow = 0; - if (!PyLong_Check(op)) { - return 0; - } - PyLong_AsLongAndOverflow(op, &overflow); - return (overflow == 0); -} - -#define PyInt_FromLong PyLong_FromLong -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AS_LONG PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -/* NOTE: - * - * Since the PyLong type is very different from the fixed-range PyInt, - * we don't define PyInt_Type -> PyLong_Type. - */ -#endif /* NPY_PY3K */ - -/* - * PyString -> PyBytes - */ - -#if defined(NPY_PY3K) - -#define PyString_Type PyBytes_Type -#define PyString_Check PyBytes_Check -#define PyStringObject PyBytesObject -#define PyString_FromString PyBytes_FromString -#define PyString_FromStringAndSize PyBytes_FromStringAndSize -#define PyString_AS_STRING PyBytes_AS_STRING -#define PyString_AsStringAndSize PyBytes_AsStringAndSize -#define PyString_FromFormat PyBytes_FromFormat -#define PyString_Concat PyBytes_Concat -#define PyString_ConcatAndDel PyBytes_ConcatAndDel -#define PyString_AsString PyBytes_AsString -#define PyString_GET_SIZE PyBytes_GET_SIZE -#define PyString_Size PyBytes_Size - -#define PyUString_Type PyUnicode_Type -#define PyUString_Check PyUnicode_Check -#define PyUStringObject PyUnicodeObject -#define PyUString_FromString PyUnicode_FromString -#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize -#define PyUString_FromFormat PyUnicode_FromFormat -#define PyUString_Concat PyUnicode_Concat2 -#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel -#define PyUString_GET_SIZE PyUnicode_GET_SIZE -#define PyUString_Size PyUnicode_Size -#define PyUString_InternFromString PyUnicode_InternFromString -#define PyUString_Format PyUnicode_Format - -#else - -#define PyBytes_Type PyString_Type -#define PyBytes_Check PyString_Check -#define PyBytesObject PyStringObject -#define PyBytes_FromString PyString_FromString -#define PyBytes_FromStringAndSize PyString_FromStringAndSize -#define PyBytes_AS_STRING PyString_AS_STRING -#define PyBytes_AsStringAndSize PyString_AsStringAndSize -#define PyBytes_FromFormat PyString_FromFormat -#define PyBytes_Concat PyString_Concat -#define PyBytes_ConcatAndDel PyString_ConcatAndDel -#define PyBytes_AsString PyString_AsString -#define PyBytes_GET_SIZE PyString_GET_SIZE -#define PyBytes_Size PyString_Size - -#define PyUString_Type PyString_Type -#define PyUString_Check PyString_Check -#define PyUStringObject PyStringObject -#define PyUString_FromString PyString_FromString -#define PyUString_FromStringAndSize PyString_FromStringAndSize -#define PyUString_FromFormat PyString_FromFormat -#define PyUString_Concat PyString_Concat -#define PyUString_ConcatAndDel PyString_ConcatAndDel -#define PyUString_GET_SIZE PyString_GET_SIZE -#define PyUString_Size PyString_Size -#define PyUString_InternFromString PyString_InternFromString -#define PyUString_Format PyString_Format - -#endif /* NPY_PY3K */ - - -static NPY_INLINE void -PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - Py_DECREF(right); - *left = new; -} - -static NPY_INLINE void -PyUnicode_Concat2(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - *left = new; -} - - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyFile_AsFile - */ -#if defined(NPY_PY3K) -static NPY_INLINE FILE* -npy_PyFile_Dup(PyObject *file, char *mode) -{ - int fd, fd2; - PyObject *ret, *os; - /* Flush first to ensure things end up in the file in the correct order */ - ret = PyObject_CallMethod(file, "flush", ""); - if (ret == NULL) { - return NULL; - } - Py_DECREF(ret); - fd = PyObject_AsFileDescriptor(file); - if (fd == -1) { - return NULL; - } - os = PyImport_ImportModule("os"); - if (os == NULL) { - return NULL; - } - ret = PyObject_CallMethod(os, "dup", "i", fd); - Py_DECREF(os); - if (ret == NULL) { - return NULL; - } - fd2 = PyNumber_AsSsize_t(ret, NULL); - Py_DECREF(ret); - return fdopen(fd2, mode); -} -#endif - -static NPY_INLINE PyObject* -npy_PyFile_OpenFile(PyObject *filename, char *mode) -{ - PyObject *open; - open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); - if (open == NULL) { - return NULL; - } - return PyObject_CallFunction(open, "Os", filename, mode); -} - -/* - * PyObject_Cmp - */ -#if defined(NPY_PY3K) -static NPY_INLINE int -PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) -{ - int v; - v = PyObject_RichCompareBool(i1, i2, Py_LT); - if (v == 0) { - *cmp = -1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_GT); - if (v == 0) { - *cmp = 1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_EQ); - if (v == 0) { - *cmp = 0; - return 1; - } - else { - *cmp = 0; - return -1; - } -} -#endif - -/* - * PyCObject functions adapted to PyCapsules. - * - * The main job here is to get rid of the improved error handling - * of PyCapsules. It's a shame... - */ -#if defined(NPY_PY3K) - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) -{ - PyObject *ret = PyCapsule_New(ptr, NULL, dtor); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) -{ - PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); - if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { - PyErr_Clear(); - Py_DECREF(ret); - ret = NULL; - } - return ret; -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *obj) -{ - void *ret = PyCapsule_GetPointer(obj, NULL); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCapsule_CheckExact(ptr); -} - -static void -simple_capsule_dtor(PyObject *cap) -{ - PyArray_free(PyCapsule_GetPointer(cap, NULL)); -} - -#else - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtr(ptr, dtor); -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *ptr) -{ - return PyCObject_AsVoidPtr(ptr); -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCObject_Check(ptr); -} - -static void -simple_capsule_dtor(void *ptr) -{ - PyArray_free(ptr); -} - -#endif - -#endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/scipy/odr/odrpack.h =================================================================== --- trunk/scipy/odr/odrpack.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/odr/odrpack.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,7 +1,7 @@ #include "Python.h" #include "numpy/arrayobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #if defined(NO_APPEND_FORTRAN) #if defined(UPPERCASE_FORTRAN) Modified: trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/sparse/linalg/dsolve/_superlu_utils.c 2010-09-12 00:56:29 UTC (rev 6743) @@ -6,7 +6,7 @@ #define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API #include "_superluobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include jmp_buf _superlu_py_jmpbuf; Modified: trunk/scipy/sparse/linalg/dsolve/_superlumodule.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/sparse/linalg/dsolve/_superlumodule.c 2010-09-12 00:56:29 UTC (rev 6743) @@ -18,7 +18,7 @@ #include #include "_superluobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" extern jmp_buf _superlu_py_jmpbuf; Modified: trunk/scipy/sparse/linalg/dsolve/_superluobject.c =================================================================== --- trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/sparse/linalg/dsolve/_superluobject.c 2010-09-12 00:56:29 UTC (rev 6743) @@ -11,7 +11,7 @@ #define PY_ARRAY_UNIQUE_SYMBOL _scipy_sparse_superlu_ARRAY_API #include "_superluobject.h" -#include "npy_3kcompat.h" +#include "numpy/npy_3kcompat.h" #include #include Deleted: trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h =================================================================== --- trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h 2010-09-12 00:56:01 UTC (rev 6742) +++ trunk/scipy/sparse/linalg/dsolve/npy_3kcompat.h 2010-09-12 00:56:29 UTC (rev 6743) @@ -1,305 +0,0 @@ -#ifndef _NPY_3KCOMPAT_H_ -#define _NPY_3KCOMPAT_H_ - -#include -#include - -#if PY_VERSION_HEX >= 0x03000000 -#define NPY_PY3K -#endif - -#include "numpy/npy_common.h" -#include "numpy/ndarrayobject.h" - -/* - * PyInt -> PyLong - */ - -#if defined(NPY_PY3K) -/* Return True only if the long fits in a C long */ -static NPY_INLINE int PyInt_Check(PyObject *op) { - int overflow = 0; - if (!PyLong_Check(op)) { - return 0; - } - PyLong_AsLongAndOverflow(op, &overflow); - return (overflow == 0); -} - -#define PyInt_FromLong PyLong_FromLong -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AS_LONG PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -/* NOTE: - * - * Since the PyLong type is very different from the fixed-range PyInt, - * we don't define PyInt_Type -> PyLong_Type. - */ -#endif /* NPY_PY3K */ - -/* - * PyString -> PyBytes - */ - -#if defined(NPY_PY3K) - -#define PyString_Type PyBytes_Type -#define PyString_Check PyBytes_Check -#define PyStringObject PyBytesObject -#define PyString_FromString PyBytes_FromString -#define PyString_FromStringAndSize PyBytes_FromStringAndSize -#define PyString_AS_STRING PyBytes_AS_STRING -#define PyString_AsStringAndSize PyBytes_AsStringAndSize -#define PyString_FromFormat PyBytes_FromFormat -#define PyString_Concat PyBytes_Concat -#define PyString_ConcatAndDel PyBytes_ConcatAndDel -#define PyString_AsString PyBytes_AsString -#define PyString_GET_SIZE PyBytes_GET_SIZE -#define PyString_Size PyBytes_Size - -#define PyUString_Type PyUnicode_Type -#define PyUString_Check PyUnicode_Check -#define PyUStringObject PyUnicodeObject -#define PyUString_FromString PyUnicode_FromString -#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize -#define PyUString_FromFormat PyUnicode_FromFormat -#define PyUString_Concat PyUnicode_Concat2 -#define PyUString_ConcatAndDel PyUnicode_ConcatAndDel -#define PyUString_GET_SIZE PyUnicode_GET_SIZE -#define PyUString_Size PyUnicode_Size -#define PyUString_InternFromString PyUnicode_InternFromString -#define PyUString_Format PyUnicode_Format - -#else - -#define PyBytes_Type PyString_Type -#define PyBytes_Check PyString_Check -#define PyBytesObject PyStringObject -#define PyBytes_FromString PyString_FromString -#define PyBytes_FromStringAndSize PyString_FromStringAndSize -#define PyBytes_AS_STRING PyString_AS_STRING -#define PyBytes_AsStringAndSize PyString_AsStringAndSize -#define PyBytes_FromFormat PyString_FromFormat -#define PyBytes_Concat PyString_Concat -#define PyBytes_ConcatAndDel PyString_ConcatAndDel -#define PyBytes_AsString PyString_AsString -#define PyBytes_GET_SIZE PyString_GET_SIZE -#define PyBytes_Size PyString_Size - -#define PyUString_Type PyString_Type -#define PyUString_Check PyString_Check -#define PyUStringObject PyStringObject -#define PyUString_FromString PyString_FromString -#define PyUString_FromStringAndSize PyString_FromStringAndSize -#define PyUString_FromFormat PyString_FromFormat -#define PyUString_Concat PyString_Concat -#define PyUString_ConcatAndDel PyString_ConcatAndDel -#define PyUString_GET_SIZE PyString_GET_SIZE -#define PyUString_Size PyString_Size -#define PyUString_InternFromString PyString_InternFromString -#define PyUString_Format PyString_Format - -#endif /* NPY_PY3K */ - - -static NPY_INLINE void -PyUnicode_ConcatAndDel(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - Py_DECREF(right); - *left = new; -} - -static NPY_INLINE void -PyUnicode_Concat2(PyObject **left, PyObject *right) -{ - PyObject *new; - new = PyUnicode_Concat(*left, right); - Py_DECREF(*left); - *left = new; -} - - -/* - * Accessing items of ob_base - */ - -#if (PY_VERSION_HEX < 0x02060000) -#define Py_TYPE(o) (((PyObject*)(o))->ob_type) -#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) -#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) -#endif - -/* - * PyFile_AsFile - */ -#if defined(NPY_PY3K) -static NPY_INLINE FILE* -npy_PyFile_Dup(PyObject *file, char *mode) -{ - int fd, fd2; - PyObject *ret, *os; - /* Flush first to ensure things end up in the file in the correct order */ - ret = PyObject_CallMethod(file, "flush", ""); - if (ret == NULL) { - return NULL; - } - Py_DECREF(ret); - fd = PyObject_AsFileDescriptor(file); - if (fd == -1) { - return NULL; - } - os = PyImport_ImportModule("os"); - if (os == NULL) { - return NULL; - } - ret = PyObject_CallMethod(os, "dup", "i", fd); - Py_DECREF(os); - if (ret == NULL) { - return NULL; - } - fd2 = PyNumber_AsSsize_t(ret, NULL); - Py_DECREF(ret); - return fdopen(fd2, mode); -} -#endif - -static NPY_INLINE PyObject* -npy_PyFile_OpenFile(PyObject *filename, char *mode) -{ - PyObject *open; - open = PyDict_GetItemString(PyEval_GetBuiltins(), "open"); - if (open == NULL) { - return NULL; - } - return PyObject_CallFunction(open, "Os", filename, mode); -} - -/* - * PyObject_Cmp - */ -#if defined(NPY_PY3K) -static NPY_INLINE int -PyObject_Cmp(PyObject *i1, PyObject *i2, int *cmp) -{ - int v; - v = PyObject_RichCompareBool(i1, i2, Py_LT); - if (v == 0) { - *cmp = -1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_GT); - if (v == 0) { - *cmp = 1; - return 1; - } - else if (v == -1) { - return -1; - } - - v = PyObject_RichCompareBool(i1, i2, Py_EQ); - if (v == 0) { - *cmp = 0; - return 1; - } - else { - *cmp = 0; - return -1; - } -} -#endif - -/* - * PyCObject functions adapted to PyCapsules. - * - * The main job here is to get rid of the improved error handling - * of PyCapsules. It's a shame... - */ -#if defined(NPY_PY3K) - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) -{ - PyObject *ret = PyCapsule_New(ptr, NULL, dtor); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) -{ - PyObject *ret = NpyCapsule_FromVoidPtr(ptr, dtor); - if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { - PyErr_Clear(); - Py_DECREF(ret); - ret = NULL; - } - return ret; -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *obj) -{ - void *ret = PyCapsule_GetPointer(obj, NULL); - if (ret == NULL) { - PyErr_Clear(); - } - return ret; -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCapsule_CheckExact(ptr); -} - -static void -simple_capsule_dtor(PyObject *cap) -{ - PyArray_free(PyCapsule_GetPointer(cap, NULL)); -} - -#else - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtr(ptr, dtor); -} - -static NPY_INLINE PyObject * -NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) -{ - return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); -} - -static NPY_INLINE void * -NpyCapsule_AsVoidPtr(PyObject *ptr) -{ - return PyCObject_AsVoidPtr(ptr); -} - -static NPY_INLINE int -NpyCapsule_Check(PyObject *ptr) -{ - return PyCObject_Check(ptr); -} - -static void -simple_capsule_dtor(void *ptr) -{ - PyArray_free(ptr); -} - -#endif - -#endif /* _NPY_3KCOMPAT_H_ */ From scipy-svn at scipy.org Sat Sep 11 20:56:43 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:56:43 -0500 (CDT) Subject: [Scipy-svn] r6744 - trunk/scipy/ndimage/tests Message-ID: <20100912005643.69FA639CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:56:43 -0500 (Sat, 11 Sep 2010) New Revision: 6744 Modified: trunk/scipy/ndimage/tests/test_ndimage.py Log: 3K: ndimage/tests: fix a few integer division issues Modified: trunk/scipy/ndimage/tests/test_ndimage.py =================================================================== --- trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 00:56:29 UTC (rev 6743) +++ trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 00:56:43 UTC (rev 6744) @@ -1147,11 +1147,13 @@ for type in self.types: a = numpy.arange(12, dtype = type) a.shape = (3,4) - r1 = ndimage.correlate(a, filter_ * footprint) / 5 + r1 = ndimage.correlate(a, filter_ * footprint) + r1 /= 5 r2 = ndimage.generic_filter(a, _filter_func, footprint = footprint, extra_arguments = (cf,), extra_keywords = {'total': cf.sum()}) - self.failUnless(diff(r1, r2) < eps) + self.failUnless(diff(r1, r2) < eps, + "%r\n%r" % (r1, r2)) def test_extend01(self): "line extension 1" @@ -1621,11 +1623,12 @@ "geometric transform 13" data = numpy.ones([2], numpy.float64) def mapping(x): - return (x[0] / 2,) + return (x[0] // 2,) for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, [4], order=order) - self.failUnless(diff(out, [1, 1, 1, 1]) < eps) + self.failUnless(diff(out, [1, 1, 1, 1]) < eps, + "%r" % out) def test_geometric_transform14(self): "geometric transform 14" From scipy-svn at scipy.org Sat Sep 11 20:56:55 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:56:55 -0500 (CDT) Subject: [Scipy-svn] r6745 - trunk/scipy/optimize Message-ID: <20100912005655.EE96B39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:56:55 -0500 (Sat, 11 Sep 2010) New Revision: 6745 Modified: trunk/scipy/optimize/lbfgsb.py Log: 3K: optimize: fix some bytes vs str issues in lbfgsb Modified: trunk/scipy/optimize/lbfgsb.py =================================================================== --- trunk/scipy/optimize/lbfgsb.py 2010-09-12 00:56:43 UTC (rev 6744) +++ trunk/scipy/optimize/lbfgsb.py 2010-09-12 00:56:55 UTC (rev 6745) @@ -27,6 +27,7 @@ from numpy import zeros, float64, array, int32 import _lbfgsb import optimize +from numpy.compat import asbytes approx_fprime = optimize.approx_fprime @@ -188,20 +189,20 @@ pgtol, wa, iwa, task, iprint, csave, lsave, isave, dsave) task_str = task.tostring() - if task_str.startswith('FG'): + if task_str.startswith(asbytes('FG')): # minimization routine wants f and g at the current x n_function_evals += 1 # Overwrite f and g: f, g = func_and_grad(x) - elif task_str.startswith('NEW_X'): + elif task_str.startswith(asbytes('NEW_X')): # new iteration if n_function_evals > maxfun: task[:] = 'STOP: TOTAL NO. of f AND g EVALUATIONS EXCEEDS LIMIT' else: break - task_str = task.tostring().strip('\x00').strip() - if task_str.startswith('CONV'): + task_str = task.tostring().strip(asbytes('\x00')).strip() + if task_str.startswith(asbytes('CONV')): warnflag = 0 elif n_function_evals > maxfun: warnflag = 1 From scipy-svn at scipy.org Sat Sep 11 20:57:09 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:57:09 -0500 (CDT) Subject: [Scipy-svn] r6746 - trunk/scipy/ndimage/src Message-ID: <20100912005709.12FB539CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:57:08 -0500 (Sat, 11 Sep 2010) New Revision: 6746 Modified: trunk/scipy/ndimage/src/nd_image.c Log: 3K: ndimage: use NpyCapsule compatibility wrappers everywhere Modified: trunk/scipy/ndimage/src/nd_image.c =================================================================== --- trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:56:55 UTC (rev 6745) +++ trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:57:08 UTC (rev 6746) @@ -38,6 +38,8 @@ #include "ni_interpolation.h" #include "ni_measure.h" +#include "numpy/npy_3kcompat.h" + typedef struct { PyObject *function; PyObject *extra_arguments; @@ -318,9 +320,9 @@ "extra_keywords must be a dictionary"); goto exit; } - if (PyCObject_Check(fnc)) { - func = PyCObject_AsVoidPtr(fnc); - data = PyCObject_GetDesc(fnc); + if (NpyCapsule_Check(fnc)) { + func = NpyCapsule_AsVoidPtr(fnc); + data = NpyCapsule_GetDesc(fnc); } else if (PyCallable_Check(fnc)) { cbdata.function = fnc; cbdata.extra_arguments = extra_arguments; @@ -394,9 +396,9 @@ "extra_keywords must be a dictionary"); goto exit; } - if (PyCObject_Check(fnc)) { - func = PyCObject_AsVoidPtr(fnc); - data = PyCObject_GetDesc(fnc); + if (NpyCapsule_Check(fnc)) { + func = NpyCapsule_AsVoidPtr(fnc); + data = NpyCapsule_GetDesc(fnc); } else if (PyCallable_Check(fnc)) { cbdata.function = fnc; cbdata.extra_arguments = extra_arguments; @@ -546,9 +548,9 @@ "extra_keywords must be a dictionary"); goto exit; } - if (PyCObject_Check(fnc)) { - func = PyCObject_AsVoidPtr(fnc); - data = PyCObject_GetDesc(fnc); + if (NpyCapsule_Check(fnc)) { + func = NpyCapsule_AsVoidPtr(fnc); + data = NpyCapsule_GetDesc(fnc); } else if (PyCallable_Check(fnc)) { func = Py_Map; cbdata.function = fnc; @@ -788,10 +790,17 @@ return PyErr_Occurred() ? NULL : Py_BuildValue(""); } +#ifdef NPY_PY3K +static void _FreeCoordinateList(PyObject *obj) +{ + NI_FreeCoordinateList((NI_CoordinateList*)PyCapsule_GetPointer(obj, NULL)); +} +#else static void _FreeCoordinateList(void* ptr) { NI_FreeCoordinateList((NI_CoordinateList*)ptr); } +#endif static PyObject *Py_BinaryErosion(PyObject *obj, PyObject *args) { @@ -815,7 +824,7 @@ return_coordinates ? &coordinate_list : NULL)) goto exit; if (return_coordinates) { - cobj = PyCObject_FromVoidPtr(coordinate_list, _FreeCoordinateList); + cobj = NpyCapsule_FromVoidPtr(coordinate_list, _FreeCoordinateList); } exit: Py_XDECREF(input); @@ -849,8 +858,8 @@ &cobj)) goto exit; - if (PyCObject_Check(cobj)) { - NI_CoordinateList *cobj_data = PyCObject_AsVoidPtr(cobj); + if (NpyCapsule_Check(cobj)) { + NI_CoordinateList *cobj_data = NpyCapsule_AsVoidPtr(cobj); if (!NI_BinaryErosion2(array, strct, mask, niter, origins, invert, &cobj_data)) goto exit; @@ -913,7 +922,7 @@ {NULL, NULL, 0, NULL} }; -#if PY_VERSION_HEX >= 0x03000000 +#ifdef NPY_PY3K static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "_nd_image", From scipy-svn at scipy.org Sat Sep 11 20:57:31 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:57:31 -0500 (CDT) Subject: [Scipy-svn] r6747 - trunk/scipy/ndimage/src Message-ID: <20100912005731.EF02A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:57:31 -0500 (Sat, 11 Sep 2010) New Revision: 6747 Modified: trunk/scipy/ndimage/src/nd_image.c trunk/scipy/ndimage/src/nd_image.h trunk/scipy/ndimage/src/ni_filters.c trunk/scipy/ndimage/src/ni_filters.h trunk/scipy/ndimage/src/ni_fourier.c trunk/scipy/ndimage/src/ni_fourier.h trunk/scipy/ndimage/src/ni_interpolation.c trunk/scipy/ndimage/src/ni_interpolation.h trunk/scipy/ndimage/src/ni_measure.c trunk/scipy/ndimage/src/ni_measure.h trunk/scipy/ndimage/src/ni_morphology.c trunk/scipy/ndimage/src/ni_morphology.h trunk/scipy/ndimage/src/ni_support.c trunk/scipy/ndimage/src/ni_support.h Log: BUG: ndimage: replace long -> npy_intp, for better Windows support - Use npy_intp instead of long - Rename "maybelong" -> "npy_intp". - Use the "n" ParseTuple code, but fall back to "l" on Python 2.4 Thanks to Christoph Gohlke for the patch. Modified: trunk/scipy/ndimage/src/nd_image.c =================================================================== --- trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/nd_image.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -97,20 +97,20 @@ } /* Convert an Long sequence */ -static maybelong -NI_ObjectToLongSequenceAndLength(PyObject *object, maybelong **sequence) +static npy_intp +NI_ObjectToLongSequenceAndLength(PyObject *object, npy_intp **sequence) { - long *pa, ii; - PyArrayObject *array = NA_InputArray(object, PyArray_LONG, NPY_CARRAY); - maybelong length = PyArray_SIZE(array); + npy_intp *pa, ii; + PyArrayObject *array = NA_InputArray(object, PyArray_INTP, NPY_CARRAY); + npy_intp length = PyArray_SIZE(array); - *sequence = (maybelong*)malloc(length * sizeof(maybelong)); + *sequence = (npy_intp*)malloc(length * sizeof(npy_intp)); if (!*sequence) { PyErr_NoMemory(); Py_XDECREF(array); return -1; } - pa = (long*)PyArray_DATA(array); + pa = (npy_intp*)PyArray_DATA(array); for(ii = 0; ii < length; ii++) (*sequence)[ii] = pa[ii]; Py_XDECREF(array); @@ -118,7 +118,7 @@ } static int -NI_ObjectToLongSequence(PyObject *object, maybelong **sequence) +NI_ObjectToLongSequence(PyObject *object, npy_intp **sequence) { return NI_ObjectToLongSequenceAndLength(object, sequence) >= 0; } @@ -131,13 +131,24 @@ { PyArrayObject *input = NULL, *output = NULL, *weights = NULL; int axis, mode; + double cval; +#if PY_VERSION_HEX < 0x02050000 long origin; - double cval; +#define FMT "l" +#else + npy_intp origin; +#define FMT "n" +#endif - if (!PyArg_ParseTuple(args, "O&O&iO&idl", NI_ObjectToInputArray, &input, - NI_ObjectToInputArray, &weights, &axis, - NI_ObjectToOutputArray, &output, &mode, &cval, &origin)) + if (!PyArg_ParseTuple(args, "O&O&iO&id" FMT, + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, &weights, &axis, + NI_ObjectToOutputArray, &output, &mode, &cval, + &origin)) goto exit; + +#undef FMT + if (!NI_Correlate1D(input, weights, axis, output, (NI_ExtendMode)mode, cval, origin)) goto exit; @@ -151,13 +162,15 @@ static PyObject *Py_Correlate(PyObject *obj, PyObject *args) { PyArrayObject *input = NULL, *output = NULL, *weights = NULL; - maybelong *origin = NULL; + npy_intp *origin = NULL; int mode; double cval; if (!PyArg_ParseTuple(args, "O&O&O&idO&", NI_ObjectToInputArray, &input, - NI_ObjectToInputArray, &weights, NI_ObjectToOutputArray, &output, - &mode, &cval, NI_ObjectToLongSequence, &origin)) + NI_ObjectToInputArray, &weights, + NI_ObjectToOutputArray, &output, + &mode, &cval, + NI_ObjectToLongSequence, &origin)) goto exit; if (!NI_Correlate(input, weights, output, (NI_ExtendMode)mode, cval, origin)) @@ -175,15 +188,23 @@ { PyArrayObject *input = NULL, *output = NULL; int axis, mode; +#if PY_VERSION_HEX < 0x02050000 long filter_size, origin; +#define FMT "l" +#else + npy_intp filter_size, origin; +#define FMT "n" +#endif double cval; - if (!PyArg_ParseTuple(args, "O&liO&idl", NI_ObjectToInputArray, &input, - &filter_size, &axis, NI_ObjectToOutputArray, &output, - &mode, &cval, &origin)) + if (!PyArg_ParseTuple(args, "O&" FMT "iO&id" FMT, + NI_ObjectToInputArray, &input, + &filter_size, &axis, + NI_ObjectToOutputArray, &output, + &mode, &cval, &origin)) goto exit; if (!NI_UniformFilter1D(input, filter_size, axis, output, - (NI_ExtendMode)mode, cval, origin)) + (NI_ExtendMode)mode, cval, origin)) goto exit; exit: Py_XDECREF(input); @@ -195,13 +216,22 @@ { PyArrayObject *input = NULL, *output = NULL; int axis, mode, minimum; +#if PY_VERSION_HEX < 0x02050000 long filter_size, origin; +#define FMT "l" +#else + npy_intp filter_size, origin; +#define FMT "n" +#endif double cval; - if (!PyArg_ParseTuple(args, "O&liO&idli", NI_ObjectToInputArray, &input, - &filter_size, &axis, NI_ObjectToOutputArray, &output, - &mode, &cval, &origin, &minimum)) + if (!PyArg_ParseTuple(args, "O&" FMT "iO&id" FMT "i", + NI_ObjectToInputArray, &input, + &filter_size, &axis, + NI_ObjectToOutputArray, &output, + &mode, &cval, &origin, &minimum)) goto exit; +#undef FMT if (!NI_MinOrMaxFilter1D(input, filter_size, axis, output, (NI_ExtendMode)mode, cval, origin, minimum)) goto exit; @@ -215,15 +245,18 @@ { PyArrayObject *input = NULL, *output = NULL, *footprint = NULL; PyArrayObject *structure = NULL; - maybelong *origin = NULL; + npy_intp *origin = NULL; int mode, minimum; double cval; - if (!PyArg_ParseTuple(args, "O&O&O&O&idO&i", NI_ObjectToInputArray, - &input, NI_ObjectToInputArray, &footprint, + if (!PyArg_ParseTuple(args, "O&O&O&O&idO&i", + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, &footprint, NI_ObjectToOptionalInputArray, &structure, - NI_ObjectToOutputArray, &output, &mode, &cval, - NI_ObjectToLongSequence, &origin, &minimum)) + NI_ObjectToOutputArray, &output, + &mode, &cval, + NI_ObjectToLongSequence, &origin, + &minimum)) goto exit; if (!NI_MinOrMaxFilter(input, footprint, structure, output, (NI_ExtendMode)mode, cval, origin, minimum)) @@ -241,13 +274,15 @@ static PyObject *Py_RankFilter(PyObject *obj, PyObject *args) { PyArrayObject *input = NULL, *output = NULL, *footprint = NULL; - maybelong *origin = NULL; + npy_intp *origin = NULL; int mode, rank; double cval; - if (!PyArg_ParseTuple(args, "O&iO&O&idO&", NI_ObjectToInputArray, - &input, &rank, NI_ObjectToInputArray, &footprint, - NI_ObjectToOutputArray, &output, &mode, &cval, + if (!PyArg_ParseTuple(args, "O&iO&O&idO&", + NI_ObjectToInputArray, &input, &rank, + NI_ObjectToInputArray, &footprint, + NI_ObjectToOutputArray, &output, + &mode, &cval, NI_ObjectToLongSequence, &origin)) goto exit; if (!NI_RankFilter(input, rank, footprint, output, (NI_ExtendMode)mode, @@ -262,12 +297,12 @@ return PyErr_Occurred() ? NULL : Py_BuildValue(""); } -static int Py_Filter1DFunc(double *iline, maybelong ilen, - double *oline, maybelong olen, void *data) +static int Py_Filter1DFunc(double *iline, npy_intp ilen, + double *oline, npy_intp olen, void *data) { PyArrayObject *py_ibuffer = NULL, *py_obuffer = NULL; PyObject *rv = NULL, *args = NULL, *tmp = NULL; - maybelong ii; + npy_intp ii; double *po = NULL; NI_PythonCallbackData *cbdata = (NI_PythonCallbackData*)data; @@ -303,16 +338,26 @@ void *func = Py_Filter1DFunc, *data = NULL; NI_PythonCallbackData cbdata; int axis, mode; +#if PY_VERSION_HEX < 0x02050000 long origin, filter_size; +#define FMT "l" +#else + npy_intp origin, filter_size; +#define FMT "n" +#endif double cval; - if (!PyArg_ParseTuple(args, "O&OliO&idlOO", NI_ObjectToInputArray, - &input, &fnc, &filter_size, &axis, NI_ObjectToOutputArray, - &output, &mode, &cval, &origin, &extra_arguments, &extra_keywords)) + if (!PyArg_ParseTuple(args, "O&O" FMT "iO&id" FMT "OO", + NI_ObjectToInputArray, &input, + &fnc, &filter_size, &axis, + NI_ObjectToOutputArray, &output, + &mode, &cval, &origin, + &extra_arguments, &extra_keywords)) goto exit; +#undef FMT + if (!PyTuple_Check(extra_arguments)) { - PyErr_SetString(PyExc_RuntimeError, - "extra_arguments must be a tuple"); + PyErr_SetString(PyExc_RuntimeError, "extra_arguments must be a tuple"); goto exit; } if (!PyDict_Check(extra_keywords)) { @@ -334,7 +379,7 @@ goto exit; } if (!NI_GenericFilter1D(input, func, data, filter_size, axis, output, - (NI_ExtendMode)mode, cval, origin)) + (NI_ExtendMode)mode, cval, origin)) goto exit; exit: Py_XDECREF(input); @@ -342,7 +387,7 @@ return PyErr_Occurred() ? NULL : Py_BuildValue(""); } -static int Py_FilterFunc(double *buffer, maybelong filter_size, +static int Py_FilterFunc(double *buffer, npy_intp filter_size, double *output, void *data) { PyArrayObject *py_buffer = NULL; @@ -377,18 +422,20 @@ void *func = Py_FilterFunc, *data = NULL; NI_PythonCallbackData cbdata; int mode; - maybelong *origin = NULL; + npy_intp *origin = NULL; double cval; - if (!PyArg_ParseTuple(args, "O&OO&O&idO&OO", NI_ObjectToInputArray, - &input, &fnc, NI_ObjectToInputArray, &footprint, - NI_ObjectToOutputArray, &output, &mode, &cval, + if (!PyArg_ParseTuple(args, "O&OO&O&idO&OO", + NI_ObjectToInputArray, &input, + &fnc, + NI_ObjectToInputArray, &footprint, + NI_ObjectToOutputArray, &output, + &mode, &cval, NI_ObjectToLongSequence, &origin, &extra_arguments, &extra_keywords)) goto exit; if (!PyTuple_Check(extra_arguments)) { - PyErr_SetString(PyExc_RuntimeError, - "extra_arguments must be a tuple"); + PyErr_SetString(PyExc_RuntimeError, "extra_arguments must be a tuple"); goto exit; } if (!PyDict_Check(extra_keywords)) { @@ -425,12 +472,22 @@ { PyArrayObject *input = NULL, *output = NULL, *parameters = NULL; int axis, filter_type; +#if PY_VERSION_HEX < 0x02050000 long n; +#define FMT "l" +#else + npy_intp n; +#define FMT "n" +#endif - if (!PyArg_ParseTuple(args, "O&O&liO&i", NI_ObjectToInputArray, &input, - NI_ObjectToInputArray, ¶meters, &n, &axis, - NI_ObjectToOutputArray, &output, &filter_type)) + if (!PyArg_ParseTuple(args, "O&O&" FMT "iO&i", + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, ¶meters, + &n, &axis, + NI_ObjectToOutputArray, &output, + &filter_type)) goto exit; +#undef FMT if (!NI_FourierFilter(input, parameters, n, axis, output, filter_type)) goto exit; @@ -446,12 +503,21 @@ { PyArrayObject *input = NULL, *output = NULL, *shifts = NULL; int axis; +#if PY_VERSION_HEX < 0x02050000 long n; +#define FMT "l" +#else + npy_intp n; +#define FMT "n" +#endif - if (!PyArg_ParseTuple(args, "O&O&liO&", NI_ObjectToInputArray, &input, - NI_ObjectToInputArray, &shifts, &n, &axis, + if (!PyArg_ParseTuple(args, "O&O&" FMT "iO&", + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, &shifts, + &n, &axis, NI_ObjectToOutputArray, &output)) goto exit; +#undef FMT if (!NI_FourierShift(input, shifts, n, axis, output)) goto exit; @@ -468,8 +534,10 @@ PyArrayObject *input = NULL, *output = NULL; int axis, order; - if (!PyArg_ParseTuple(args, "O&iiO&", NI_ObjectToInputArray, &input, - &order, &axis, NI_ObjectToOutputArray, &output)) + if (!PyArg_ParseTuple(args, "O&iiO&", + NI_ObjectToInputArray, &input, + &order, &axis, + NI_ObjectToOutputArray, &output)) goto exit; if (!NI_SplineFilter1D(input, order, axis, output)) @@ -481,18 +549,22 @@ return PyErr_Occurred() ? NULL : Py_BuildValue(""); } -static int Py_Map(maybelong *ocoor, double* icoor, int orank, int irank, +static int Py_Map(npy_intp *ocoor, double* icoor, int orank, int irank, void *data) { PyObject *coors = NULL, *rets = NULL, *args = NULL, *tmp = NULL; - maybelong ii; + npy_intp ii; NI_PythonCallbackData *cbdata = (NI_PythonCallbackData*)data; coors = PyTuple_New(orank); if (!coors) goto exit; for(ii = 0; ii < orank; ii++) { - PyTuple_SetItem(coors, ii, PyInt_FromLong(ocoor[ii])); +#if PY_VERSION_HEX < 0x02060000 + PyTuple_SetItem(coors, ii, PyLong_FromLong(ocoor[ii])); +#else + PyTuple_SetItem(coors, ii, PyLong_FromSsize_t(ocoor[ii])); +#endif if (PyErr_Occurred()) goto exit; } @@ -529,12 +601,15 @@ void *func = NULL, *data = NULL; NI_PythonCallbackData cbdata; - if (!PyArg_ParseTuple(args, "O&OO&O&O&O&iidOO", NI_ObjectToInputArray, - &input, &fnc, NI_ObjectToOptionalInputArray, - &coordinates, NI_ObjectToOptionalInputArray, - &matrix, NI_ObjectToOptionalInputArray, &shift, - NI_ObjectToOutputArray, &output, &order, &mode, - &cval, &extra_arguments, &extra_keywords)) + if (!PyArg_ParseTuple(args, "O&OO&O&O&O&iidOO", + NI_ObjectToInputArray, &input, + &fnc, + NI_ObjectToOptionalInputArray, &coordinates, + NI_ObjectToOptionalInputArray, &matrix, + NI_ObjectToOptionalInputArray, &shift, + NI_ObjectToOutputArray, &output, + &order, &mode, &cval, + &extra_arguments, &extra_keywords)) goto exit; if (fnc != Py_None) { @@ -584,10 +659,12 @@ int mode, order; double cval; - if (!PyArg_ParseTuple(args, "O&O&O&O&iid", NI_ObjectToInputArray, - &input, NI_ObjectToOptionalInputArray, &zoom, - NI_ObjectToOptionalInputArray, &shift, NI_ObjectToOutputArray, - &output, &order, &mode, &cval)) + if (!PyArg_ParseTuple(args, "O&O&O&O&iid", + NI_ObjectToInputArray, &input, + NI_ObjectToOptionalInputArray, &zoom, + NI_ObjectToOptionalInputArray, &shift, + NI_ObjectToOutputArray, &output, + &order, &mode, &cval)) goto exit; if (!NI_ZoomShift(input, zoom, shift, output, order, (NI_ExtendMode)mode, @@ -605,10 +682,12 @@ static PyObject *Py_Label(PyObject *obj, PyObject *args) { PyArrayObject *input = NULL, *output = NULL, *strct = NULL; - maybelong max_label; + npy_intp max_label; - if (!PyArg_ParseTuple(args, "O&O&O&", NI_ObjectToInputArray, &input, - NI_ObjectToInputArray, &strct, NI_ObjectToOutputArray, &output)) + if (!PyArg_ParseTuple(args, "O&O&O&", + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, &strct, + NI_ObjectToOutputArray, &output)) goto exit; if (!NI_Label(input, strct, &max_label, output)) @@ -618,7 +697,11 @@ Py_XDECREF(input); Py_XDECREF(strct); Py_XDECREF(output); +#if PY_VERSION_HEX < 0x02050000 return PyErr_Occurred() ? NULL : Py_BuildValue("l", (long)max_label); +#else + return PyErr_Occurred() ? NULL : Py_BuildValue("n", (npy_intp)max_label); +#endif } static PyObject *Py_FindObjects(PyObject *obj, PyObject *args) @@ -627,21 +710,28 @@ PyObject *result = NULL, *tuple = NULL, *start = NULL, *end = NULL; PyObject *slc = NULL; int jj; +#if PY_VERSION_HEX < 0x02050000 long max_label; - maybelong ii, *regions = NULL; +#define FMT "l" +#else + npy_intp max_label; +#define FMT "n" +#endif + npy_intp ii, *regions = NULL; - if (!PyArg_ParseTuple(args, "O&l", NI_ObjectToInputArray, &input, - &max_label)) + if (!PyArg_ParseTuple(args, "O&" FMT, + NI_ObjectToInputArray, &input, &max_label)) goto exit; +#undef FMT if (max_label < 0) max_label = 0; if (max_label > 0) { if (input->nd > 0) { - regions = (maybelong*)malloc(2 * max_label * input->nd * - sizeof(maybelong)); + regions = (npy_intp*)malloc(2 * max_label * input->nd * + sizeof(npy_intp)); } else { - regions = (maybelong*)malloc(max_label * sizeof(maybelong)); + regions = (npy_intp*)malloc(max_label * sizeof(npy_intp)); } if (!regions) { PyErr_NoMemory(); @@ -659,7 +749,7 @@ } for(ii = 0; ii < max_label; ii++) { - maybelong idx = input->nd > 0 ? 2 * input->nd * ii : ii; + npy_intp idx = input->nd > 0 ? 2 * input->nd * ii : ii; if (regions[idx] >= 0) { PyObject *tuple = PyTuple_New(input->nd); if (!tuple) { @@ -667,8 +757,13 @@ goto exit; } for(jj = 0; jj < input->nd; jj++) { - start = PyInt_FromLong(regions[idx + jj]); - end = PyInt_FromLong(regions[idx + jj + input->nd]); +#if PY_VERSION_HEX < 0x02060000 + start = PyLong_FromLong(regions[idx + jj]); + end = PyLong_FromLong(regions[idx + jj + input->nd]); +#else + start = PyLong_FromSsize_t(regions[idx + jj]); + end = PyLong_FromSsize_t(regions[idx + jj + input->nd]); +#endif if (!start || !end) { PyErr_NoMemory(); goto exit; @@ -739,8 +834,10 @@ PyArrayObject *sampling = NULL; int metric; - if (!PyArg_ParseTuple(args, "O&iO&O&O&", NI_ObjectToInputArray, &input, - &metric, NI_ObjectToOptionalInputArray, &sampling, + if (!PyArg_ParseTuple(args, "O&iO&O&O&", + NI_ObjectToInputArray, &input, + &metric, + NI_ObjectToOptionalInputArray, &sampling, NI_ObjectToOptionalOutputArray, &output, NI_ObjectToOptionalOutputArray, &features)) goto exit; @@ -759,7 +856,8 @@ { PyArrayObject *strct = NULL, *distances = NULL, *features = NULL; - if (!PyArg_ParseTuple(args, "O&O&O&", NI_ObjectToInputArray, &strct, + if (!PyArg_ParseTuple(args, "O&O&O&", + NI_ObjectToInputArray, &strct, NI_ObjectToIoArray, &distances, NI_ObjectToOptionalOutputArray, &features)) goto exit; @@ -777,7 +875,8 @@ { PyArrayObject *input = NULL, *features = NULL, *sampling = NULL; - if (!PyArg_ParseTuple(args, "O&O&O&", NI_ObjectToInputArray, &input, + if (!PyArg_ParseTuple(args, "O&O&O&", + NI_ObjectToInputArray, &input, NI_ObjectToOptionalInputArray, &sampling, NI_ObjectToOutputArray, &features)) goto exit; @@ -810,14 +909,16 @@ int border_value, invert, center_is_true; int changed = 0, return_coordinates; NI_CoordinateList *coordinate_list = NULL; - maybelong *origins = NULL; + npy_intp *origins = NULL; - if (!PyArg_ParseTuple(args, "O&O&O&O&iO&iii", NI_ObjectToInputArray, - &input, NI_ObjectToInputArray, &strct, + if (!PyArg_ParseTuple(args, "O&O&O&O&iO&iii", + NI_ObjectToInputArray, &input, + NI_ObjectToInputArray, &strct, NI_ObjectToOptionalInputArray, &mask, - NI_ObjectToOutputArray, &output, &border_value, - NI_ObjectToLongSequence, &origins, &invert, - ¢er_is_true, &return_coordinates)) + NI_ObjectToOutputArray, &output, + &border_value, + NI_ObjectToLongSequence, &origins, + &invert, ¢er_is_true, &return_coordinates)) goto exit; if (!NI_BinaryErosion(input, strct, mask, output, border_value, origins, invert, center_is_true, &changed, @@ -850,12 +951,15 @@ PyArrayObject *array = NULL, *strct = NULL, *mask = NULL; PyObject *cobj = NULL; int invert, niter; - maybelong *origins = NULL; + npy_intp *origins = NULL; - if (!PyArg_ParseTuple(args, "O&O&O&iO&iO", NI_ObjectToIoArray, &array, - NI_ObjectToInputArray, &strct, NI_ObjectToOptionalInputArray, - &mask, &niter, NI_ObjectToLongSequence, &origins, &invert, - &cobj)) + if (!PyArg_ParseTuple(args, "O&O&O&iO&iO", + NI_ObjectToIoArray, &array, + NI_ObjectToInputArray, &strct, + NI_ObjectToOptionalInputArray, + &mask, &niter, + NI_ObjectToLongSequence, &origins, + &invert, &cobj)) goto exit; if (NpyCapsule_Check(cobj)) { Modified: trunk/scipy/ndimage/src/nd_image.h =================================================================== --- trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/nd_image.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -69,7 +69,6 @@ #define NI_MAXDIM NPY_MAXDIMS -typedef npy_intp maybelong; #define MAXDIM NPY_MAXDIMS #define HAS_UINT64 1 @@ -179,7 +178,7 @@ static int NA_ByteOrder(void) { - unsigned long byteorder_test; + unsigned int byteorder_test; byteorder_test = 1; if (*((char *) &byteorder_test)) return NUM_LITTLE_ENDIAN; @@ -189,9 +188,10 @@ /* ignores bytestride */ static PyArrayObject * -NA_NewAllFromBuffer(int ndim, maybelong *shape, NumarrayType type, - PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, - int byteorder, int aligned, int writeable) +NA_NewAllFromBuffer(int ndim, npy_intp *shape, NumarrayType type, + PyObject *bufferObject, npy_intp byteoffset, + npy_intp bytestride, int byteorder, int aligned, + int writeable) { PyArrayObject *self = NULL; PyArray_Descr *dtype; @@ -240,18 +240,16 @@ } static PyArrayObject * -NA_NewAll(int ndim, maybelong *shape, NumarrayType type, - void *buffer, maybelong byteoffset, maybelong bytestride, +NA_NewAll(int ndim, npy_intp *shape, NumarrayType type, + void *buffer, npy_intp byteoffset, npy_intp bytestride, int byteorder, int aligned, int writeable) { - PyArrayObject *result = NA_NewAllFromBuffer( - ndim, shape, type, Py_None, + PyArrayObject *result = NA_NewAllFromBuffer(ndim, shape, type, Py_None, byteoffset, bytestride, byteorder, aligned, writeable); if (result) { if (!PyArray_Check((PyObject *) result)) { - PyErr_Format( PyExc_TypeError, - "NA_NewAll: non-NumArray result"); + PyErr_Format(PyExc_TypeError, "NA_NewAll: non-NumArray result"); result = NULL; } else { if (buffer) { @@ -269,7 +267,7 @@ Call with buffer==NULL to allocate storage. */ static PyArrayObject * -NA_NewArray(void *buffer, NumarrayType type, int ndim, maybelong *shape) +NA_NewArray(void *buffer, NumarrayType type, int ndim, npy_intp *shape) { return (PyArrayObject *) NA_NewAll(ndim, shape, type, buffer, 0, 0, NA_ByteOrder(), 1, 1); Modified: trunk/scipy/ndimage/src/ni_filters.c =================================================================== --- trunk/scipy/ndimage/src/ni_filters.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_filters.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -38,10 +38,10 @@ int NI_Correlate1D(PyArrayObject *input, PyArrayObject *weights, int axis, PyArrayObject *output, NI_ExtendMode mode, - double cval, maybelong origin) + double cval, npy_intp origin) { - int symmetric = 0, ii, jj, more; - maybelong ll, lines, length, size1, size2, filter_size; + int symmetric = 0, more; + npy_intp ii, jj, ll, lines, length, size1, size2, filter_size; double *ibuffer = NULL, *obuffer = NULL; Float64 *fw; NI_LineBuffer iline_buffer, oline_buffer; @@ -133,7 +133,7 @@ _cvalue, _type, _res, _mv) \ case t ## _type: \ { \ - maybelong _ii, _offset; \ + npy_intp _ii, _offset; \ for(_ii = 0; _ii < _filter_size; _ii++) { \ _offset = _offsets[_ii]; \ if (_offset == _mv) \ @@ -151,11 +151,11 @@ int NI_Correlate(PyArrayObject* input, PyArrayObject* weights, PyArrayObject* output, NI_ExtendMode mode, - double cvalue, maybelong *origins) + double cvalue, npy_intp *origins) { Bool *pf = NULL; - maybelong fsize, jj, kk, filter_size = 0, border_flag_value; - maybelong *offsets = NULL, *oo, size; + npy_intp fsize, jj, kk, filter_size = 0, border_flag_value; + npy_intp *offsets = NULL, *oo, size; NI_FilterIterator fi; NI_Iterator ii, io; char *pi, *po; @@ -274,11 +274,11 @@ } int -NI_UniformFilter1D(PyArrayObject *input, long filter_size, +NI_UniformFilter1D(PyArrayObject *input, npy_intp filter_size, int axis, PyArrayObject *output, NI_ExtendMode mode, - double cval, long origin) + double cval, npy_intp origin) { - maybelong lines, kk, ll, length, size1, size2; + npy_intp lines, kk, ll, length, size1, size2; int more; double *ibuffer = NULL, *obuffer = NULL; NI_LineBuffer iline_buffer, oline_buffer; @@ -336,11 +336,11 @@ } int -NI_MinOrMaxFilter1D(PyArrayObject *input, long filter_size, +NI_MinOrMaxFilter1D(PyArrayObject *input, npy_intp filter_size, int axis, PyArrayObject *output, NI_ExtendMode mode, - double cval, long origin, int minimum) + double cval, npy_intp origin, int minimum) { - maybelong lines, kk, jj, ll, length, size1, size2; + npy_intp lines, kk, jj, ll, length, size1, size2; int more; double *ibuffer = NULL, *obuffer = NULL; NI_LineBuffer iline_buffer, oline_buffer; @@ -405,7 +405,7 @@ _type, _minimum, _res, _mv, _ss) \ case t ## _type: \ { \ - maybelong _ii, _oo = *_offsets; \ + npy_intp _ii, _oo = *_offsets; \ _type _cv = (_type)_cval, _tmp; \ _res = _oo == _mv ? _cv : *(_type*)(_pi + _oo); \ if (_ss) \ @@ -428,11 +428,12 @@ int NI_MinOrMaxFilter(PyArrayObject* input, PyArrayObject* footprint, PyArrayObject* structure, PyArrayObject* output, - NI_ExtendMode mode, double cvalue, maybelong *origins, int minimum) + NI_ExtendMode mode, double cvalue, npy_intp *origins, + int minimum) { Bool *pf = NULL; - maybelong fsize, jj, kk, filter_size = 0, border_flag_value; - maybelong *offsets = NULL, *oo, size; + npy_intp fsize, jj, kk, filter_size = 0, border_flag_value; + npy_intp *offsets = NULL, *oo, size; NI_FilterIterator fi; NI_Iterator ii, io; char *pi, *po; @@ -581,9 +582,9 @@ _rank, _buffer, _res, _mv) \ case t ## _type: \ { \ - maybelong _ii; \ + npy_intp _ii; \ for(_ii = 0; _ii < _filter_size; _ii++) { \ - maybelong _offset = _offsets[_ii]; \ + npy_intp _offset = _offsets[_ii]; \ if (_offset == _mv) \ _buffer[_ii] = (_type)_cval; \ else \ @@ -595,10 +596,10 @@ int NI_RankFilter(PyArrayObject* input, int rank, PyArrayObject* footprint, PyArrayObject* output, - NI_ExtendMode mode, double cvalue, maybelong *origins) + NI_ExtendMode mode, double cvalue, npy_intp *origins) { - maybelong fsize, jj, filter_size = 0, border_flag_value; - maybelong *offsets = NULL, *oo, size; + npy_intp fsize, jj, filter_size = 0, border_flag_value; + npy_intp *offsets = NULL, *oo, size; NI_FilterIterator fi; NI_Iterator ii, io; char *pi, *po; @@ -704,12 +705,12 @@ } int NI_GenericFilter1D(PyArrayObject *input, - int (*function)(double*, maybelong, double*, maybelong, void*), - void* data, long filter_size, int axis, PyArrayObject *output, - NI_ExtendMode mode, double cval, long origin) + int (*function)(double*, npy_intp, double*, npy_intp, void*), + void* data, npy_intp filter_size, int axis, PyArrayObject *output, + NI_ExtendMode mode, double cval, npy_intp origin) { int more; - maybelong ii, lines, length, size1, size2; + npy_intp ii, lines, length, size1, size2; double *ibuffer = NULL, *obuffer = NULL; NI_LineBuffer iline_buffer, oline_buffer; @@ -761,7 +762,7 @@ _res, _mv, _function, _data, _buffer) \ case t ## _type: \ { \ - maybelong _ii, _offset; \ + npy_intp _ii, _offset; \ for(_ii = 0; _ii < _filter_size; _ii++) { \ _offset = _offsets[_ii]; \ if (_offset == _mv) \ @@ -780,13 +781,13 @@ int NI_GenericFilter(PyArrayObject* input, - int (*function)(double*, maybelong, double*, void*), void *data, + int (*function)(double*, npy_intp, double*, void*), void *data, PyArrayObject* footprint, PyArrayObject* output, - NI_ExtendMode mode, double cvalue, maybelong *origins) + NI_ExtendMode mode, double cvalue, npy_intp *origins) { Bool *pf = NULL; - maybelong fsize, jj, filter_size = 0, border_flag_value; - maybelong *offsets = NULL, *oo, size; + npy_intp fsize, jj, filter_size = 0, border_flag_value; + npy_intp *offsets = NULL, *oo, size; NI_FilterIterator fi; NI_Iterator ii, io; char *pi, *po; Modified: trunk/scipy/ndimage/src/ni_filters.h =================================================================== --- trunk/scipy/ndimage/src/ni_filters.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_filters.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -33,22 +33,22 @@ #define NI_FILTERS_H int NI_Correlate1D(PyArrayObject*, PyArrayObject*, int, PyArrayObject*, - NI_ExtendMode, double, maybelong); + NI_ExtendMode, double, npy_intp); int NI_Correlate(PyArrayObject*, PyArrayObject*, PyArrayObject*, - NI_ExtendMode, double, maybelong*); -int NI_UniformFilter1D(PyArrayObject*, long, int, PyArrayObject*, - NI_ExtendMode, double, long); -int NI_MinOrMaxFilter1D(PyArrayObject*, long, int, PyArrayObject*, - NI_ExtendMode, double, long, int); + NI_ExtendMode, double, npy_intp*); +int NI_UniformFilter1D(PyArrayObject*, npy_intp, int, PyArrayObject*, + NI_ExtendMode, double, npy_intp); +int NI_MinOrMaxFilter1D(PyArrayObject*, npy_intp, int, PyArrayObject*, + NI_ExtendMode, double, npy_intp, int); int NI_MinOrMaxFilter(PyArrayObject*, PyArrayObject*, PyArrayObject*, - PyArrayObject*, NI_ExtendMode, double, maybelong*, + PyArrayObject*, NI_ExtendMode, double, npy_intp*, int); int NI_RankFilter(PyArrayObject*, int, PyArrayObject*, PyArrayObject*, - NI_ExtendMode, double, maybelong*); -int NI_GenericFilter1D(PyArrayObject*, int (*)(double*, maybelong, - double*, maybelong, void*), void*, long, int, - PyArrayObject*, NI_ExtendMode, double, long); -int NI_GenericFilter(PyArrayObject*, int (*)(double*, maybelong, double*, + NI_ExtendMode, double, npy_intp*); +int NI_GenericFilter1D(PyArrayObject*, int (*)(double*, npy_intp, + double*, npy_intp, void*), void*, npy_intp, int, + PyArrayObject*, NI_ExtendMode, double, npy_intp); +int NI_GenericFilter(PyArrayObject*, int (*)(double*, npy_intp, double*, void*), void*, PyArrayObject*, PyArrayObject*, - NI_ExtendMode, double, maybelong*); + NI_ExtendMode, double, npy_intp*); #endif Modified: trunk/scipy/ndimage/src/ni_fourier.c =================================================================== --- trunk/scipy/ndimage/src/ni_fourier.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_fourier.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -181,12 +181,13 @@ break; int NI_FourierFilter(PyArrayObject *input, PyArrayObject* parameter_array, - maybelong n, int axis, PyArrayObject* output, int filter_type) + npy_intp n, int axis, PyArrayObject* output, + int filter_type) { NI_Iterator ii, io; char *pi, *po; double *parameters = NULL, **params = NULL; - maybelong kk, hh, size; + npy_intp kk, hh, size; Float64 *iparameters = (void *)PyArray_DATA(parameter_array); int ll; @@ -432,12 +433,12 @@ break; int NI_FourierShift(PyArrayObject *input, PyArrayObject* shift_array, - maybelong n, int axis, PyArrayObject* output) + npy_intp n, int axis, PyArrayObject* output) { NI_Iterator ii, io; char *pi, *po; double *shifts = NULL, **params = NULL; - maybelong kk, hh, size; + npy_intp kk, hh, size; Float64 *ishifts = (void *)PyArray_DATA(shift_array); int ll; Modified: trunk/scipy/ndimage/src/ni_fourier.h =================================================================== --- trunk/scipy/ndimage/src/ni_fourier.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_fourier.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -32,9 +32,9 @@ #ifndef NI_FOURIER_H #define NI_FOURIER_H -int NI_FourierFilter(PyArrayObject*, PyArrayObject*, maybelong, int, +int NI_FourierFilter(PyArrayObject*, PyArrayObject*, npy_intp, int, PyArrayObject*, int); -int NI_FourierShift(PyArrayObject*, PyArrayObject*, maybelong, int, +int NI_FourierShift(PyArrayObject*, PyArrayObject*, npy_intp, int, PyArrayObject*); #endif Modified: trunk/scipy/ndimage/src/ni_interpolation.c =================================================================== --- trunk/scipy/ndimage/src/ni_interpolation.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_interpolation.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -113,7 +113,7 @@ /* map a coordinate outside the borders, according to the requested boundary condition: */ static double -map_coordinate(double in, maybelong len, int mode) +map_coordinate(double in, npy_intp len, int mode) { if (in < 0) { switch (mode) { @@ -121,8 +121,8 @@ if (len <= 1) { in = 0; } else { - maybelong sz2 = 2 * len - 2; - in = sz2 * (maybelong)(-in / sz2) + in; + npy_intp sz2 = 2 * len - 2; + in = sz2 * (npy_intp)(-in / sz2) + in; in = in <= 1 - len ? in + sz2 : -in; } break; @@ -130,9 +130,9 @@ if (len <= 1) { in = 0; } else { - maybelong sz2 = 2 * len; + npy_intp sz2 = 2 * len; if (in < -sz2) - in = sz2 * (maybelong)(-in / sz2) + in; + in = sz2 * (npy_intp)(-in / sz2) + in; in = in < -len ? in + sz2 : -in - 1; } break; @@ -140,10 +140,10 @@ if (len <= 1) { in = 0; } else { - maybelong sz = len - 1; + npy_intp sz = len - 1; // Integer division of -in/sz gives (-in mod sz) // Note that 'in' is negative - in += sz * ((maybelong)(-in / sz) + 1); + in += sz * ((npy_intp)(-in / sz) + 1); } break; case NI_EXTEND_NEAREST: @@ -159,8 +159,8 @@ if (len <= 1) { in = 0; } else { - maybelong sz2 = 2 * len - 2; - in -= sz2 * (maybelong)(in / sz2); + npy_intp sz2 = 2 * len - 2; + in -= sz2 * (npy_intp)(in / sz2); if (in >= len) in = sz2 - in; } @@ -169,8 +169,8 @@ if (len <= 1) { in = 0; } else { - maybelong sz2 = 2 * len; - in -= sz2 * (maybelong)(in / sz2); + npy_intp sz2 = 2 * len; + in -= sz2 * (npy_intp)(in / sz2); if (in >= len) in = sz2 - in - 1; } @@ -179,8 +179,8 @@ if (len <= 1) { in = 0; } else { - maybelong sz = len - 1; - in -= sz * (maybelong)(in / sz); + npy_intp sz = len - 1; + in -= sz * (npy_intp)(in / sz); } break; case NI_EXTEND_NEAREST: @@ -203,7 +203,7 @@ PyArrayObject *output) { int hh, npoles = 0, more; - maybelong kk, ll, lines, len; + npy_intp kk, ll, lines, len; double *buffer = NULL, weight, pole[2]; NI_LineBuffer iline_buffer, oline_buffer; @@ -345,18 +345,18 @@ break; int -NI_GeometricTransform(PyArrayObject *input, int (*map)(maybelong*, double*, +NI_GeometricTransform(PyArrayObject *input, int (*map)(npy_intp*, double*, int, int, void*), void* map_data, PyArrayObject* matrix_ar, PyArrayObject* shift_ar, PyArrayObject *coordinates, PyArrayObject *output, int order, int mode, double cval) { char *po, *pi, *pc = NULL; - maybelong **edge_offsets = NULL, **data_offsets = NULL, filter_size; - maybelong ftmp[MAXDIM], *fcoordinates = NULL, *foffsets = NULL; - maybelong cstride = 0, kk, hh, ll, jj, *idxs = NULL; - maybelong size; + npy_intp **edge_offsets = NULL, **data_offsets = NULL, filter_size; + npy_intp ftmp[MAXDIM], *fcoordinates = NULL, *foffsets = NULL; + npy_intp cstride = 0, kk, hh, ll, jj, *idxs = NULL; + npy_intp size; double **splvals = NULL, icoor[MAXDIM]; - double idimensions[MAXDIM], istrides[MAXDIM]; + npy_intp idimensions[MAXDIM], istrides[MAXDIM]; NI_Iterator io, ic; Float64 *matrix = matrix_ar ? (Float64*)PyArray_DATA(matrix_ar) : NULL; Float64 *shift = shift_ar ? (Float64*)PyArray_DATA(shift_ar) : NULL; @@ -381,8 +381,8 @@ } /* offsets used at the borders: */ - edge_offsets = (maybelong**)malloc(irank * sizeof(maybelong*)); - data_offsets = (maybelong**)malloc(irank * sizeof(maybelong*)); + edge_offsets = (npy_intp**)malloc(irank * sizeof(npy_intp*)); + data_offsets = (npy_intp**)malloc(irank * sizeof(npy_intp*)); if (!edge_offsets || !data_offsets) { PyErr_NoMemory(); goto exit; @@ -390,7 +390,7 @@ for(jj = 0; jj < irank; jj++) data_offsets[jj] = NULL; for(jj = 0; jj < irank; jj++) { - data_offsets[jj] = (maybelong*)malloc((order + 1) * sizeof(maybelong)); + data_offsets[jj] = (npy_intp*)malloc((order + 1) * sizeof(npy_intp)); if (!data_offsets[jj]) { PyErr_NoMemory(); goto exit; @@ -415,7 +415,7 @@ filter_size = 1; for(jj = 0; jj < irank; jj++) filter_size *= order + 1; - idxs = (maybelong*)malloc(filter_size * sizeof(idxs)); + idxs = (npy_intp*)malloc(filter_size * sizeof(idxs)); if (!idxs) { PyErr_NoMemory(); goto exit; @@ -430,9 +430,9 @@ po = (void *)PyArray_DATA(output); /* make a table of all possible coordinates within the spline filter: */ - fcoordinates = (maybelong*)malloc(irank * filter_size * sizeof(maybelong)); + fcoordinates = (npy_intp*)malloc(irank * filter_size * sizeof(npy_intp)); /* make a table of all offsets within the spline filter: */ - foffsets = (maybelong*)malloc(filter_size * sizeof(maybelong)); + foffsets = (npy_intp*)malloc(filter_size * sizeof(npy_intp)); if (!fcoordinates || !foffsets) { PyErr_NoMemory(); goto exit; @@ -552,7 +552,7 @@ } if (!constant) { - maybelong *ff = fcoordinates; + npy_intp *ff = fcoordinates; for(hh = 0; hh < filter_size; hh++) { int idx = 0; if (edge) { @@ -571,7 +571,7 @@ } } if (!constant) { - maybelong *ff = fcoordinates; + npy_intp *ff = fcoordinates; t = 0.0; for(hh = 0; hh < filter_size; hh++) { double coeff = 0.0; @@ -590,7 +590,8 @@ CASE_INTERP_COEFF(coeff, pi, idxs[hh], Float32); CASE_INTERP_COEFF(coeff, pi, idxs[hh], Float64); default: - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); + PyErr_SetString(PyExc_RuntimeError, + "data type not supported"); goto exit; } /* calculate the interpolated value: */ @@ -657,11 +658,11 @@ int order, int mode, double cval) { char *po, *pi; - maybelong **zeros = NULL, **offsets = NULL, ***edge_offsets = NULL; - maybelong ftmp[MAXDIM], *fcoordinates = NULL, *foffsets = NULL; - maybelong jj, hh, kk, filter_size, odimensions[MAXDIM]; - maybelong idimensions[MAXDIM], istrides[MAXDIM], *idxs = NULL; - maybelong size; + npy_intp **zeros = NULL, **offsets = NULL, ***edge_offsets = NULL; + npy_intp ftmp[MAXDIM], *fcoordinates = NULL, *foffsets = NULL; + npy_intp jj, hh, kk, filter_size, odimensions[MAXDIM]; + npy_intp idimensions[MAXDIM], istrides[MAXDIM], *idxs = NULL; + npy_intp size; double ***splvals = NULL; NI_Iterator io; Float64 *zooms = zoom_ar ? (Float64*)PyArray_DATA(zoom_ar) : NULL; @@ -677,7 +678,7 @@ /* if the mode is 'constant' we need some temps later: */ if (mode == NI_EXTEND_CONSTANT) { - zeros = (maybelong**)malloc(rank * sizeof(maybelong*)); + zeros = (npy_intp**)malloc(rank * sizeof(npy_intp*)); if (!zeros) { PyErr_NoMemory(); goto exit; @@ -685,7 +686,7 @@ for(jj = 0; jj < rank; jj++) zeros[jj] = NULL; for(jj = 0; jj < rank; jj++) { - zeros[jj] = (maybelong*)malloc(odimensions[jj] * sizeof(maybelong)); + zeros[jj] = (npy_intp*)malloc(odimensions[jj] * sizeof(npy_intp)); if(!zeros[jj]) { PyErr_NoMemory(); goto exit; @@ -694,11 +695,11 @@ } /* store offsets, along each axis: */ - offsets = (maybelong**)malloc(rank * sizeof(maybelong*)); + offsets = (npy_intp**)malloc(rank * sizeof(npy_intp*)); /* store spline coefficients, along each axis: */ splvals = (double***)malloc(rank * sizeof(double**)); /* store offsets at all edges: */ - edge_offsets = (maybelong***)malloc(rank * sizeof(maybelong**)); + edge_offsets = (npy_intp***)malloc(rank * sizeof(npy_intp**)); if (!offsets || !splvals || !edge_offsets) { PyErr_NoMemory(); goto exit; @@ -709,9 +710,9 @@ edge_offsets[jj] = NULL; } for(jj = 0; jj < rank; jj++) { - offsets[jj] = (maybelong*)malloc(odimensions[jj] * sizeof(maybelong)); + offsets[jj] = (npy_intp*)malloc(odimensions[jj] * sizeof(npy_intp)); splvals[jj] = (double**)malloc(odimensions[jj] * sizeof(double*)); - edge_offsets[jj] = (maybelong**)malloc(odimensions[jj] * sizeof(maybelong*)); + edge_offsets[jj] = (npy_intp**)malloc(odimensions[jj] * sizeof(npy_intp*)); if (!offsets[jj] || !splvals[jj] || !edge_offsets[jj]) { PyErr_NoMemory(); goto exit; @@ -747,7 +748,7 @@ } offsets[jj][kk] = istrides[jj] * start; if (start < 0 || start + order >= idimensions[jj]) { - edge_offsets[jj][kk] = (maybelong*)malloc((order + 1) * sizeof(maybelong)); + edge_offsets[jj][kk] = (npy_intp*)malloc((order + 1) * sizeof(npy_intp)); if (!edge_offsets[jj][kk]) { PyErr_NoMemory(); goto exit; @@ -788,7 +789,7 @@ filter_size = 1; for(jj = 0; jj < rank; jj++) filter_size *= order + 1; - idxs = (maybelong*)malloc(filter_size * sizeof(idxs)); + idxs = (npy_intp*)malloc(filter_size * sizeof(idxs)); if (!idxs) { PyErr_NoMemory(); goto exit; @@ -801,8 +802,8 @@ po = (void *)PyArray_DATA(output); /* store all coordinates and offsets with filter: */ - fcoordinates = (maybelong*)malloc(rank * filter_size * sizeof(maybelong)); - foffsets = (maybelong*)malloc(filter_size * sizeof(maybelong)); + fcoordinates = (npy_intp*)malloc(rank * filter_size * sizeof(npy_intp)); + foffsets = (npy_intp*)malloc(filter_size * sizeof(npy_intp)); if (!fcoordinates || !foffsets) { PyErr_NoMemory(); goto exit; @@ -845,7 +846,7 @@ } if (!zero) { - maybelong *ff = fcoordinates; + npy_intp *ff = fcoordinates; for(hh = 0; hh < filter_size; hh++) { int idx = 0; if (edge) { @@ -866,7 +867,7 @@ } } if (!zero) { - maybelong *ff = fcoordinates; + npy_intp *ff = fcoordinates; t = 0.0; for(hh = 0; hh < filter_size; hh++) { double coeff = 0.0; @@ -885,7 +886,8 @@ CASE_INTERP_COEFF(coeff, pi, idxs[hh], Float32); CASE_INTERP_COEFF(coeff, pi, idxs[hh], Float64); default: - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); + PyErr_SetString(PyExc_RuntimeError, + "data type not supported"); goto exit; } /* calculate interpolated value: */ Modified: trunk/scipy/ndimage/src/ni_interpolation.h =================================================================== --- trunk/scipy/ndimage/src/ni_interpolation.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_interpolation.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -33,7 +33,7 @@ #define NI_INTERPOLATION_H int NI_SplineFilter1D(PyArrayObject*, int, int, PyArrayObject*); -int NI_GeometricTransform(PyArrayObject*, int (*)(maybelong*, double*, int, int, +int NI_GeometricTransform(PyArrayObject*, int (*)(npy_intp*, double*, int, int, void*), void*, PyArrayObject*, PyArrayObject*, PyArrayObject*, PyArrayObject*, int, int, double); Modified: trunk/scipy/ndimage/src/ni_measure.c =================================================================== --- trunk/scipy/ndimage/src/ni_measure.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_measure.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -47,11 +47,11 @@ break int NI_Label(PyArrayObject* input, PyArrayObject* strct, - maybelong *max_label, PyArrayObject* output) + npy_intp *max_label, PyArrayObject* output) { int kk; - maybelong jj, ll, ssize, size, filter_size, *offsets = NULL; - maybelong mask_value, *oo; + npy_intp jj, ll, ssize, size, filter_size, *offsets = NULL; + npy_intp mask_value, *oo; Bool *ps, *footprint = NULL; char *pi, *po; Int32 index = 0, *index_map = NULL; @@ -193,8 +193,8 @@ index_map[idx2] = idx1; } else { /* idx2 was already mapped, therefore we find what it was - mapped to and change the current pair to the result of that - and idx1. Since the pair is not destroyed, it will be + mapped to and change the current pair to the result of + that and idx1. Since the pair is not destroyed, it will be re-processed with the adapted values. */ idx2 = index_map[idx2]; /* keep the pairs ordered: */ @@ -256,19 +256,19 @@ case t ## _type: \ { \ int _kk; \ - maybelong _sindex = *(_type*)_pi - 1; \ + npy_intp _sindex = *(_type*)_pi - 1; \ if (_sindex >= 0 && _sindex < _max_label) { \ if (_rank > 0) { \ _sindex *= 2 * _rank; \ if (_regions[_sindex] < 0) { \ for(_kk = 0; _kk < _rank; _kk++) { \ - maybelong _cc = _ii.coordinates[_kk]; \ + npy_intp _cc = _ii.coordinates[_kk]; \ _regions[_sindex + _kk] = _cc; \ _regions[_sindex + _kk + _rank] = _cc + 1; \ } \ } else { \ for(_kk = 0; _kk < _rank; _kk++) { \ - maybelong _cc = _ii.coordinates[_kk]; \ + npy_intp _cc = _ii.coordinates[_kk]; \ if (_cc < _regions[_sindex + _kk]) \ _regions[_sindex + _kk] = _cc; \ if (_cc + 1 > _regions[_sindex + _kk + _rank]) \ @@ -282,11 +282,11 @@ } \ break -int NI_FindObjects(PyArrayObject* input, maybelong max_label, - maybelong* regions) +int NI_FindObjects(PyArrayObject* input, npy_intp max_label, + npy_intp* regions) { int kk; - maybelong size, jj; + npy_intp size, jj; NI_Iterator ii; char *pi; @@ -378,7 +378,8 @@ _v = *(Float64*)_pi; \ break; \ default: \ - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); \ + PyErr_SetString(PyExc_RuntimeError, \ + "data type not supported"); \ return 0; \ } \ } @@ -417,7 +418,8 @@ _v = *(Float64*)_pi; \ break; \ default: \ - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); \ + PyErr_SetString(PyExc_RuntimeError, \ + "data type not supported"); \ return 0; \ } \ } @@ -463,7 +465,8 @@ _label = *(Float64*)_pm; \ break; \ default: \ - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); \ + PyErr_SetString(PyExc_RuntimeError, \ + "data type not supported"); \ return 0; \ } \ } \ @@ -504,7 +507,8 @@ _label = *(Float64*)_pm; \ break; \ default: \ - PyErr_SetString(PyExc_RuntimeError, "data type not supported"); \ + PyErr_SetString(PyExc_RuntimeError, \ + "data type not supported"); \ return 0; \ } \ } \ @@ -512,13 +516,13 @@ #endif int NI_Statistics(PyArrayObject *input, PyArrayObject *labels, - maybelong min_label, maybelong max_label, maybelong *indices, - maybelong n_results, double *sum, maybelong *total, double *variance, - double *minimum, double *maximum, maybelong* min_pos, maybelong* max_pos) + npy_intp min_label, npy_intp max_label, npy_intp *indices, + npy_intp n_results, double *sum, npy_intp *total, double *variance, + double *minimum, double *maximum, npy_intp* min_pos, npy_intp* max_pos) { char *pi = NULL, *pm = NULL; NI_Iterator ii, mi; - maybelong jj, size, idx = 0, label = 1, doit = 1; + npy_intp jj, size, idx = 0, label = 1, doit = 1; int qq; /* input iterator: */ @@ -650,12 +654,12 @@ int NI_CenterOfMass(PyArrayObject *input, PyArrayObject *labels, - maybelong min_label, maybelong max_label, maybelong *indices, - maybelong n_results, double *center_of_mass) + npy_intp min_label, npy_intp max_label, npy_intp *indices, + npy_intp n_results, double *center_of_mass) { char *pi = NULL, *pm = NULL; NI_Iterator ii, mi; - maybelong jj, kk, size, idx = 0, label = 1, doit = 1; + npy_intp jj, kk, size, idx = 0, label = 1, doit = 1; double *sum = NULL; int qq; @@ -720,13 +724,13 @@ int NI_Histogram(PyArrayObject *input, PyArrayObject *labels, - maybelong min_label, maybelong max_label, maybelong *indices, - maybelong n_results, PyArrayObject **histograms, - double min, double max, maybelong nbins) + npy_intp min_label, npy_intp max_label, npy_intp *indices, + npy_intp n_results, PyArrayObject **histograms, + double min, double max, npy_intp nbins) { char *pi = NULL, *pm = NULL; NI_Iterator ii, mi; - maybelong jj, kk, size, idx = 0, label = 1, doit = 1; + npy_intp jj, kk, size, idx = 0, label = 1, doit = 1; Int32 **ph = NULL; double bsize; int qq; @@ -797,7 +801,7 @@ _out = _index * sizeof(_type); \ } else { \ int _qq; \ - maybelong _cc, _idx = _index; \ + npy_intp _cc, _idx = _index; \ _out = 0; \ for (_qq = 0; _qq < _rank; _qq++) { \ _cc = _idx / _c_strides[_qq]; \ @@ -854,7 +858,7 @@ #define WS_MAXDIM 7 typedef struct { - maybelong index; + npy_intp index; COST_TYPE cost; void *next, *prev; DONE_TYPE done; @@ -865,9 +869,9 @@ { char *pl, *pm, *pi; int ll; - maybelong size, jj, hh, kk, maxval; - maybelong strides[WS_MAXDIM], coordinates[WS_MAXDIM]; - maybelong *nstrides = NULL, nneigh, ssize; + npy_intp size, jj, hh, kk, maxval; + npy_intp strides[WS_MAXDIM], coordinates[WS_MAXDIM]; + npy_intp *nstrides = NULL, nneigh, ssize; int i_contiguous, o_contiguous; NI_WatershedElement *temp = NULL, **first = NULL, **last = NULL; Bool *ps = NULL; @@ -978,8 +982,8 @@ last[0] = first[0]; } else { if (label > 0) { - /* object markers are enqueued at the beginning, so they are - processed first. */ + /* object markers are enqueued at the beginning, so they + are processed first. */ temp[jj].next = first[0]; temp[jj].prev = NULL; first[0]->prev = &(temp[jj]); @@ -1014,7 +1018,7 @@ for (kk = 0; kk < ssize; kk++) if (ps[kk] && kk != (ssize / 2)) ++nneigh; - nstrides = (maybelong*)malloc(nneigh * sizeof(maybelong)); + nstrides = (npy_intp*)malloc(nneigh * sizeof(npy_intp)); if (!nstrides) { PyErr_NoMemory(); goto exit; @@ -1057,7 +1061,7 @@ v->done = 1; /* Iterate over the neighbors of the element: */ for(hh = 0; hh < nneigh; hh++) { - maybelong v_index = v->index, p_index = v->index, idx, cc; + npy_intp v_index = v->index, p_index = v->index, idx, cc; int qq, outside = 0; p_index += nstrides[hh]; /* check if the neighbor is within the extent of the array: */ Modified: trunk/scipy/ndimage/src/ni_measure.h =================================================================== --- trunk/scipy/ndimage/src/ni_measure.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_measure.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -39,19 +39,20 @@ int start[NI_MAXDIM], end[NI_MAXDIM]; } NI_ObjectRegion; -int NI_Label(PyArrayObject*, PyArrayObject*, maybelong*, PyArrayObject*); +int NI_Label(PyArrayObject*, PyArrayObject*, npy_intp*, PyArrayObject*); -int NI_FindObjects(PyArrayObject*, maybelong, maybelong*); +int NI_FindObjects(PyArrayObject*, npy_intp, npy_intp*); -int NI_CenterOfMass(PyArrayObject*, PyArrayObject*, maybelong, maybelong, - maybelong*, maybelong, double*); +int NI_CenterOfMass(PyArrayObject*, PyArrayObject*, npy_intp, npy_intp, + npy_intp*, npy_intp, double*); -int NI_Histogram(PyArrayObject*, PyArrayObject*, maybelong, maybelong, - maybelong*, maybelong, PyArrayObject**, double, double, maybelong); +int NI_Histogram(PyArrayObject*, PyArrayObject*, npy_intp, npy_intp, + npy_intp*, npy_intp, PyArrayObject**, double, double, + npy_intp); -int NI_Statistics(PyArrayObject*, PyArrayObject*, maybelong, maybelong, - maybelong*, maybelong, double*, maybelong*, double*, - double*, double*, maybelong*, maybelong*); +int NI_Statistics(PyArrayObject*, PyArrayObject*, npy_intp, npy_intp, + npy_intp*, npy_intp, double*, npy_intp*, double*, + double*, double*, npy_intp*, npy_intp*); int NI_WatershedIFT(PyArrayObject*, PyArrayObject*, PyArrayObject*, PyArrayObject*); Modified: trunk/scipy/ndimage/src/ni_morphology.c =================================================================== --- trunk/scipy/ndimage/src/ni_morphology.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_morphology.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -53,7 +53,7 @@ _true, _false, _changed) \ case t ## _type: \ { \ - maybelong _ii, _oo; \ + npy_intp _ii, _oo; \ int _in = *(_type*)_pi ? 1 : 0; \ if (_mv) { \ if (_center_is_true && _in == false) { \ @@ -86,11 +86,11 @@ int NI_BinaryErosion(PyArrayObject* input, PyArrayObject* strct, PyArrayObject* mask, PyArrayObject* output, int bdr_value, - maybelong *origins, int invert, int center_is_true, int* changed, - NI_CoordinateList **coordinate_list) + npy_intp *origins, int invert, int center_is_true, + int* changed, NI_CoordinateList **coordinate_list) { - maybelong struct_size = 0, *offsets = NULL, size, *oo, jj; - maybelong ssize, block_size = 0, *current = NULL, border_flag_value; + npy_intp struct_size = 0, *offsets = NULL, size, *oo, jj; + npy_intp ssize, block_size = 0, *current = NULL, border_flag_value; int kk, true, false, msk_value; NI_Iterator ii, io, mi; NI_FilterIterator fi; @@ -274,12 +274,12 @@ _mklist) \ case t ## _type: \ { \ - maybelong _hh, _kk; \ + npy_intp _hh, _kk; \ for(_hh = 0; _hh < _struct_size; _hh++) { \ - maybelong _to = _offsets[_oo + _hh]; \ + npy_intp _to = _offsets[_oo + _hh]; \ if (_to != _bf_value && *(_type*)(_pi + _to) == _true) { \ if (_mklist) { \ - maybelong *_tc = &(_coordinate_offsets[(_oo + _hh) * _irank]); \ + npy_intp *_tc = &(_coordinate_offsets[(_oo + _hh) * _irank]); \ if (_block2 == NULL || _block2->size == _list2->block_size) { \ _block2 = NI_CoordinateListAddBlock(_list2); \ _current_coors2 = _block2->coordinates; \ @@ -295,13 +295,13 @@ break int NI_BinaryErosion2(PyArrayObject* array, PyArrayObject* strct, - PyArrayObject* mask, int niter, maybelong *origins, + PyArrayObject* mask, int niter, npy_intp *origins, int invert, NI_CoordinateList **iclist) { - maybelong struct_size = 0, *offsets = NULL, oo, jj, ssize; - maybelong *coordinate_offsets = NULL, size = 0; - maybelong *current_coordinates1 = NULL, *current_coordinates2 = NULL; - maybelong kk, border_flag_value, current = 0; + npy_intp struct_size = 0, *offsets = NULL, oo, jj, ssize; + npy_intp *coordinate_offsets = NULL, size = 0; + npy_intp *current_coordinates1 = NULL, *current_coordinates2 = NULL; + npy_intp kk, border_flag_value, current = 0; int true, false; NI_Iterator ii, mi; NI_FilterIterator fi, ci; @@ -495,8 +495,8 @@ #define NI_DISTANCE_CHESSBOARD 3 typedef struct { - maybelong *coordinates; - maybelong index; + npy_intp *coordinates; + npy_intp index; void *next; } NI_BorderElement; @@ -505,7 +505,7 @@ PyArrayObject* distances, PyArrayObject* features) { - maybelong size, jj, min_index = 0; + npy_intp size, jj, min_index = 0; int kk; NI_BorderElement *border_elements = NULL, *temp; NI_Iterator ii, di, fi; @@ -543,7 +543,7 @@ temp->next = border_elements; border_elements = temp; temp->index = jj; - temp->coordinates = (maybelong*)malloc(input->nd * sizeof(maybelong)); + temp->coordinates = (npy_intp*)malloc(input->nd * sizeof(npy_intp)); for(kk = 0; kk < input->nd; kk++) temp->coordinates[kk] = ii.coordinates[kk]; } @@ -597,11 +597,11 @@ case NI_DISTANCE_CHESSBOARD: for(jj = 0; jj < size; jj++) { if (*(Int8*)pi > 0) { - unsigned long distance = ULONG_MAX; + unsigned int distance = UINT_MAX; temp = border_elements; while(temp) { unsigned int d = 0; - maybelong t; + npy_intp t; for(kk = 0; kk < input->nd; kk++) { t = ii.coordinates[kk] - temp->coordinates[kk]; if (t < 0) @@ -657,11 +657,12 @@ int NI_DistanceTransformOnePass(PyArrayObject *strct, - PyArrayObject* distances, PyArrayObject *features) + PyArrayObject* distances, + PyArrayObject *features) { int kk; - maybelong jj, ii, ssize, size, filter_size, mask_value, *oo; - maybelong *foffsets = NULL, *foo = NULL, *offsets = NULL; + npy_intp jj, ii, ssize, size, filter_size, mask_value, *oo; + npy_intp *foffsets = NULL, *foo = NULL, *offsets = NULL; Bool *ps, *pf = NULL, *footprint = NULL; char *pd; NI_FilterIterator si, ti; @@ -704,7 +705,7 @@ goto exit; if (features) { - maybelong dummy; + npy_intp dummy; /* initialize point iterator: */ pf = (void *)PyArray_DATA(features); if (!NI_InitPointIterator(features, &fi)) @@ -726,10 +727,10 @@ Int32 value = *(Int32*)pd; if (value != 0) { Int32 min = value; - maybelong min_offset = 0; + npy_intp min_offset = 0; /* iterate over structuring element: */ for(ii = 0; ii < filter_size; ii++) { - maybelong offset = oo[ii]; + npy_intp offset = oo[ii]; Int32 tt = -1; if (offset < mask_value) tt = *(Int32*)(pd + offset); @@ -759,11 +760,11 @@ return PyErr_Occurred() ? 0 : 1; } -static void _VoronoiFT(char *pf, maybelong len, maybelong *coor, int rank, - int d, maybelong stride, maybelong cstride, - maybelong **f, maybelong *g, Float64 *sampling) +static void _VoronoiFT(char *pf, npy_intp len, npy_intp *coor, int rank, + int d, npy_intp stride, npy_intp cstride, + npy_intp **f, npy_intp *g, Float64 *sampling) { - maybelong l = -1, ii, maxl, idx1, idx2; + npy_intp l = -1, ii, maxl, idx1, idx2; int jj; for(ii = 0; ii < len; ii++) @@ -847,13 +848,13 @@ /* Recursive feature transform */ -static void _ComputeFT(char *pi, char *pf, maybelong *ishape, - maybelong *istrides, maybelong *fstrides, int rank, - int d, maybelong *coor, maybelong **f, maybelong *g, +static void _ComputeFT(char *pi, char *pf, npy_intp *ishape, + npy_intp *istrides, npy_intp *fstrides, int rank, + int d, npy_intp *coor, npy_intp **f, npy_intp *g, PyArrayObject *features, Float64 *sampling) { int kk; - maybelong jj; + npy_intp jj; if (d == 0) { char *tf1 = pf; @@ -876,7 +877,7 @@ } else { UInt32 axes = 0; char *tf = pf; - maybelong size = 1; + npy_intp size = 1; NI_Iterator ii; for(jj = 0; jj < ishape[d]; jj++) { @@ -915,8 +916,8 @@ PyArrayObject* features) { int ii; - maybelong coor[NI_MAXDIM], mx = 0, jj; - maybelong *tmp = NULL, **f = NULL, *g = NULL; + npy_intp coor[NI_MAXDIM], mx = 0, jj; + npy_intp *tmp = NULL, **f = NULL, *g = NULL; char *pi, *pf; Float64 *sampling = sampling_arr ? ((void *)PyArray_DATA(sampling_arr)) : NULL; @@ -929,9 +930,9 @@ } /* Some temporaries */ - f = (maybelong**)malloc(mx * sizeof(maybelong*)); - g = (maybelong*)malloc(mx * sizeof(maybelong)); - tmp = (maybelong*)malloc(mx * input->nd * sizeof(maybelong)); + f = (npy_intp**)malloc(mx * sizeof(npy_intp*)); + g = (npy_intp*)malloc(mx * sizeof(npy_intp)); + tmp = (npy_intp*)malloc(mx * input->nd * sizeof(npy_intp)); if (!f || !g || !tmp) { PyErr_NoMemory(); goto exit; Modified: trunk/scipy/ndimage/src/ni_morphology.h =================================================================== --- trunk/scipy/ndimage/src/ni_morphology.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_morphology.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -33,9 +33,9 @@ #define NI_MORPHOLOGY_H int NI_BinaryErosion(PyArrayObject*, PyArrayObject*, PyArrayObject*, - PyArrayObject*, int, maybelong*, int, int, int*, NI_CoordinateList**); + PyArrayObject*, int, npy_intp*, int, int, int*, NI_CoordinateList**); int NI_BinaryErosion2(PyArrayObject*, PyArrayObject*, PyArrayObject*, - int, maybelong*, int, NI_CoordinateList**); + int, npy_intp*, int, NI_CoordinateList**); int NI_DistanceTransformBruteForce(PyArrayObject*, int, PyArrayObject*, PyArrayObject*, PyArrayObject*); int NI_DistanceTransformOnePass(PyArrayObject*, PyArrayObject *, Modified: trunk/scipy/ndimage/src/ni_support.c =================================================================== --- trunk/scipy/ndimage/src/ni_support.c 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_support.c 2010-09-12 00:57:31 UTC (rev 6747) @@ -84,10 +84,10 @@ /******************************************************************/ /* Allocate line buffer data */ -int NI_AllocateLineBuffer(PyArrayObject* array, int axis, maybelong size1, - maybelong size2, maybelong *lines, maybelong max_size, double **buffer) +int NI_AllocateLineBuffer(PyArrayObject* array, int axis, npy_intp size1, + npy_intp size2, npy_intp *lines, npy_intp max_size, double **buffer) { - maybelong line_size, max_lines; + npy_intp line_size, max_lines; int ii; /* the number of lines of the array is an upper limit for the @@ -120,11 +120,11 @@ } /* Initialize a line buffer */ -int NI_InitLineBuffer(PyArrayObject *array, int axis, maybelong size1, - maybelong size2, maybelong buffer_lines, double *buffer_data, +int NI_InitLineBuffer(PyArrayObject *array, int axis, npy_intp size1, + npy_intp size2, npy_intp buffer_lines, double *buffer_data, NI_ExtendMode extend_mode, double extend_value, NI_LineBuffer *buffer) { - maybelong line_length = 0, array_lines = 0, size; + npy_intp line_length = 0, array_lines = 0, size; int ii; size = 1; @@ -160,10 +160,10 @@ } /* Extend a line in memory to implement boundary conditions: */ -int NI_ExtendLine(double *line, maybelong length, maybelong size1, - maybelong size2, NI_ExtendMode mode, double constant_value) +int NI_ExtendLine(double *line, npy_intp length, npy_intp size1, + npy_intp size2, NI_ExtendMode mode, double constant_value) { - maybelong ii, jj, length1, nextend, rextend; + npy_intp ii, jj, length1, nextend, rextend; double *l1, *l2, *l3, val; switch (mode) { @@ -287,7 +287,7 @@ #define CASE_COPY_DATA_TO_LINE(_pi, _po, _length, _stride, _type) \ case t ## _type: \ { \ - maybelong _ii; \ + npy_intp _ii; \ for(_ii = 0; _ii < _length; _ii++) { \ _po[_ii] = (double)*(_type*)_pi; \ _pi += _stride; \ @@ -298,11 +298,11 @@ /* Copy a line from an array to a buffer: */ int NI_ArrayToLineBuffer(NI_LineBuffer *buffer, - maybelong *number_of_lines, int *more) + npy_intp *number_of_lines, int *more) { double *pb = buffer->buffer_data; char *pa; - maybelong length = buffer->line_length; + npy_intp length = buffer->line_length; pb += buffer->size1; *number_of_lines = 0; @@ -327,7 +327,8 @@ CASE_COPY_DATA_TO_LINE(pa, pb, length, buffer->line_stride, Float32); CASE_COPY_DATA_TO_LINE(pa, pb, length, buffer->line_stride, Float64); default: - PyErr_Format(PyExc_RuntimeError, "array type %d not supported", buffer->array_type); + PyErr_Format(PyExc_RuntimeError, "array type %d not supported", + buffer->array_type); return 0; } /* goto next line in the array: */ @@ -352,7 +353,7 @@ #define CASE_COPY_LINE_TO_DATA(_pi, _po, _length, _stride, _type) \ case t ## _type: \ { \ - maybelong _ii; \ + npy_intp _ii; \ for(_ii = 0; _ii < _length; _ii++) { \ *(_type*)_po = (_type)_pi[_ii]; \ _po += _stride; \ @@ -365,7 +366,7 @@ { double *pb = buffer->buffer_data; char *pa; - maybelong jj, length = buffer->line_length; + npy_intp jj, length = buffer->line_length; pb += buffer->size1; for(jj = 0; jj < buffer->buffer_lines; jj++) { @@ -408,12 +409,12 @@ /* Initialize a filter iterator: */ int -NI_InitFilterIterator(int rank, maybelong *filter_shape, - maybelong filter_size, maybelong *array_shape, - maybelong *origins, NI_FilterIterator *iterator) +NI_InitFilterIterator(int rank, npy_intp *filter_shape, + npy_intp filter_size, npy_intp *array_shape, + npy_intp *origins, NI_FilterIterator *iterator) { int ii; - maybelong fshape[MAXDIM], forigins[MAXDIM]; + npy_intp fshape[MAXDIM], forigins[MAXDIM]; for(ii = 0; ii < rank; ii++) { fshape[ii] = *filter_shape++; @@ -424,15 +425,15 @@ if (rank > 0) { iterator->strides[rank - 1] = filter_size; for(ii = rank - 2; ii >= 0; ii--) { - maybelong step = array_shape[ii + 1] < fshape[ii + 1] ? + npy_intp step = array_shape[ii + 1] < fshape[ii + 1] ? array_shape[ii + 1] : fshape[ii + 1]; iterator->strides[ii] = iterator->strides[ii + 1] * step; } } for(ii = 0; ii < rank; ii++) { - maybelong step = array_shape[ii] < fshape[ii] ? + npy_intp step = array_shape[ii] < fshape[ii] ? array_shape[ii] : fshape[ii]; - maybelong orgn = fshape[ii] / 2 + forigins[ii]; + npy_intp orgn = fshape[ii] / 2 + forigins[ii]; /* stride for stepping back to previous offsets: */ iterator->backstrides[ii] = (step - 1) * iterator->strides[ii]; /* initialize boundary extension sizes: */ @@ -445,22 +446,22 @@ /* Calculate the offsets to the filter points, for all border regions and the interior of the array: */ int NI_InitFilterOffsets(PyArrayObject *array, Bool *footprint, - maybelong *filter_shape, maybelong* origins, - NI_ExtendMode mode, maybelong **offsets, maybelong *border_flag_value, - maybelong **coordinate_offsets) + npy_intp *filter_shape, npy_intp* origins, + NI_ExtendMode mode, npy_intp **offsets, npy_intp *border_flag_value, + npy_intp **coordinate_offsets) { int rank, ii; - maybelong kk, ll, filter_size = 1, offsets_size = 1, max_size = 0; - maybelong max_stride = 0, *ashape = NULL, *astrides = NULL; - maybelong footprint_size = 0, coordinates[MAXDIM], position[MAXDIM]; - maybelong fshape[MAXDIM], forigins[MAXDIM], *po, *pc = NULL; + npy_intp kk, ll, filter_size = 1, offsets_size = 1, max_size = 0; + npy_intp max_stride = 0, *ashape = NULL, *astrides = NULL; + npy_intp footprint_size = 0, coordinates[MAXDIM], position[MAXDIM]; + npy_intp fshape[MAXDIM], forigins[MAXDIM], *po, *pc = NULL; rank = array->nd; ashape = array->dimensions; astrides = array->strides; for(ii = 0; ii < rank; ii++) { fshape[ii] = *filter_shape++; - forigins[ii] = origins ? *origins++ : 0.0; + forigins[ii] = origins ? *origins++ : 0; } /* the size of the footprint array: */ for(ii = 0; ii < rank; ii++) @@ -477,22 +478,22 @@ for(ii = 0; ii < rank; ii++) offsets_size *= (ashape[ii] < fshape[ii] ? ashape[ii] : fshape[ii]); /* allocate offsets data: */ - *offsets = (maybelong*)malloc(offsets_size * footprint_size * - sizeof(maybelong)); + *offsets = (npy_intp*)malloc(offsets_size * footprint_size * + sizeof(npy_intp)); if (!*offsets) { PyErr_NoMemory(); goto exit; } if (coordinate_offsets) { - *coordinate_offsets = (maybelong*)malloc(offsets_size * rank * - footprint_size * sizeof(maybelong)); + *coordinate_offsets = (npy_intp*)malloc(offsets_size * rank * + footprint_size * sizeof(npy_intp)); if (!*coordinate_offsets) { PyErr_NoMemory(); goto exit; } } for(ii = 0; ii < rank; ii++) { - maybelong stride; + npy_intp stride; /* find maximum axis size: */ if (ashape[ii] > max_size) max_size = ashape[ii]; @@ -518,14 +519,14 @@ for(ll = 0; ll < offsets_size; ll++) { /* iterate over the elements in the footprint array: */ for(kk = 0; kk < filter_size; kk++) { - maybelong offset = 0; + npy_intp offset = 0; /* only calculate an offset if the footprint is 1: */ if (!footprint || footprint[kk]) { /* find offsets along all axes: */ for(ii = 0; ii < rank; ii++) { - maybelong orgn = fshape[ii] / 2 + forigins[ii]; - maybelong cc = coordinates[ii] - orgn + position[ii]; - maybelong len = ashape[ii]; + npy_intp orgn = fshape[ii] / 2 + forigins[ii]; + npy_intp cc = coordinates[ii] - orgn + position[ii]; + npy_intp len = ashape[ii]; /* apply boundary conditions, if necessary: */ switch (mode) { case NI_EXTEND_MIRROR: @@ -612,8 +613,8 @@ pc[ii] = 0; break; } else { - /* use an offset that is possibly mapped from outside the - border: */ + /* use an offset that is possibly mapped from outside + the border: */ cc = cc - position[ii]; offset += astrides[ii] * cc; if (coordinate_offsets) @@ -705,8 +706,8 @@ PyErr_NoMemory(); goto exit; } - block->coordinates = (maybelong*)malloc(list->block_size * list->rank * - sizeof(maybelong)); + block->coordinates = (npy_intp*)malloc(list->block_size * list->rank * + sizeof(npy_intp)); if (!block->coordinates) { PyErr_NoMemory(); goto exit; Modified: trunk/scipy/ndimage/src/ni_support.h =================================================================== --- trunk/scipy/ndimage/src/ni_support.h 2010-09-12 00:57:08 UTC (rev 6746) +++ trunk/scipy/ndimage/src/ni_support.h 2010-09-12 00:57:31 UTC (rev 6747) @@ -63,10 +63,10 @@ /* the iterator structure: */ typedef struct { int rank_m1; - maybelong dimensions[MAXDIM]; - maybelong coordinates[MAXDIM]; - maybelong strides[MAXDIM]; - maybelong backstrides[MAXDIM]; + npy_intp dimensions[MAXDIM]; + npy_intp coordinates[MAXDIM]; + npy_intp strides[MAXDIM]; + npy_intp backstrides[MAXDIM]; } NI_Iterator; /* initialize iterations over single array elements: */ @@ -156,8 +156,8 @@ /* the linebuffer structure: */ typedef struct { double *buffer_data; - maybelong buffer_lines, line_length, line_stride; - maybelong size1, size2, array_lines, next_line; + npy_intp buffer_lines, line_length, line_stride; + npy_intp size1, size2, array_lines, next_line; NI_Iterator iterator; char* array_data; NumarrayType array_type; @@ -170,18 +170,18 @@ ((_buffer).buffer_data + (_line) * ((_buffer).line_length + \ (_buffer).size1 + (_buffer).size2)) /* Allocate line buffer data */ -int NI_AllocateLineBuffer(PyArrayObject*, int, maybelong, maybelong, - maybelong*, maybelong, double**); +int NI_AllocateLineBuffer(PyArrayObject*, int, npy_intp, npy_intp, + npy_intp*, npy_intp, double**); /* Initialize a line buffer */ -int NI_InitLineBuffer(PyArrayObject*, int, maybelong, maybelong, maybelong, +int NI_InitLineBuffer(PyArrayObject*, int, npy_intp, npy_intp, npy_intp, double*, NI_ExtendMode, double, NI_LineBuffer*); /* Extend a line in memory to implement boundary conditions: */ -int NI_ExtendLine(double*, maybelong, maybelong, maybelong, NI_ExtendMode, double); +int NI_ExtendLine(double*, npy_intp, npy_intp, npy_intp, NI_ExtendMode, double); /* Copy a line from an array to a buffer: */ -int NI_ArrayToLineBuffer(NI_LineBuffer*, maybelong*, int*); +int NI_ArrayToLineBuffer(NI_LineBuffer*, npy_intp*, int*); /* Copy a line from a buffer to an array: */ int NI_LineBufferToArray(NI_LineBuffer*); @@ -192,18 +192,19 @@ /* the filter iterator structure: */ typedef struct { - maybelong strides[MAXDIM], backstrides[MAXDIM]; - maybelong bound1[MAXDIM], bound2[MAXDIM]; + npy_intp strides[MAXDIM], backstrides[MAXDIM]; + npy_intp bound1[MAXDIM], bound2[MAXDIM]; } NI_FilterIterator; /* Initialize a filter iterator: */ -int NI_InitFilterIterator(int, maybelong*, maybelong, maybelong*, - maybelong*, NI_FilterIterator*); +int NI_InitFilterIterator(int, npy_intp*, npy_intp, npy_intp*, + npy_intp*, NI_FilterIterator*); /* Calculate the offsets to the filter points, for all border regions and the interior of the array: */ -int NI_InitFilterOffsets(PyArrayObject*, Bool*, maybelong*, - maybelong*, NI_ExtendMode, maybelong**, maybelong*, maybelong**); +int NI_InitFilterOffsets(PyArrayObject*, Bool*, npy_intp*, + npy_intp*, NI_ExtendMode, npy_intp**, + npy_intp*, npy_intp**); /* Move to the next point in an array, possible changing the filter offsets, to adapt to boundary conditions: */ @@ -211,7 +212,7 @@ { \ int _ii; \ for(_ii = (iterator1).rank_m1; _ii >= 0; _ii--) { \ - maybelong _pp = (iterator1).coordinates[_ii]; \ + npy_intp _pp = (iterator1).coordinates[_ii]; \ if (_pp < (iterator1).dimensions[_ii]) { \ if (_pp < (iteratorf).bound1[_ii] || \ _pp >= (iteratorf).bound2[_ii]) \ @@ -235,7 +236,7 @@ { \ int _ii; \ for(_ii = (iterator1).rank_m1; _ii >= 0; _ii--) { \ - maybelong _pp = (iterator1).coordinates[_ii]; \ + npy_intp _pp = (iterator1).coordinates[_ii]; \ if (_pp < (iterator1).dimensions[_ii]) { \ if (_pp < (iteratorf).bound1[_ii] || \ _pp >= (iteratorf).bound2[_ii]) \ @@ -261,7 +262,7 @@ { \ int _ii; \ for(_ii = (iterator1).rank_m1; _ii >= 0; _ii--) { \ - maybelong _pp = (iterator1).coordinates[_ii]; \ + npy_intp _pp = (iterator1).coordinates[_ii]; \ if (_pp < (iterator1).dimensions[_ii]) { \ if (_pp < (iteratorf).bound1[_ii] || \ _pp >= (iteratorf).bound2[_ii]) \ @@ -286,12 +287,12 @@ #define NI_FILTER_GOTO(iteratorf, iterator, fbase, pointerf) \ { \ int _ii; \ - maybelong _jj; \ + npy_intp _jj; \ pointerf = fbase; \ for(_ii = iterator.rank_m1; _ii >= 0; _ii--) { \ - maybelong _pp = iterator.coordinates[_ii]; \ - maybelong b1 = (iteratorf).bound1[_ii]; \ - maybelong b2 = (iteratorf).bound2[_ii]; \ + npy_intp _pp = iterator.coordinates[_ii]; \ + npy_intp b1 = (iteratorf).bound1[_ii]; \ + npy_intp b2 = (iteratorf).bound2[_ii]; \ if (_pp < b1) { \ _jj = _pp; \ } else if (_pp > b2 && b2 >= b1) { \ @@ -304,7 +305,7 @@ } typedef struct { - maybelong *coordinates; + npy_intp *coordinates; int size; void *next; } NI_CoordinateBlock; From scipy-svn at scipy.org Sat Sep 11 20:57:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:57:47 -0500 (CDT) Subject: [Scipy-svn] r6748 - in trunk/scipy/signal: . tests Message-ID: <20100912005747.6148A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:57:47 -0500 (Sat, 11 Sep 2010) New Revision: 6748 Modified: trunk/scipy/signal/tests/test_signaltools.py trunk/scipy/signal/windows.py Log: 3K: signal: fix types.* issues Modified: trunk/scipy/signal/tests/test_signaltools.py =================================================================== --- trunk/scipy/signal/tests/test_signaltools.py 2010-09-12 00:57:31 UTC (rev 6747) +++ trunk/scipy/signal/tests/test_signaltools.py 2010-09-12 00:57:47 UTC (rev 6748) @@ -569,11 +569,17 @@ assert_array_almost_equal(y, y_r) self.failUnless(y.dtype == self.dt) +def _get_testcorrelate_class(i, base): + class TestCorrelateX(base): + dt = i + TestCorrelateX.__name__ = "TestCorrelate%s" % i.__name__.title() + return TestCorrelateX + for i in [np.ubyte, np.byte, np.ushort, np.short, np.uint, np.int, np.ulonglong, np.ulonglong, np.float32, np.float64, np.longdouble, Decimal]: - name = "TestCorrelate%s" % i.__name__.title() - globals()[name] = types.ClassType(name, (_TestCorrelateReal,), {"dt": i}) + cls = _get_testcorrelate_class(i, _TestCorrelateReal) + globals()[cls.__name__] = cls class _TestCorrelateComplex(TestCase): dt = None @@ -660,8 +666,8 @@ self.failUnless(y.dtype == self.dt) for i in [np.csingle, np.cdouble, np.clongdouble]: - name = "TestCorrelate%s" % i.__name__.title() - globals()[name] = types.ClassType(name, (_TestCorrelateComplex,), {"dt": i}) + cls = _get_testcorrelate_class(i, _TestCorrelateComplex) + globals()[cls.__name__] = cls class TestFiltFilt: def test_basic(self): Modified: trunk/scipy/signal/windows.py =================================================================== --- trunk/scipy/signal/windows.py 2010-09-12 00:57:31 UTC (rev 6747) +++ trunk/scipy/signal/windows.py 2010-09-12 00:57:47 UTC (rev 6748) @@ -423,11 +423,11 @@ beta = float(window) except (TypeError, ValueError): args = () - if isinstance(window, types.TupleType): + if isinstance(window, tuple): winstr = window[0] if len(window) > 1: args = window[1:] - elif isinstance(window, types.StringType): + elif isinstance(window, str): if window in ['kaiser', 'ksr', 'gaussian', 'gauss', 'gss', 'general gaussian', 'general_gaussian', 'general gauss', 'general_gauss', 'ggs', From scipy-svn at scipy.org Sat Sep 11 20:58:00 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:58:00 -0500 (CDT) Subject: [Scipy-svn] r6749 - trunk/tools Message-ID: <20100912005800.6699339CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:58:00 -0500 (Sat, 11 Sep 2010) New Revision: 6749 Modified: trunk/tools/py3tool.py Log: ENH: 3K: optionally use lib2to3cache in the 2to3 conversion Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:57:47 UTC (rev 6748) +++ trunk/tools/py3tool.py 2010-09-12 00:58:00 UTC (rev 6749) @@ -26,6 +26,9 @@ import subprocess import fnmatch +if os.environ.get('USE_2TO3CACHE'): + import lib2to3cache + BASE = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) TEMP = os.path.normpath(os.path.join(BASE, '_py3k')) From scipy-svn at scipy.org Sat Sep 11 20:58:13 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:58:13 -0500 (CDT) Subject: [Scipy-svn] r6750 - trunk/scipy/io Message-ID: <20100912005813.9944239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:58:13 -0500 (Sat, 11 Sep 2010) New Revision: 6750 Modified: trunk/scipy/io/__init__.py Log: 3K: io: use import in a way that does not confuse 2to3 Modified: trunk/scipy/io/__init__.py =================================================================== --- trunk/scipy/io/__init__.py 2010-09-12 00:58:00 UTC (rev 6749) +++ trunk/scipy/io/__init__.py 2010-09-12 00:58:13 UTC (rev 6750) @@ -14,7 +14,7 @@ from netcdf import netcdf_file, netcdf_variable from recaster import sctype_attributes, Recaster -import matlab.byteordercodes as byteordercodes +from matlab import byteordercodes from data_store import save_as_module from mmio import mminfo, mmread, mmwrite from idl import readsav From scipy-svn at scipy.org Sat Sep 11 20:58:25 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:58:25 -0500 (CDT) Subject: [Scipy-svn] r6751 - trunk/tools Message-ID: <20100912005825.CCD8139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:58:25 -0500 (Sat, 11 Sep 2010) New Revision: 6751 Modified: trunk/tools/py3tool.py Log: 3K: py3tool: add interpolate.interpnd to the lists Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 00:58:13 UTC (rev 6750) +++ trunk/tools/py3tool.py 2010-09-12 00:58:25 UTC (rev 6751) @@ -150,6 +150,7 @@ os.path.join('interpolate', 'fitpack2.py'), os.path.join('interpolate', 'interpolate.py'), os.path.join('interpolate', 'interpolate_wrapper.py'), + os.path.join('interpolate', 'ndgriddata.py'), os.path.join('io', 'array_import.py'), os.path.join('io', '__init__.py'), os.path.join('linalg', 'basic.py'), @@ -203,7 +204,8 @@ 'futil', 'mvn', '_nd_image', 'numpyio', - '_superlu', '_arpack', '_iterative', '_umfpack' + '_superlu', '_arpack', '_iterative', '_umfpack', + 'interpnd' ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 20:58:37 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:58:37 -0500 (CDT) Subject: [Scipy-svn] r6752 - trunk/scipy/spatial Message-ID: <20100912005837.CEC3339CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:58:37 -0500 (Sat, 11 Sep 2010) New Revision: 6752 Modified: trunk/scipy/spatial/kdtree.py Log: 3K: spatial: adapt kdtree to undefined comparison in Python 3 for None and instances Modified: trunk/scipy/spatial/kdtree.py =================================================================== --- trunk/scipy/spatial/kdtree.py 2010-09-12 00:58:25 UTC (rev 6751) +++ trunk/scipy/spatial/kdtree.py 2010-09-12 00:58:37 UTC (rev 6752) @@ -1,5 +1,6 @@ # Copyright Anne M. Archibald 2008 # Released under the scipy license +import sys import numpy as np from heapq import heappush, heappop import scipy.sparse @@ -136,7 +137,12 @@ self.tree = self.__build(np.arange(self.n), self.maxes, self.mins) class node(object): - pass + if sys.version_info[0] >= 3: + def __lt__(self, other): id(self) < id(other) + def __gt__(self, other): id(self) > id(other) + def __le__(self, other): id(self) <= id(other) + def __ge__(self, other): id(self) >= id(other) + def __eq__(self, other): id(self) == id(other) class leafnode(node): def __init__(self, idx): self.idx = idx @@ -364,7 +370,10 @@ raise ValueError("Only p-norms with 1<=p<=infinity permitted") retshape = np.shape(x)[:-1] if retshape!=(): - if k>1: + if k is None: + dd = np.empty(retshape,dtype=np.object) + ii = np.empty(retshape,dtype=np.object) + elif k>1: dd = np.empty(retshape+(k,),dtype=np.float) dd.fill(np.inf) ii = np.empty(retshape+(k,),dtype=np.int) @@ -374,14 +383,14 @@ dd.fill(np.inf) ii = np.empty(retshape,dtype=np.int) ii.fill(self.n) - elif k is None: - dd = np.empty(retshape,dtype=np.object) - ii = np.empty(retshape,dtype=np.object) else: raise ValueError("Requested %s nearest neighbors; acceptable numbers are integers greater than or equal to one, or None") for c in np.ndindex(retshape): hits = self.__query(x[c], k=k, p=p, distance_upper_bound=distance_upper_bound) - if k>1: + if k is None: + dd[c] = [d for (d,i) in hits] + ii[c] = [i for (d,i) in hits] + elif k>1: for j in range(len(hits)): dd[c+(j,)], ii[c+(j,)] = hits[j] elif k==1: @@ -390,13 +399,12 @@ else: dd[c] = np.inf ii[c] = self.n - elif k is None: - dd[c] = [d for (d,i) in hits] - ii[c] = [i for (d,i) in hits] return dd, ii else: hits = self.__query(x, k=k, p=p, distance_upper_bound=distance_upper_bound) - if k==1: + if k is None: + return [d for (d,i) in hits], [i for (d,i) in hits] + elif k==1: if len(hits)>0: return hits[0] else: @@ -409,8 +417,6 @@ for j in range(len(hits)): dd[j], ii[j] = hits[j] return dd, ii - elif k is None: - return [d for (d,i) in hits], [i for (d,i) in hits] else: raise ValueError("Requested %s nearest neighbors; acceptable numbers are integers greater than or equal to one, or None") From scipy-svn at scipy.org Sat Sep 11 20:58:50 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:58:50 -0500 (CDT) Subject: [Scipy-svn] r6753 - trunk/scipy/linalg Message-ID: <20100912005850.6045A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:58:50 -0500 (Sat, 11 Sep 2010) New Revision: 6753 Modified: trunk/scipy/linalg/atlas_version.c Log: 3K: linalg: make atlas_version module importable on Py3 Modified: trunk/scipy/linalg/atlas_version.c =================================================================== --- trunk/scipy/linalg/atlas_version.c 2010-09-12 00:58:37 UTC (rev 6752) +++ trunk/scipy/linalg/atlas_version.c 2010-09-12 00:58:50 UTC (rev 6753) @@ -1,4 +1,5 @@ #include "Python.h" +#include "numpy/npy_3kcompat.h" static PyObject* version(PyObject* self, PyObject* dummy) { @@ -52,7 +53,8 @@ #if defined(ATLAS_INFO) { PyObject *d = PyModule_GetDict(m); - PyDict_SetItemString(d,"ATLAS_VERSION",PyString_FromString(ATLAS_INFO)); + PyDict_SetItemString(d,"ATLAS_VERSION", + PyUString_FromString(ATLAS_INFO)); } #endif return RETVAL; From scipy-svn at scipy.org Sat Sep 11 20:59:03 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:59:03 -0500 (CDT) Subject: [Scipy-svn] r6754 - trunk/scipy/io Message-ID: <20100912005903.8E56A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:59:03 -0500 (Sat, 11 Sep 2010) New Revision: 6754 Modified: trunk/scipy/io/__init__.py Log: 3K: io: more import fixes Modified: trunk/scipy/io/__init__.py =================================================================== --- trunk/scipy/io/__init__.py 2010-09-12 00:58:50 UTC (rev 6753) +++ trunk/scipy/io/__init__.py 2010-09-12 00:59:03 UTC (rev 6754) @@ -8,7 +8,7 @@ # matfile read and write -from matlab.mio import loadmat, savemat +from matlab import loadmat, savemat # netCDF file support from netcdf import netcdf_file, netcdf_variable From scipy-svn at scipy.org Sat Sep 11 20:59:16 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:59:16 -0500 (CDT) Subject: [Scipy-svn] r6755 - trunk/scipy/interpolate Message-ID: <20100912005916.4B08639CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:59:16 -0500 (Sat, 11 Sep 2010) New Revision: 6755 Modified: trunk/scipy/interpolate/rbf.py Log: 3K: interpolate: make Rbf._init_function introspection Py3 compatible Modified: trunk/scipy/interpolate/rbf.py =================================================================== --- trunk/scipy/interpolate/rbf.py 2010-09-12 00:59:03 UTC (rev 6754) +++ trunk/scipy/interpolate/rbf.py 2010-09-12 00:59:16 UTC (rev 6755) @@ -141,9 +141,9 @@ ", ".join(functionlist) self._function = getattr(self, "_h_"+self.function) elif callable(self.function): - import new allow_one = False - if hasattr(self.function, 'func_code'): + if hasattr(self.function, 'func_code') or \ + hasattr(self.function, '__code__'): val = self.function allow_one = True elif hasattr(self.function, "im_func"): @@ -157,7 +157,12 @@ if allow_one and argcount == 1: self._function = self.function elif argcount == 2: - self._function = new.instancemethod(self.function, self, Rbf) + if sys.version_info[0] >= 3: + self._function = function.__get__(self, Rbf) + else: + import new + self._function = new.instancemethod(self.function, self, + Rbf) else: raise ValueError, "Function argument must take 1 or 2 arguments." From scipy-svn at scipy.org Sat Sep 11 20:59:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:59:29 -0500 (CDT) Subject: [Scipy-svn] r6756 - trunk/scipy/optimize Message-ID: <20100912005929.8803E39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:59:29 -0500 (Sat, 11 Sep 2010) New Revision: 6756 Modified: trunk/scipy/optimize/optimize.py Log: 3K: optimize: fix integer division in brute() Modified: trunk/scipy/optimize/optimize.py =================================================================== --- trunk/scipy/optimize/optimize.py 2010-09-12 00:59:16 UTC (rev 6755) +++ trunk/scipy/optimize/optimize.py 2010-09-12 00:59:29 UTC (rev 6756) @@ -1583,7 +1583,7 @@ for k in range(N-1,-1,-1): thisN = Nshape[k] Nindx[k] = indx % Nshape[k] - indx = indx / thisN + indx = indx // thisN for k in range(N): xmin[k] = grid[k][tuple(Nindx)] From scipy-svn at scipy.org Sat Sep 11 20:59:41 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:59:41 -0500 (CDT) Subject: [Scipy-svn] r6757 - trunk/scipy/optimize Message-ID: <20100912005941.D3B5039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:59:41 -0500 (Sat, 11 Sep 2010) New Revision: 6757 Modified: trunk/scipy/optimize/linesearch.py Log: 3K: optimize: fix bytes issue in scalar_search_wolfe1 Modified: trunk/scipy/optimize/linesearch.py =================================================================== --- trunk/scipy/optimize/linesearch.py 2010-09-12 00:59:29 UTC (rev 6756) +++ trunk/scipy/optimize/linesearch.py 2010-09-12 00:59:41 UTC (rev 6757) @@ -1,5 +1,6 @@ from scipy.optimize import minpack2 import numpy as np +from numpy.compat import asbytes __all__ = ['line_search_wolfe1', 'line_search_wolfe2', 'scalar_search_wolfe1', 'scalar_search_wolfe2', @@ -138,20 +139,20 @@ derphi1 = derphi0 isave = np.zeros((2,), np.intc) dsave = np.zeros((13,), float) - task = 'START' + task = asbytes('START') while 1: stp, phi1, derphi1, task = minpack2.dcsrch(alpha1, phi1, derphi1, c1, c2, xtol, task, amin, amax, isave, dsave) - if task[:2] == 'FG': + if task[:2] == asbytes('FG'): alpha1 = stp phi1 = phi(stp) derphi1 = derphi(stp) else: break - if task[:5] == 'ERROR' or task[:4] == 'WARN': + if task[:5] == asbytes('ERROR') or task[:4] == asbytes('WARN'): stp = None # failed return stp, phi1, phi0 From scipy-svn at scipy.org Sat Sep 11 20:59:53 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 19:59:53 -0500 (CDT) Subject: [Scipy-svn] r6758 - trunk/doc Message-ID: <20100912005953.F274739CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 19:59:53 -0500 (Sat, 11 Sep 2010) New Revision: 6758 Added: trunk/doc/Py3K.txt Log: 3K: doc: add some notes Added: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt (rev 0) +++ trunk/doc/Py3K.txt 2010-09-12 00:59:53 UTC (rev 6758) @@ -0,0 +1,28 @@ +================ +Python 3 porting +================ + +Test status (as of 2010-09-10) +------------------------------ + +* cluster OK +* constants OK +* fftpack OK +* integrate OK +* interpolate OK +* lib OK +* linalg OK +* maxentropy OK +* misc OK +* ndimage OK +* odr OK +* optimize OK +* signal OK +* spatial OK +* special OK + + +* io ERROR (matlab stuff) +* sparse ERROR +* stats ERROR +* weave ERROR From scipy-svn at scipy.org Sat Sep 11 21:00:08 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:00:08 -0500 (CDT) Subject: [Scipy-svn] r6759 - trunk/scipy/optimize/tests Message-ID: <20100912010008.5018A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:00:08 -0500 (Sat, 11 Sep 2010) New Revision: 6759 Modified: trunk/scipy/optimize/tests/test_linesearch.py trunk/scipy/optimize/tests/test_optimize.py Log: TST: optimize: bump test tolerance in fmin_ncg -- the exact optimization trace is 1e-6 sensitive to numerical noise Modified: trunk/scipy/optimize/tests/test_linesearch.py =================================================================== --- trunk/scipy/optimize/tests/test_linesearch.py 2010-09-12 00:59:53 UTC (rev 6758) +++ trunk/scipy/optimize/tests/test_linesearch.py 2010-09-12 01:00:08 UTC (rev 6759) @@ -123,9 +123,9 @@ c += 1 s, phi1, phi0 = ls.scalar_search_wolfe1(phi, derphi, phi(0), old_phi0, derphi(0)) - assert_equal(phi0, phi(0)) - assert_equal(phi1, phi(s)) - assert_wolfe(s, phi, derphi) + assert_equal(phi0, phi(0), name) + assert_equal(phi1, phi(s), name) + assert_wolfe(s, phi, derphi, err_msg=name) assert c > 3 # check that the iterator really works... Modified: trunk/scipy/optimize/tests/test_optimize.py =================================================================== --- trunk/scipy/optimize/tests/test_optimize.py 2010-09-12 00:59:53 UTC (rev 6758) +++ trunk/scipy/optimize/tests/test_optimize.py 2010-09-12 01:00:08 UTC (rev 6759) @@ -181,7 +181,7 @@ assert np.allclose(self.trace[3:5], [[-4.35700753e-07, -5.24869435e-01, 4.87527480e-01], [-4.35700753e-07, -5.24869401e-01, 4.87527774e-01]], - atol=1e-14, rtol=1e-7), self.trace[3:5] + atol=1e-6, rtol=1e-7), self.trace[:5] def test_l_bfgs_b(self): From scipy-svn at scipy.org Sat Sep 11 21:00:29 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:00:29 -0500 (CDT) Subject: [Scipy-svn] r6760 - in trunk: scipy/stats scipy/stats/tests tools Message-ID: <20100912010029.A086839CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:00:29 -0500 (Sat, 11 Sep 2010) New Revision: 6760 Modified: trunk/scipy/stats/_support.py trunk/scipy/stats/distributions.py trunk/scipy/stats/morestats.py trunk/scipy/stats/stats.py trunk/scipy/stats/tests/test_discrete_basic.py trunk/scipy/stats/tests/test_stats.py trunk/tools/py3tool.py Log: 3K: stats: minimal changes to make scipy.stats to import Modified: trunk/scipy/stats/_support.py =================================================================== --- trunk/scipy/stats/_support.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/_support.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -1,9 +1,11 @@ from numpy import asarray -import stats import numpy as np -from types import ListType, TupleType, StringType import copy +ListType = list +TupleType = tuple +StringType = str + def abut(source, *args): # comment: except for the repetition, this is equivalent to hstack. """\nLike the |Stat abut command. It concatenates two arrays column-wise @@ -236,7 +238,7 @@ item.append(cfcn(avgcol)) if stderr: if len(avgcol)>1: - item.append(stats.stderr(avgcol)) + item.append(compute_stderr(avgcol)) else: item.append('N/A') if ns: @@ -248,7 +250,30 @@ new_a = np.array(newlist,'O') return new_a +def _chk_asarray(a, axis): + if axis is None: + a = np.ravel(a) + outaxis = 0 + else: + a = np.asarray(a) + outaxis = axis + return a, outaxis +def _chk2_asarray(a, b, axis): + if axis is None: + a = np.ravel(a) + b = np.ravel(b) + outaxis = 0 + else: + a = np.asarray(a) + b = np.asarray(b) + outaxis = axis + return a, b, outaxis + +def compute_stderr(a, axis=0, ddof=1): + a, axis = _chk_asarray(a, axis) + return np.std(a,axis,ddof=1) / float(np.sqrt(a.shape[axis])) + def makestr(item): if type(item) != StringType: item = str(item) Modified: trunk/scipy/stats/distributions.py =================================================================== --- trunk/scipy/stats/distributions.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/distributions.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -81,9 +81,15 @@ from scipy.misc import doccer all = alltrue sgf = vectorize -import new +try: + from new import instancemethod +except ImportError: + # Python 3 + def instancemethod(func, obj, cls): + return types.MethodType(func, obj) + # These are the docstring parts used for substitution in specific # distribution docstrings. @@ -266,9 +272,15 @@ # clean up all the separate docstring elements, we do not need them anymore for obj in [s for s in dir() if s.startswith('_doc_')]: exec('del ' + obj) -del s, obj +del obj +try: + del s +except NameError: + # in Python 3, loop variables are not visible after the loop + pass + def _build_random_array(fun, args, size=None): # Build an array by applying function fun to # the arguments in args, creating an array with @@ -542,7 +554,7 @@ # self._size is total size of all output values self._size = product(size, axis=0) - if self._size > 1: + if self._size is not None and self._size > 1: size = numpy.array(size, ndmin=1) if np.all(scale == 0): @@ -4764,17 +4776,17 @@ self.qvals = numpy.cumsum(self.pk,axis=0) self.F = make_dict(self.xk, self.qvals) self.Finv = reverse_dict(self.F) - self._ppf = new.instancemethod(sgf(_drv_ppf,otypes='d'), - self, rv_discrete) - self._pmf = new.instancemethod(sgf(_drv_pmf,otypes='d'), - self, rv_discrete) - self._cdf = new.instancemethod(sgf(_drv_cdf,otypes='d'), - self, rv_discrete) - self._nonzero = new.instancemethod(_drv_nonzero, self, rv_discrete) - self.generic_moment = new.instancemethod(_drv_moment, - self, rv_discrete) - self.moment_gen = new.instancemethod(_drv_moment_gen, + self._ppf = instancemethod(sgf(_drv_ppf,otypes='d'), + self, rv_discrete) + self._pmf = instancemethod(sgf(_drv_pmf,otypes='d'), + self, rv_discrete) + self._cdf = instancemethod(sgf(_drv_cdf,otypes='d'), + self, rv_discrete) + self._nonzero = instancemethod(_drv_nonzero, self, rv_discrete) + self.generic_moment = instancemethod(_drv_moment, self, rv_discrete) + self.moment_gen = instancemethod(_drv_moment_gen, + self, rv_discrete) self.numargs=0 else: cdf_signature = inspect.getargspec(self._cdf.im_func) @@ -4787,14 +4799,14 @@ #correct nin for generic moment vectorization self.vec_generic_moment = sgf(_drv2_moment, otypes='d') self.vec_generic_moment.nin = self.numargs + 2 - self.generic_moment = new.instancemethod(self.vec_generic_moment, - self, rv_discrete) + self.generic_moment = instancemethod(self.vec_generic_moment, + self, rv_discrete) #correct nin for ppf vectorization _vppf = sgf(_drv2_ppfsingle,otypes='d') _vppf.nin = self.numargs + 2 # +1 is for self - self._vecppf = new.instancemethod(_vppf, - self, rv_discrete) + self._vecppf = instancemethod(_vppf, + self, rv_discrete) #now that self.numargs is defined, we can adjust nin self._cdfvec.nin = self.numargs + 1 Modified: trunk/scipy/stats/morestats.py =================================================================== --- trunk/scipy/stats/morestats.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/morestats.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -6,6 +6,7 @@ import math import statlib import stats +from stats import find_repeats import distributions from numpy import isscalar, r_, log, sum, around, unique, asarray from numpy import zeros, arange, sort, amin, amax, any, where, \ @@ -29,13 +30,7 @@ 'circmean', 'circvar', 'circstd', ] -def find_repeats(arr): - """Find repeats in arr and return (repeats, repeat_count) - """ - v1,v2, n = futil.dfreps(arr) - return v1[:n],v2[:n] - ########################################################## ### Bayesian confidence intervals for mean, variance, std ########################################################## Modified: trunk/scipy/stats/stats.py =================================================================== --- trunk/scipy/stats/stats.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/stats.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -203,12 +203,12 @@ import scipy.linalg as linalg import numpy as np -#import scipy.stats #is this a circular import ? -from morestats import find_repeats #is only reference to scipy.stats +import futil import distributions # Local imports. import _support +from _support import _chk_asarray, _chk2_asarray __all__ = ['gmean', 'hmean', 'mean', 'cmedian', 'median', 'mode', 'tmean', 'tvar', 'tmin', 'tmax', 'tstd', 'tsem', @@ -233,26 +233,12 @@ ] -def _chk_asarray(a, axis): - if axis is None: - a = np.ravel(a) - outaxis = 0 - else: - a = np.asarray(a) - outaxis = axis - return a, outaxis +def find_repeats(arr): + """Find repeats in arr and return (repeats, repeat_count) + """ + v1,v2, n = futil.dfreps(arr) + return v1[:n],v2[:n] -def _chk2_asarray(a, b, axis): - if axis is None: - a = np.ravel(a) - b = np.ravel(b) - outaxis = 0 - else: - a = np.asarray(a) - b = np.asarray(b) - outaxis = axis - return a, b, outaxis - ####### ### NAN friendly functions ######## @@ -1642,7 +1628,6 @@ a, axis = _chk_asarray(a, axis) return np.std(a,axis,ddof=1) / float(np.sqrt(a.shape[axis])) - def sem(a, axis=0, ddof=1): """ Calculates the standard error of the mean (or standard error of Modified: trunk/scipy/stats/tests/test_discrete_basic.py =================================================================== --- trunk/scipy/stats/tests/test_discrete_basic.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/tests/test_discrete_basic.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -142,7 +142,7 @@ def check_oth(distfn, arg, msg): #checking other methods of distfn - meanint = round(distfn.stats(*arg)[0]) # closest integer to mean + meanint = round(float(distfn.stats(*arg)[0])) # closest integer to mean npt.assert_almost_equal(distfn.sf(meanint, *arg), 1 - \ distfn.cdf(meanint, *arg), decimal=8) median_sf = distfn.isf(0.5, *arg) Modified: trunk/scipy/stats/tests/test_stats.py =================================================================== --- trunk/scipy/stats/tests/test_stats.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/scipy/stats/tests/test_stats.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -1572,7 +1572,7 @@ def do(self, a, b, axis=None, dtype=None): x = stats.hmean(a, axis=axis, dtype=dtype) assert_almost_equal(b, x) - assert_equal(x.dtype, dtype) + assert_equal(x.dtype, dtype) class GeoMeanTestCase: def test_1dlist(self): @@ -1663,7 +1663,7 @@ #Note this doesn't test when axis is not specified x = stats.gmean(a, axis=axis, dtype=dtype) assert_almost_equal(b, x) - assert_equal(x.dtype, dtype) + assert_equal(x.dtype, dtype) def test_binomtest(): Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 01:00:08 UTC (rev 6759) +++ trunk/tools/py3tool.py 2010-09-12 01:00:29 UTC (rev 6760) @@ -173,6 +173,7 @@ os.path.join('optimize', 'nnls.py'), os.path.join('signal', '__init__.py'), os.path.join('signal', 'bsplines.py'), + os.path.join('signal', 'signaltools.py'), os.path.join('special', '__init__.py'), os.path.join('special', 'basic.py'), os.path.join('special', 'orthogonal.py'), @@ -184,6 +185,11 @@ os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'arpack.py'), os.path.join('sparse', 'linalg', 'eigen', 'arpack', 'speigs.py'), os.path.join('sparse', 'linalg', 'iterative', 'isolve', 'iterative.py'), + os.path.join('stats', 'stats.py'), + os.path.join('stats', 'distributions.py'), + os.path.join('stats', 'morestats.py'), + os.path.join('stats', 'kde.py'), + os.path.join('stats', 'mstats_basic.py'), ] if any(filename.endswith(x) for x in import_mangling): From scipy-svn at scipy.org Sat Sep 11 21:00:45 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:00:45 -0500 (CDT) Subject: [Scipy-svn] r6761 - trunk/scipy/stats/tests Message-ID: <20100912010045.3E21A39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:00:45 -0500 (Sat, 11 Sep 2010) New Revision: 6761 Modified: trunk/scipy/stats/tests/test_stats.py Log: TST: stats: accept rounding to even on Python 3 Modified: trunk/scipy/stats/tests/test_stats.py =================================================================== --- trunk/scipy/stats/tests/test_stats.py 2010-09-12 01:00:29 UTC (rev 6760) +++ trunk/scipy/stats/tests/test_stats.py 2010-09-12 01:00:45 UTC (rev 6761) @@ -12,6 +12,7 @@ assert_approx_equal, assert_raises, run_module_suite from numpy import array, arange, zeros, ravel, float32, float64, power import numpy as np +import sys import scipy.stats as stats @@ -79,9 +80,15 @@ numbers inconsistently). Needless to say, statical packages written in these languages may fail the test as well. """ - for i in range(0,9): - y = round(ROUND[i]) - assert_equal(y,i+1) + if sys.version_info[0] >= 3: + # round to even + for i in range(0,9): + y = round(ROUND[i]) + assert_equal(y, 2*((i+1)//2)) + else: + for i in range(0,9): + y = round(ROUND[i]) + assert_equal(y,i+1) def test_rounding1(self): """ W.II.A.1. Y = INT(2.6*7 -0.2) (Y should be 18)""" From scipy-svn at scipy.org Sat Sep 11 21:01:00 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:01:00 -0500 (CDT) Subject: [Scipy-svn] r6762 - trunk/scipy/stats/tests Message-ID: <20100912010100.7A8D139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:01:00 -0500 (Sat, 11 Sep 2010) New Revision: 6762 Modified: trunk/scipy/stats/tests/test_continuous_basic.py Log: TST: stats: fix test_cont_basic check_distribution_rvs test portion Modified: trunk/scipy/stats/tests/test_continuous_basic.py =================================================================== --- trunk/scipy/stats/tests/test_continuous_basic.py 2010-09-12 01:00:45 UTC (rev 6761) +++ trunk/scipy/stats/tests/test_continuous_basic.py 2010-09-12 01:01:00 UTC (rev 6762) @@ -181,7 +181,7 @@ yield check_sf_logsf, distfn, arg, distname if distname in distmissing: alpha = 0.01 - # yield check_distribution_rvs, dist, args, alpha, rvs + yield check_distribution_rvs, distname, arg, alpha, rvs @npt.dec.slow def test_cont_basic_slow(): @@ -211,7 +211,7 @@ #yield check_oth, distfn, arg # is still missing if distname in distmissing: alpha = 0.01 - yield check_distribution_rvs, dist, args, alpha, rvs + yield check_distribution_rvs, distname, arg, alpha, rvs def check_moment(distfn, arg, m, v, msg): m1 = distfn.moment(1,*arg) From scipy-svn at scipy.org Sat Sep 11 21:01:14 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:01:14 -0500 (CDT) Subject: [Scipy-svn] r6763 - trunk/scipy/special/c_misc Message-ID: <20100912010114.E5E8139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:01:14 -0500 (Sat, 11 Sep 2010) New Revision: 6763 Modified: trunk/scipy/special/c_misc/gammaincinv.c Log: BUG: special: bump gammaincinv relative tolerance limit to 1e-6 -- it's still better than no answer Modified: trunk/scipy/special/c_misc/gammaincinv.c =================================================================== --- trunk/scipy/special/c_misc/gammaincinv.c 2010-09-12 01:01:00 UTC (rev 6762) +++ trunk/scipy/special/c_misc/gammaincinv.c 2010-09-12 01:01:14 UTC (rev 6763) @@ -10,7 +10,7 @@ /* Limits after which to issue warnings about non-convergence */ #define ALLOWED_ATOL (1e-306) -#define ALLOWED_RTOL (1e-9) +#define ALLOWED_RTOL (1e-6) void scipy_special_raise_warning(char *fmt, ...); From scipy-svn at scipy.org Sat Sep 11 21:01:32 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:01:32 -0500 (CDT) Subject: [Scipy-svn] r6764 - in trunk/scipy/io/matlab: . tests Message-ID: <20100912010132.D71F739CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:01:32 -0500 (Sat, 11 Sep 2010) New Revision: 6764 Added: trunk/scipy/io/matlab/py3k.h Modified: trunk/scipy/io/matlab/pyalloc.pxd trunk/scipy/io/matlab/streams.pyx trunk/scipy/io/matlab/tests/test_streams.py Log: 3K: io/matlab: use only GenericStream on Py3 -- getting anything else to work reliably seems hopeless Added: trunk/scipy/io/matlab/py3k.h =================================================================== --- trunk/scipy/io/matlab/py3k.h (rev 0) +++ trunk/scipy/io/matlab/py3k.h 2010-09-12 01:01:32 UTC (rev 6764) @@ -0,0 +1,104 @@ +#include +#include + +#if PY_VERSION_HEX < 0x03000000 + +#include "cStringIO.h" + +#define npy_PyFile_Dup(file, mode) PyFile_AsFile(file) +#define npy_PyFile_DupClose(file, handle) (0) +#define npy_PyFile_Check PyFile_Check + +#else + +/* + * No-op implementation -- always fall back to the generic one. + */ + +static struct PycStringIO_CAPI { + int(*cread)(PyObject *, char **, Py_ssize_t); + int(*creadline)(PyObject *, char **); + int(*cwrite)(PyObject *, const char *, Py_ssize_t); + PyObject *(*cgetvalue)(PyObject *); + PyObject *(*NewOutput)(int); + PyObject *(*NewInput)(PyObject *); + PyTypeObject *InputType, *OutputType; +} *PycStringIO; + +static void PycString_IMPORT() {} + +#define PycStringIO_InputCheck(O) 0 +#define PycStringIO_OutputCheck(O) 0 + +/* + * PyFile_* compatibility + */ + +/* + * Get a FILE* handle to the file represented by the Python object + */ +static FILE* +npy_PyFile_Dup(PyObject *file, char *mode) +{ + int fd, fd2; + PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } + Py_DECREF(ret); + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + return NULL; + } + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); +#ifdef _WIN32 + return _fdopen(fd2, mode); +#else + return fdopen(fd2, mode); +#endif +} + +/* + * Close the dup-ed file handle, and seek the Python one to the current position + */ +static int +npy_PyFile_DupClose(PyObject *file, FILE* handle) +{ + PyObject *ret; + long position; + position = ftell(handle); + fclose(handle); + + ret = PyObject_CallMethod(file, "seek", "li", position, 0); + if (ret == NULL) { + return -1; + } + Py_DECREF(ret); + return 0; +} + +static int +npy_PyFile_Check(PyObject *file) +{ + int fd; + fd = PyObject_AsFileDescriptor(file); + if (fd == -1) { + PyErr_Clear(); + return 0; + } + return 1; +} + +#endif Modified: trunk/scipy/io/matlab/pyalloc.pxd =================================================================== --- trunk/scipy/io/matlab/pyalloc.pxd 2010-09-12 01:01:14 UTC (rev 6763) +++ trunk/scipy/io/matlab/pyalloc.pxd 2010-09-12 01:01:32 UTC (rev 6764) @@ -1,13 +1,13 @@ # -*- python -*- or rather like -from python_string cimport PyString_FromStringAndSize, \ - PyString_AS_STRING, PyString_Size +from cpython cimport PyBytes_FromStringAndSize, \ + PyBytes_AS_STRING, PyBytes_Size # Function to allocate, wrap memory via Python string creation cdef inline object pyalloc_v(Py_ssize_t n, void **pp): - cdef object ob = PyString_FromStringAndSize(NULL, n) - pp[0] = PyString_AS_STRING(ob) + cdef object ob = PyBytes_FromStringAndSize(NULL, n) + pp[0] = PyBytes_AS_STRING(ob) return ob Modified: trunk/scipy/io/matlab/streams.pyx =================================================================== --- trunk/scipy/io/matlab/streams.pyx 2010-09-12 01:01:14 UTC (rev 6763) +++ trunk/scipy/io/matlab/streams.pyx 2010-09-12 01:01:32 UTC (rev 6764) @@ -1,8 +1,10 @@ # -*- python -*- or near enough -from python_string cimport PyString_FromStringAndSize, \ - PyString_AS_STRING, PyString_Size +import sys +from cpython cimport PyBytes_FromStringAndSize, \ + PyBytes_AS_STRING, PyBytes_Size + from pyalloc cimport pyalloc_v cdef extern from "stdlib.h" nogil: @@ -17,28 +19,26 @@ ctypedef struct PyObject: pass ctypedef struct FILE - FILE *PyFile_AsFile(object) size_t fread (void *ptr, size_t size, size_t n, FILE* fptr) int fseek (FILE * fptr, long int offset, int whence) long int ftell (FILE *stream) -cdef extern from "fileobject.h": - ctypedef class __builtin__.file [object PyFileObject]: - pass - -cdef extern from "cStringIO.h": +cdef extern from "py3k.h": # From: # http://svn.pyamf.org/pyamf/tags/release-0.4rc2/cpyamf/util.pyx # (MIT license) - with thanks void PycString_IMPORT() - object StringIO_NewOutput "PycStringIO->NewOutput" (int) - object StringIO_NewInput "PycStringIO->NewInput" (object) int StringIO_cread "PycStringIO->cread" (object, char **, Py_ssize_t) int StringIO_creadline "PycStringIO->creadline" (object, char **) int StringIO_cwrite "PycStringIO->cwrite" (object, char *, Py_ssize_t) object StringIO_cgetvalue "PycStringIO->cgetvalue" (obj) bint PycStringIO_InputCheck(object O) bint PycStringIO_OutputCheck(object O) + + FILE* npy_PyFile_Dup(object file, char *mode) except NULL + int npy_PyFile_DupClose(object file, FILE *handle) except -1 + int npy_PyFile_Check(object file) + # initialize cStringIO PycString_IMPORT @@ -60,11 +60,11 @@ return self.fobj.read(n_bytes) cdef int read_into(self, void *buf, size_t n) except -1: - ''' Read n bytes from stream into pre-allocated buffer `buf` - ''' + """ Read n bytes from stream into pre-allocated buffer `buf` + """ cdef char* d_ptr data = self.fobj.read(n) - if PyString_Size(data) != n: + if PyBytes_Size(data) != n: raise IOError('could not read bytes') return -1 d_ptr = data @@ -72,15 +72,15 @@ return 0 cdef object read_string(self, size_t n, void **pp, int copy=True): - ''' Make new memory, wrap with object ''' + """ Make new memory, wrap with object """ data = self.fobj.read(n) - if PyString_Size(data) != n: + if PyBytes_Size(data) != n: raise IOError('could not read bytes') if copy != True: - pp[0] = PyString_AS_STRING(data) + pp[0] = PyBytes_AS_STRING(data) return data cdef object d_copy = pyalloc_v(n, pp) - memcpy(pp[0], PyString_AS_STRING(data), n) + memcpy(pp[0], PyBytes_AS_STRING(data), n) return d_copy @@ -95,8 +95,8 @@ return GenericStream.seek(self, offset, whence) cdef int read_into(self, void *buf, size_t n) except -1: - ''' Read n bytes from stream into pre-allocated buffer `buf` - ''' + """ Read n bytes from stream into pre-allocated buffer `buf` + """ cdef: size_t n_red char* d_ptr @@ -107,10 +107,10 @@ return 0 cdef object read_string(self, size_t n, void **pp, int copy=True): - ''' Make new memory, wrap with object + """ Make new memory, wrap with object It's not obvious to me how to avoid a copy - ''' + """ cdef: char *d_ptr object obj @@ -127,11 +127,14 @@ def __init__(self, fobj): self.fobj = fobj - self.file = PyFile_AsFile(fobj) - + self.file = npy_PyFile_Dup(fobj, "rb") + + def __del__(self): + npy_PyFile_DupClose(self.fobj, self.file) + cpdef int seek(self, long int offset, int whence=0) except -1: cdef int ret - ''' move `offset` bytes in stream + """ move `offset` bytes in stream Parameters ---------- @@ -148,7 +151,7 @@ Returns ------- ret : int - ''' + """ ret = fseek(self.file, offset, whence) if ret: raise IOError('Failed seek') @@ -159,8 +162,8 @@ return ftell(self.file) cdef int read_into(self, void *buf, size_t n) except -1: - ''' Read n bytes from stream into pre-allocated buffer `buf` - ''' + """ Read n bytes from stream into pre-allocated buffer `buf` + """ cdef: size_t n_red char* d_ptr @@ -171,18 +174,17 @@ return 0 cdef object read_string(self, size_t n, void **pp, int copy=True): - ''' Make new memory, wrap with object ''' + """ Make new memory, wrap with object """ cdef object obj = pyalloc_v(n, pp) cdef size_t n_red = fread(pp[0], 1, n, self.file) if n_red != n: raise IOError('could not read bytes') return obj - def _read_into(GenericStream st, size_t n): # for testing only. Use st.read instead cdef char * d_ptr - my_str = ' ' * n + my_str = b' ' * n d_ptr = my_str st.read_into(d_ptr, n) return my_str @@ -192,17 +194,20 @@ # for testing only. Use st.read instead cdef char *d_ptr cdef object obj = st.read_string(n, &d_ptr, True) - my_str = 'A' * n + my_str = b'A' * n cdef char *mys_ptr = my_str memcpy(mys_ptr, d_ptr, n) return my_str cpdef GenericStream make_stream(object fobj): - ''' Make stream of correct type for file-like `fobj` - ''' - if isinstance(fobj, file): - return FileStream(fobj) + """ Make stream of correct type for file-like `fobj` + """ + if npy_PyFile_Check(fobj): + if sys.version_info[0] >= 3: + return GenericStream(fobj) + else: + return FileStream(fobj) elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): return cStringStream(fobj) return GenericStream(fobj) Modified: trunk/scipy/io/matlab/tests/test_streams.py =================================================================== --- trunk/scipy/io/matlab/tests/test_streams.py 2010-09-12 01:01:14 UTC (rev 6763) +++ trunk/scipy/io/matlab/tests/test_streams.py 2010-09-12 01:01:32 UTC (rev 6764) @@ -4,11 +4,19 @@ import os -import StringIO -import cStringIO +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO + cStringIO = BytesIO +else: + from cStringIO import StringIO as cStringIO + from StringIO import StringIO as BytesIO + from tempfile import mkstemp import numpy as np +from numpy.compat import asbytes from nose.tools import assert_true, assert_false, \ assert_equal, assert_raises @@ -22,15 +30,15 @@ def setup(): - val = 'a\x00string' + val = asbytes('a\x00string') global fs, gs, cs, fname fd, fname = mkstemp() fs = os.fdopen(fd, 'wb') fs.write(val) fs.close() - fs = open(fname) - gs = StringIO.StringIO(val) - cs = cStringIO.StringIO(val) + fs = open(fname, 'rb') + gs = BytesIO(val) + cs = cStringIO(val) def teardown(): @@ -42,9 +50,10 @@ def test_make_stream(): global fs, gs, cs # test stream initialization - yield assert_true, isinstance(make_stream(gs), GenericStream) - yield assert_true, isinstance(make_stream(cs), cStringStream) - yield assert_true, isinstance(make_stream(fs), FileStream) + assert_true(isinstance(make_stream(gs), GenericStream)) + if sys.version_info[0] < 3: + assert_true(isinstance(make_stream(cs), cStringStream)) + assert_true(isinstance(make_stream(fs), FileStream)) def test_tell_seek(): @@ -71,23 +80,23 @@ st = make_stream(s) st.seek(0) res = st.read(-1) - yield assert_equal, res, 'a\x00string' + yield assert_equal, res, asbytes('a\x00string') st.seek(0) res = st.read(4) - yield assert_equal, res, 'a\x00st' + yield assert_equal, res, asbytes('a\x00st') # read into st.seek(0) res = _read_into(st, 4) - yield assert_equal, res, 'a\x00st' + yield assert_equal, res, asbytes('a\x00st') res = _read_into(st, 4) - yield assert_equal, res, 'ring' + yield assert_equal, res, asbytes('ring') yield assert_raises, IOError, _read_into, st, 2 # read alloc st.seek(0) res = _read_string(st, 4) - yield assert_equal, res, 'a\x00st' + yield assert_equal, res, asbytes('a\x00st') res = _read_string(st, 4) - yield assert_equal, res, 'ring' + yield assert_equal, res, asbytes('ring') yield assert_raises, IOError, _read_string, st, 2 if __name__ == "__main__": From scipy-svn at scipy.org Sat Sep 11 21:01:46 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:01:46 -0500 (CDT) Subject: [Scipy-svn] r6765 - trunk/scipy/io/matlab Message-ID: <20100912010146.E770939CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:01:46 -0500 (Sat, 11 Sep 2010) New Revision: 6765 Modified: trunk/scipy/io/matlab/mio5_utils.pyx Log: 3K: io: make matlab/mio5_utils Py3 compatible Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:01:32 UTC (rev 6764) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:01:46 UTC (rev 6765) @@ -16,15 +16,15 @@ from copy import copy as pycopy -from python cimport Py_INCREF, Py_DECREF -from python_object cimport PyObject +from cpython cimport Py_INCREF, Py_DECREF +from cpython cimport PyObject cdef extern from "Python.h": ctypedef struct PyTypeObject: pass -from python_string cimport PyString_Size, PyString_FromString, \ - PyString_FromStringAndSize +from cpython cimport PyBytes_Size, PyBytes_FromString, \ + PyBytes_FromStringAndSize import numpy as np cimport numpy as cnp @@ -167,12 +167,12 @@ # integer-keyed dtypes self.preader = preader for key, dt in preader.dtypes.items(): - if isinstance(key, basestring): + if isinstance(key, str): continue self.dtypes[key] = dt # copy refs to class_dtypes into object pointer array for key, dt in preader.class_dtypes.items(): - if isinstance(key, basestring): + if isinstance(key, str): continue self.class_dtypes[key] = dt # cache correctly byte ordered dtypes @@ -338,7 +338,7 @@ if mod8: self.cstream.seek(8 - mod8, 1) else: # SDE format, make safer home for data - data = PyString_FromStringAndSize(tag_data, byte_count) + data = PyBytes_FromStringAndSize(tag_data, byte_count) pp[0] = data return data @@ -713,7 +713,7 @@ This routine is not much optimized. If I was going to do it, I'd store the codecs as an object pointer array, as for the - .dtypes, I might use python_string.PyString_Decode for decoding, + .dtypes, I might use python_string.PyBytes_Decode for decoding, I'd do something with pointers to pull the LSB out of the uint16 dtype, without using an intermediate array, I guess I'd consider using the numpy C-API for array creation. I'd try and work out @@ -796,10 +796,10 @@ raise ValueError('Only one value for namelength') cdef object names = self.read_int8_string() field_names = [] - n_names = PyString_Size(names) // namelength + n_names = PyBytes_Size(names) // namelength cdef char *n_ptr = names for i in range(n_names): - name = PyString_FromString(n_ptr) + name = PyBytes_FromString(n_ptr) field_names.append(name) n_ptr += namelength n_names_ptr[0] = n_names From scipy-svn at scipy.org Sat Sep 11 21:02:00 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:02:00 -0500 (CDT) Subject: [Scipy-svn] r6766 - trunk/scipy/io/matlab Message-ID: <20100912010200.A21C139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:02:00 -0500 (Sat, 11 Sep 2010) New Revision: 6766 Modified: trunk/scipy/io/matlab/mio5_utils.pyx Log: ENH: io/matlab: avoid swallowing exceptions in VarReader5 methods Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:01:46 UTC (rev 6765) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:02:00 UTC (rev 6766) @@ -342,10 +342,10 @@ pp[0] = data return data - cdef void read_element_into(self, - cnp.uint32_t *mdtype_ptr, - cnp.uint32_t *byte_count_ptr, - void *ptr): + cdef int read_element_into(self, + cnp.uint32_t *mdtype_ptr, + cnp.uint32_t *byte_count_ptr, + void *ptr) except -1: ''' Read element into pre-allocated memory in `ptr` Parameters @@ -379,6 +379,7 @@ mod8 = byte_count % 8 if mod8: self.cstream.seek(8 - mod8, 1) + return 0 cpdef inline cnp.ndarray read_numeric(self, int copy=True): ''' Read numeric data element into ndarray @@ -476,9 +477,9 @@ self.cread_full_tag(&mdtype, &byte_count) return mdtype, byte_count - cdef void cread_full_tag(self, - cnp.uint32_t* mdtype, - cnp.uint32_t* byte_count): + cdef int cread_full_tag(self, + cnp.uint32_t* mdtype, + cnp.uint32_t* byte_count) except -1: ''' C method for reading full u4, u4 tag from stream''' cdef cnp.uint32_t u4s[2] self.cstream.read_into(u4s, 8) @@ -488,6 +489,7 @@ else: mdtype[0] = u4s[0] byte_count[0] = u4s[1] + return 0 cpdef VarHeader5 read_header(self): ''' Return matrix header for current stream position From scipy-svn at scipy.org Sat Sep 11 21:02:18 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:02:18 -0500 (CDT) Subject: [Scipy-svn] r6767 - trunk/scipy/io/matlab/tests Message-ID: <20100912010218.1DD1539CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:02:17 -0500 (Sat, 11 Sep 2010) New Revision: 6767 Modified: trunk/scipy/io/matlab/tests/test_mio.py trunk/scipy/io/matlab/tests/test_mio5_utils.py trunk/scipy/io/matlab/tests/test_mio_funcs.py Log: 3K: io/matlab: port matlab tests Modified: trunk/scipy/io/matlab/tests/test_mio.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio.py 2010-09-12 01:02:00 UTC (rev 6766) +++ trunk/scipy/io/matlab/tests/test_mio.py 2010-09-12 01:02:17 UTC (rev 6767) @@ -4,9 +4,13 @@ Need function load / save / roundtrip tests ''' +import sys from os.path import join as pjoin, dirname from glob import glob -from StringIO import StringIO +if sys.version_info[0] >= 3: + from io import BytesIO +else: + from StringIO import StringIO as BytesIO from tempfile import mkdtemp # functools is only available in Python >=2.5 try: @@ -192,7 +196,7 @@ {'name': 'object', 'expected': {'testobject': MO} }) -u_str = file( +u_str = open( pjoin(test_data_path, 'japanese_utf8.txt'), 'rb').read().decode('utf-8') case_table5.append( @@ -290,7 +294,7 @@ # Round trip tests def _rt_check_case(name, expected, format): - mat_stream = StringIO() + mat_stream = BytesIO() savemat_future(mat_stream, expected, format=format) mat_stream.seek(0) _load_check_case(name, [mat_stream], expected) @@ -341,7 +345,8 @@ shutil.rmtree(tmpdir) assert_array_almost_equal(actual['x'].todense(), - expected['x'].todense()) + expected['x'].todense(), + err_msg=repr(actual)) def test_mat73(): @@ -370,7 +375,7 @@ def test_regression_653(): """Regression test for #653.""" - assert_raises(TypeError, savemat_future, StringIO(), {'d':{1:2}}, format='5') + assert_raises(TypeError, savemat_future, BytesIO(), {'d':{1:2}}, format='5') def test_structname_len(): @@ -378,18 +383,18 @@ lim = 31 fldname = 'a' * lim st1 = np.zeros((1,1), dtype=[(fldname, object)]) - mat_stream = StringIO() - savemat_future(StringIO(), {'longstruct': st1}, format='5') + mat_stream = BytesIO() + savemat_future(BytesIO(), {'longstruct': st1}, format='5') fldname = 'a' * (lim+1) st1 = np.zeros((1,1), dtype=[(fldname, object)]) - assert_raises(ValueError, savemat_future, StringIO(), + assert_raises(ValueError, savemat_future, BytesIO(), {'longstruct': st1}, format='5') def test_4_and_long_field_names_incompatible(): # Long field names option not supported in 4 my_struct = np.zeros((1,1),dtype=[('my_fieldname',object)]) - assert_raises(ValueError, savemat_future, StringIO(), + assert_raises(ValueError, savemat_future, BytesIO(), {'my_struct':my_struct}, format='4', long_field_names=True) @@ -398,11 +403,11 @@ lim = 63 fldname = 'a' * lim st1 = np.zeros((1,1), dtype=[(fldname, object)]) - mat_stream = StringIO() - savemat_future(StringIO(), {'longstruct': st1}, format='5',long_field_names=True) + mat_stream = BytesIO() + savemat_future(BytesIO(), {'longstruct': st1}, format='5',long_field_names=True) fldname = 'a' * (lim+1) st1 = np.zeros((1,1), dtype=[(fldname, object)]) - assert_raises(ValueError, savemat_future, StringIO(), + assert_raises(ValueError, savemat_future, BytesIO(), {'longstruct': st1}, format='5',long_field_names=True) @@ -415,12 +420,12 @@ st1 = np.zeros((1,1), dtype=[(fldname, object)]) cell[0,0]=st1 cell[0,1]=st1 - mat_stream = StringIO() - savemat_future(StringIO(), {'longstruct': cell}, format='5',long_field_names=True) + mat_stream = BytesIO() + savemat_future(BytesIO(), {'longstruct': cell}, format='5',long_field_names=True) # # Check to make sure it fails with long field names off # - assert_raises(ValueError, savemat_future, StringIO(), + assert_raises(ValueError, savemat_future, BytesIO(), {'longstruct': cell}, format='5', long_field_names=False) @@ -431,18 +436,18 @@ cells = np.ndarray((1,2),dtype=object) cells[0,0]='Hello' cells[0,1]='World' - mat_stream = StringIO() - savemat_future(StringIO(), {'x': cells}, format='5') + mat_stream = BytesIO() + savemat_future(BytesIO(), {'x': cells}, format='5') cells = np.ndarray((1,1),dtype=object) cells[0,0]='Hello, world' - mat_stream = StringIO() - savemat_future(StringIO(), {'x': cells}, format='5') + mat_stream = BytesIO() + savemat_future(BytesIO(), {'x': cells}, format='5') def test_writer_properties(): # Tests getting, setting of properties of matrix writer - mfw = MatFile5Writer(StringIO(), oned_as='row') + mfw = MatFile5Writer(BytesIO(), oned_as='row') yield assert_equal, mfw.global_vars, [] mfw.global_vars = ['avar'] yield assert_equal, mfw.global_vars, ['avar'] @@ -456,26 +461,28 @@ def test_use_small_element(): # Test whether we're using small data element or not - sio = StringIO() + sio = BytesIO() wtr = MatFile5Writer(sio, oned_as='column') # First check size for no sde for name arr = np.zeros(10) wtr.put_variables({'aaaaa': arr}) - w_sz = sio.len + w_sz = len(sio.getvalue()) # Check small name results in largish difference in size sio.truncate(0) + sio.seek(0) wtr.put_variables({'aaaa': arr}) - yield assert_true, w_sz - sio.len > 4 + yield assert_true, w_sz - len(sio.getvalue()) > 4 # Whereas increasing name size makes less difference sio.truncate(0) + sio.seek(0) wtr.put_variables({'aaaaaa': arr}) - yield assert_true, sio.len - w_sz < 4 + yield assert_true, len(sio.getvalue()) - w_sz < 4 def test_save_dict(): # Test that dict can be saved (as recarray), loaded as matstruct d = {'a':1, 'b':2} - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'dict':d}) stream.seek(0) vals = loadmat(stream) @@ -484,44 +491,44 @@ def test_1d_shape(): # Current 5 behavior is 1D -> column vector arr = np.arange(5) - stream = StringIO() + stream = BytesIO() # silence warnings for tests warnings.simplefilter('ignore') savemat(stream, {'oned':arr}, format='5') vals = loadmat(stream) - yield assert_equal, vals['oned'].shape, (5,1) + assert_equal(vals['oned'].shape, (5,1)) # Current 4 behavior is 1D -> row vector - stream = StringIO() + stream = BytesIO() savemat(stream, {'oned':arr}, format='4') vals = loadmat(stream) - yield assert_equal, vals['oned'].shape, (1, 5) + assert_equal(vals['oned'].shape, (1, 5)) for format in ('4', '5'): # can be explicitly 'column' for oned_as - stream = StringIO() + stream = BytesIO() savemat(stream, {'oned':arr}, format=format, oned_as='column') vals = loadmat(stream) - yield assert_equal, vals['oned'].shape, (5,1) + assert_equal(vals['oned'].shape, (5,1)) # but different from 'row' - stream = StringIO() + stream = BytesIO() savemat(stream, {'oned':arr}, format=format, oned_as='row') vals = loadmat(stream) - yield assert_equal, vals['oned'].shape, (1,5) + assert_equal(vals['oned'].shape, (1,5)) warnings.resetwarnings() def test_compression(): arr = np.zeros(100).reshape((5,20)) arr[2,10] = 1 - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'arr':arr}) raw_len = len(stream.getvalue()) vals = loadmat(stream) yield assert_array_equal, vals['arr'], arr - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'arr':arr}, do_compression=True) compressed_len = len(stream.getvalue()) vals = loadmat(stream) @@ -530,18 +537,18 @@ # Concatenate, test later arr2 = arr.copy() arr2[0,0] = 1 - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'arr':arr, 'arr2':arr2}, do_compression=False) vals = loadmat(stream) yield assert_array_equal, vals['arr2'], arr2 - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'arr':arr, 'arr2':arr2}, do_compression=True) vals = loadmat(stream) yield assert_array_equal, vals['arr2'], arr2 def test_single_object(): - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'A':np.array(1, dtype=object)}) @@ -581,16 +588,16 @@ # type d = loadmat(filename, struct_as_record=True) a = d['a'] - yield assert_equal, a.shape, (1,1) - yield assert_equal, a.dtype, np.dtype(np.object) - yield assert_true, a[0,0] is None - stream = StringIO() + assert_equal(a.shape, (1,1)) + assert_equal(a.dtype, np.dtype(np.object)) + assert_true(a[0,0] is None) + stream = BytesIO() arr = np.array((), dtype='U') # before ticket fix, this used to give data type not understood savemat_future(stream, {'arr':arr}) d = loadmat(stream) a2 = d['arr'] - yield assert_array_equal, a2, arr + assert_array_equal(a2, arr) def test_recarray(): @@ -602,7 +609,7 @@ arr[0]['f2'] = 'python' arr[1]['f1'] = 99 arr[1]['f2'] = 'not perl' - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'arr': arr}) d = loadmat(stream, struct_as_record=False) a20 = d['arr'][0,0] @@ -625,7 +632,7 @@ c = C() c.field1 = 1 c.field2 = 'a string' - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'c': c}) d = loadmat(stream, struct_as_record=False) c2 = d['c'][0,0] @@ -641,91 +648,93 @@ # tests if read is seeing option sets, at initialization and after # initialization arr = np.arange(6).reshape(1,6) - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'a': arr}) rdr = MatFile5Reader_future(stream) back_dict = rdr.get_variables() rarr = back_dict['a'] - yield assert_array_equal, rarr, arr + assert_array_equal(rarr, arr) rdr = MatFile5Reader_future(stream, squeeze_me=True) - yield assert_array_equal, rdr.get_variables()['a'], arr.reshape((6,)) + assert_array_equal(rdr.get_variables()['a'], arr.reshape((6,))) rdr.squeeze_me = False - yield assert_array_equal, rarr, arr + assert_array_equal(rarr, arr) rdr = MatFile5Reader_future(stream, byte_order=boc.native_code) - yield assert_array_equal, rdr.get_variables()['a'], arr + assert_array_equal(rdr.get_variables()['a'], arr) # inverted byte code leads to error on read because of swapped # header etc rdr = MatFile5Reader_future(stream, byte_order=boc.swapped_code) - yield assert_raises, Exception, rdr.get_variables + assert_raises(Exception, rdr.get_variables) rdr.byte_order = boc.native_code - yield assert_array_equal, rdr.get_variables()['a'], arr + assert_array_equal(rdr.get_variables()['a'], arr) arr = np.array(['a string']) stream.truncate(0) + stream.seek(0) savemat_future(stream, {'a': arr}) rdr = MatFile5Reader_future(stream) - yield assert_array_equal, rdr.get_variables()['a'], arr + assert_array_equal(rdr.get_variables()['a'], arr) rdr = MatFile5Reader_future(stream, chars_as_strings=False) carr = np.atleast_2d(np.array(list(arr.item()), dtype='U1')) - yield assert_array_equal, rdr.get_variables()['a'], carr + assert_array_equal(rdr.get_variables()['a'], carr) rdr.chars_as_strings=True - yield assert_array_equal, rdr.get_variables()['a'], arr + assert_array_equal(rdr.get_variables()['a'], arr) def test_empty_string(): # make sure reading empty string does not raise error estring_fname = pjoin(test_data_path, 'single_empty_string.mat') - rdr = MatFile5Reader_future(file(estring_fname, 'rb')) + rdr = MatFile5Reader_future(open(estring_fname, 'rb')) d = rdr.get_variables() - yield assert_array_equal, d['a'], np.array([], dtype='U1') + assert_array_equal(d['a'], np.array([], dtype='U1')) # empty string round trip. Matlab cannot distiguish # between a string array that is empty, and a string array # containing a single empty string, because it stores strings as # arrays of char. There is no way of having an array of char that # is not empty, but contains an empty string. - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'a': np.array([''])}) rdr = MatFile5Reader_future(stream) d = rdr.get_variables() - yield assert_array_equal, d['a'], np.array([], dtype='U1') + assert_array_equal(d['a'], np.array([], dtype='U1')) stream.truncate(0) + stream.seek(0) savemat_future(stream, {'a': np.array([], dtype='U1')}) rdr = MatFile5Reader_future(stream) d = rdr.get_variables() - yield assert_array_equal, d['a'], np.array([], dtype='U1') + assert_array_equal(d['a'], np.array([], dtype='U1')) def test_mat4_3d(): # test behavior when writing 3D arrays to matlab 4 files - stream = StringIO() + stream = BytesIO() arr = np.arange(24).reshape((2,3,4)) warnings.simplefilter('error') - yield (assert_raises, DeprecationWarning, savemat_future, - stream, {'a': arr}, True, '4') + assert_raises(DeprecationWarning, savemat_future, + stream, {'a': arr}, True, '4') warnings.resetwarnings() # For now, we save a 3D array as 2D warnings.simplefilter('ignore') savemat_future(stream, {'a': arr}, format='4') warnings.resetwarnings() d = loadmat(stream) - yield assert_array_equal, d['a'], arr.reshape((6,4)) + assert_array_equal(d['a'], arr.reshape((6,4))) def test_func_read(): func_eg = pjoin(test_data_path, 'testfunc_7.4_GLNX86.mat') - rdr = MatFile5Reader_future(file(func_eg, 'rb')) + rdr = MatFile5Reader_future(open(func_eg, 'rb')) d = rdr.get_variables() yield assert_true, isinstance(d['testfunc'], MatlabFunction) - stream = StringIO() + stream = BytesIO() wtr = MatFile5Writer(stream, oned_as='row') yield assert_raises, MatWriteError, wtr.put_variables, d def test_mat_dtype(): double_eg = pjoin(test_data_path, 'testmatrix_6.1_SOL2.mat') - rdr = MatFile5Reader_future(file(double_eg, 'rb'), mat_dtype=False) + rdr = MatFile5Reader_future(open(double_eg, 'rb'), mat_dtype=False) d = rdr.get_variables() yield assert_equal, d['testmatrix'].dtype.kind, 'u' - rdr = MatFile5Reader_future(file(double_eg, 'rb'), mat_dtype=True) + rdr = MatFile5Reader_future(open(double_eg, 'rb'), mat_dtype=True) d = rdr.get_variables() yield assert_equal, d['testmatrix'].dtype.kind, 'f' @@ -734,14 +743,14 @@ # reproduces bug found by DC where Cython code was insisting on # ndarray return type, but getting sparse matrix st = {'sparsefield': SP.coo_matrix(np.eye(4))} - stream = StringIO() + stream = BytesIO() savemat_future(stream, {'a':st}) d = loadmat(stream, struct_as_record=True) yield assert_array_equal, d['a'][0,0]['sparsefield'].todense(), np.eye(4) def test_mat_struct_squeeze(): - stream = StringIO() + stream = BytesIO() in_d = {'st':{'one':1, 'two':2}} savemat_future(stream, in_d) # no error without squeeze @@ -755,14 +764,15 @@ def test_str_round(): # from report by Angus McMorland on mailing list 3 May 2010 - stream = StringIO() + stream = BytesIO() in_arr = np.array(['Hello', 'Foob']) out_arr = np.array(['Hello', 'Foob ']) savemat_future(stream, dict(a=in_arr)) res = loadmat(stream) # resulted in [u'HloolFoa', u'elWrdobr'] - yield assert_array_equal, res['a'], out_arr + assert_array_equal(res['a'], out_arr) stream.truncate(0) + stream.seek(0) # Make Fortran ordered version of string in_str = in_arr.tostring(order='F') in_from_str = np.ndarray(shape=a.shape, @@ -770,14 +780,15 @@ order='F', buffer=in_str) savemat_future(stream, dict(a=in_from_str)) - yield assert_array_equal, res['a'], out_arr + assert_array_equal(res['a'], out_arr) # unicode save did lead to buffer too small error stream.truncate(0) + stream.seek(0) in_arr_u = in_arr.astype('U') out_arr_u = out_arr.astype('U') savemat_future(stream, {'a': in_arr_u}) res = loadmat(stream) - yield assert_array_equal, res['a'], out_arr_u + assert_array_equal(res['a'], out_arr_u) if __name__ == "__main__": run_module_suite() Modified: trunk/scipy/io/matlab/tests/test_mio5_utils.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-09-12 01:02:00 UTC (rev 6766) +++ trunk/scipy/io/matlab/tests/test_mio5_utils.py 2010-09-12 01:02:17 UTC (rev 6767) @@ -1,9 +1,15 @@ """ Testing """ -import cStringIO -import StringIO +import sys +if sys.version_info[0] >= 3: + from io import BytesIO + cStringIO = BytesIO +else: + from cStringIO import StringIO as cStringIO + from StringIO import StringIO as BytesIO + import numpy as np from nose.tools import assert_true, assert_false, \ @@ -67,6 +73,7 @@ def _write_stream(stream, *strings): stream.truncate(0) + stream.seek(0) for s in strings: stream.write(s) stream.seek(0) @@ -91,7 +98,7 @@ def test_read_tag(): # mainly to test errors # make reader-like thing - str_io = StringIO.StringIO() + str_io = BytesIO() r = _make_readerlike() r.mat_stream = str_io c_reader = m5u.VarReader5(r) @@ -107,7 +114,7 @@ def test_read_stream(): tag = _make_tag('i4', 1, mio5.miINT32, sde=True) tag_str = tag.tostring() - str_io = cStringIO.StringIO(tag_str) + str_io = cStringIO(tag_str) st = streams.make_stream(str_io) s = streams._read_into(st, tag.itemsize) yield assert_equal, s, tag.tostring() @@ -115,7 +122,7 @@ def test_read_numeric(): # make reader-like thing - str_io = cStringIO.StringIO() + str_io = cStringIO() r = _make_readerlike() r.mat_stream = str_io # check simplest of tags @@ -146,7 +153,7 @@ def test_read_numeric_writeable(): # make reader-like thing - str_io = cStringIO.StringIO() + str_io = cStringIO() r = _make_readerlike() r.mat_stream = str_io r.byte_order = '<' Modified: trunk/scipy/io/matlab/tests/test_mio_funcs.py =================================================================== --- trunk/scipy/io/matlab/tests/test_mio_funcs.py 2010-09-12 01:02:00 UTC (rev 6766) +++ trunk/scipy/io/matlab/tests/test_mio_funcs.py 2010-09-12 01:02:17 UTC (rev 6767) @@ -4,8 +4,13 @@ ''' from os.path import join as pjoin, dirname -from cStringIO import StringIO +import sys +if sys.version_info[0] >= 3: + from io import BytesIO +else: + from cStringIO import StringIO as BytesIO + from numpy.testing import \ assert_array_equal, \ assert_array_almost_equal, \ @@ -15,6 +20,7 @@ from nose.tools import assert_true import numpy as np +from numpy.compat import asbytes, asstr from scipy.io.matlab.mio5 import MatlabObject, MatFile5Writer, \ MatFile5Reader, MatlabFunction @@ -27,7 +33,7 @@ i = 0 while not rdr.end_of_stream(): hdr, next_position = rdr.read_var_header() - name = hdr.name + name = asstr(hdr.name) if name == '': name = 'var_%d' % i i += 1 @@ -39,16 +45,16 @@ return mdict def read_workspace_vars(fname): - rdr = MatFile5Reader(file(fname, 'rb'), - struct_as_record=True) + rdr = MatFile5Reader(open(fname, 'rb'), + struct_as_record=True) vars = rdr.get_variables() fws = vars['__function_workspace__'] - ws_bs = StringIO(fws.tostring()) + ws_bs = BytesIO(fws.tostring()) ws_bs.seek(2) rdr.mat_stream = ws_bs # Guess byte order. mi = rdr.mat_stream.read(2) - rdr.byte_order = mi == 'IM' and '<' or '>' + rdr.byte_order = mi == asbytes('IM') and '<' or '>' rdr.mat_stream.read(4) # presumably byte padding return read_minimat_vars(rdr) From scipy-svn at scipy.org Sat Sep 11 21:02:36 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:02:36 -0500 (CDT) Subject: [Scipy-svn] r6768 - trunk/scipy/io/matlab Message-ID: <20100912010236.126B439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:02:35 -0500 (Sat, 11 Sep 2010) New Revision: 6768 Modified: trunk/scipy/io/matlab/mio.py trunk/scipy/io/matlab/mio4.py trunk/scipy/io/matlab/mio5.py trunk/scipy/io/matlab/mio5_utils.pyx trunk/scipy/io/matlab/miobase.py Log: 3K: io/matlab: port matlab modules to Py3 (mainly str vs. bytes issues) Modified: trunk/scipy/io/matlab/mio.py =================================================================== --- trunk/scipy/io/matlab/mio.py 2010-09-12 01:02:17 UTC (rev 6767) +++ trunk/scipy/io/matlab/mio.py 2010-09-12 01:02:35 UTC (rev 6768) @@ -8,6 +8,8 @@ import sys import warnings +from numpy.compat import asbytes + from miobase import get_matfile_version, docfiller from mio4 import MatFile4Reader, MatFile4Writer from mio5 import MatFile5Reader, MatFile5Writer @@ -178,7 +180,7 @@ file_stream = open(file_name, 'wb') else: try: - file_name.write('') + file_name.write(asbytes('')) except AttributeError: raise IOError, 'Writer needs file name or writeable '\ 'file-like object' Modified: trunk/scipy/io/matlab/mio4.py =================================================================== --- trunk/scipy/io/matlab/mio4.py 2010-09-12 01:02:17 UTC (rev 6767) +++ trunk/scipy/io/matlab/mio4.py 2010-09-12 01:02:35 UTC (rev 6768) @@ -4,6 +4,7 @@ import warnings import numpy as np +from numpy.compat import asbytes, asstr import scipy.sparse @@ -96,7 +97,7 @@ def read_header(self): ''' Reads and return header for variable ''' data = read_dtype(self.mat_stream, self.dtypes['header']) - name = self.mat_stream.read(int(data['namlen'])).strip('\x00') + name = self.mat_stream.read(int(data['namlen'])).strip(asbytes('\x00')) if data['mopt'] < 0 or data['mopt'] > 5000: ValueError, 'Mat 4 mopt wrong format, byteswapping problem?' M,rest = divmod(data['mopt'], 1000) @@ -149,7 +150,7 @@ num_bytes *= d arr = np.ndarray(shape=dims, dtype=dt, - buffer=self.mat_stream.read(num_bytes), + buffer=self.mat_stream.read(int(num_bytes)), order='F') if copy: arr = arr.copy() @@ -295,7 +296,7 @@ mdict = {} while not self.end_of_stream(): hdr, next_position = self.read_var_header() - name = hdr.name + name = asstr(hdr.name) if variable_names and name not in variable_names: self.mat_stream.seek(next_position) continue @@ -376,7 +377,7 @@ header['imagf'] = imagf header['namlen'] = len(name) + 1 self.write_bytes(header) - self.write_string(name + '\0') + self.write_string(asbytes(name + '\0')) def write(self, arr, name): ''' Write matrix `arr`, with name `name` Modified: trunk/scipy/io/matlab/mio5.py =================================================================== --- trunk/scipy/io/matlab/mio5.py 2010-09-12 01:02:17 UTC (rev 6767) +++ trunk/scipy/io/matlab/mio5.py 2010-09-12 01:02:35 UTC (rev 6768) @@ -75,10 +75,14 @@ import time import sys import zlib -from cStringIO import StringIO +if sys.version_info[0] >= 3: + from io import BytesIO +else: + from cStringIO import StringIO as BytesIO import warnings import numpy as np +from numpy.compat import asbytes, asstr import scipy.sparse @@ -291,13 +295,13 @@ self.mat_stream.seek(126) mi = self.mat_stream.read(2) self.mat_stream.seek(0) - return mi == 'IM' and '<' or '>' + return mi == asbytes('IM') and '<' or '>' def read_file_header(self): ''' Read in mat 5 file header ''' hdict = {} hdr = read_dtype(self.mat_stream, self.dtypes['file_header']) - hdict['__header__'] = hdr['description'].item().strip(' \t\n\000') + hdict['__header__'] = hdr['description'].item().strip(asbytes(' \t\n\000')) v_major = hdr['version'] >> 8 v_minor = hdr['version'] & 0xFF hdict['__version__'] = '%d.%d' % (v_major, v_minor) @@ -353,9 +357,9 @@ # incomplete stream. See discussion at # http://bugs.python.org/issue8672 dcor = zlib.decompressobj() - stream = StringIO(dcor.decompress(data)) + stream = BytesIO(dcor.decompress(data)) # Check the stream is not so broken as to leave cruft behind - assert dcor.flush() == '' + assert dcor.flush() == asbytes('') del data self._matrix_reader.set_stream(stream) mdtype, byte_count = self._matrix_reader.read_full_tag() @@ -402,7 +406,7 @@ mdict['__globals__'] = [] while not self.end_of_stream(): hdr, next_position = self.read_var_header() - name = hdr.name + name = asstr(hdr.name) if name == '': # can only be a matlab 7 function workspace name = '__function_workspace__' @@ -569,7 +573,7 @@ # pad to next 64-bit boundary bc_mod_8 = byte_count % 8 if bc_mod_8: - self.file_stream.write('\x00' * (8-bc_mod_8)) + self.file_stream.write(asbytes('\x00') * (8-bc_mod_8)) def write_header(self, shape, @@ -876,13 +880,13 @@ continue is_global = name in self.global_vars if self.do_compression: - stream = StringIO() + stream = BytesIO() self._matrix_writer.file_stream = stream - self._matrix_writer.write_top(var, name, is_global) + self._matrix_writer.write_top(var, asbytes(name), is_global) out_str = zlib.compress(stream.getvalue()) tag = np.empty((), mdtypes_template['tag_full']) tag['mdtype'] = miCOMPRESSED tag['byte_count'] = len(out_str) self.file_stream.write(tag.tostring() + out_str) else: # not compressing - self._matrix_writer.write_top(var, name, is_global) + self._matrix_writer.write_top(var, asbytes(name), is_global) Modified: trunk/scipy/io/matlab/mio5_utils.pyx =================================================================== --- trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:02:17 UTC (rev 6767) +++ trunk/scipy/io/matlab/mio5_utils.pyx 2010-09-12 01:02:35 UTC (rev 6768) @@ -27,6 +27,7 @@ PyBytes_FromStringAndSize import numpy as np +from numpy.compat import asbytes, asstr cimport numpy as cnp cdef extern from "numpy/arrayobject.h": @@ -641,7 +642,7 @@ elif mc == mxSTRUCT_CLASS: arr = self.read_struct(header) elif mc == mxOBJECT_CLASS: # like structs, but with classname - classname = self.read_int8_string() + classname = asstr(self.read_int8_string()) arr = self.read_struct(header) arr = mio5p.MatlabObject(arr, classname) elif mc == mxFUNCTION_CLASS: # just a matrix of struct type @@ -757,7 +758,7 @@ % mdtype) uc_str = data.decode(codec) # cast to array to deal with 2, 4 byte width characters - arr = np.array(uc_str) + arr = np.array(uc_str, dtype='U') dt = self.U1_dtype # could take this to numpy C-API level, but probably not worth # it @@ -802,7 +803,7 @@ cdef char *n_ptr = names for i in range(n_names): name = PyBytes_FromString(n_ptr) - field_names.append(name) + field_names.append(asstr(name)) n_ptr += namelength n_names_ptr[0] = n_names return field_names Modified: trunk/scipy/io/matlab/miobase.py =================================================================== --- trunk/scipy/io/matlab/miobase.py 2010-09-12 01:02:17 UTC (rev 6767) +++ trunk/scipy/io/matlab/miobase.py 2010-09-12 01:02:35 UTC (rev 6768) @@ -3,8 +3,15 @@ """ Base classes for matlab (TM) file stream reading """ +import sys import numpy as np +from numpy.compat import asbytes +if sys.version_info[0] >= 3: + byteord = int +else: + byteord = ord + from scipy.misc import doccer import byteordercodes as boc @@ -201,9 +208,9 @@ fileobj.seek(124) tst_str = fileobj.read(4) fileobj.seek(0) - maj_ind = int(tst_str[2] == 'I') - maj_val = ord(tst_str[maj_ind]) - min_val = ord(tst_str[1-maj_ind]) + maj_ind = int(tst_str[2] == asbytes('I')[0]) + maj_val = byteord(tst_str[maj_ind]) + min_val = byteord(tst_str[1-maj_ind]) ret = (maj_val, min_val) if maj_val in (1, 2): return ret From scipy-svn at scipy.org Sat Sep 11 21:02:58 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:02:58 -0500 (CDT) Subject: [Scipy-svn] r6769 - trunk/scipy/io/matlab Message-ID: <20100912010258.B7A9139CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:02:58 -0500 (Sat, 11 Sep 2010) New Revision: 6769 Modified: trunk/scipy/io/matlab/mio5_utils.c trunk/scipy/io/matlab/mio_utils.c trunk/scipy/io/matlab/streams.c Log: GEN: io: regenerate matlab/*.c Modified: trunk/scipy/io/matlab/mio5_utils.c =================================================================== --- trunk/scipy/io/matlab/mio5_utils.c 2010-09-12 01:02:35 UTC (rev 6768) +++ trunk/scipy/io/matlab/mio5_utils.c 2010-09-12 01:02:58 UTC (rev 6769) @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Wed May 26 12:20:26 2010 */ +/* Generated by Cython 0.13 on Sat Sep 11 22:32:56 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,13 +103,37 @@ #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif +#ifndef PySet_CheckExact +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -103,32 +148,25 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif + + +#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -146,113 +184,65 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include #define __PYX_HAVE_API__scipy__io__matlab__mio5_utils #include "stdio.h" +#include "pythread.h" #include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" #include "numpy_rephrasing.h" +/* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif +/* unused attribute */ +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || defined(__INTEL_COMPILER) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -262,7 +252,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -282,7 +272,6 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -308,6 +297,13 @@ #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "mio5_utils.pyx", + "numpy.pxd", + "bool.pxd", + "streams.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -376,7 +372,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/streams.pxd":6 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":6 * cdef object fobj * * cpdef int seek(self, long int offset, int whence=*) except -1 # <<<<<<<<<<<<<< @@ -389,7 +385,7 @@ int whence; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/streams.pxd":9 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":9 * cpdef long int tell(self) except -1 * cdef int read_into(self, void *buf, size_t n) except -1 * cdef object read_string(self, size_t n, void **pp, int copy=*) # <<<<<<<<<<<<<< @@ -402,7 +398,7 @@ int copy; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":64 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":65 * * * cdef enum: # <<<<<<<<<<<<<< @@ -428,7 +424,7 @@ __pyx_e_5scipy_2io_6matlab_10mio5_utils_miUTF32 = 18 }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":81 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":82 * miUTF32 = 18 * * cdef enum: # see comments in mio5_params # <<<<<<<<<<<<<< @@ -457,7 +453,7 @@ __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOBJECT_CLASS_FROM_MATRIX_H = 18 }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":288 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":289 * return 1 * * cdef object read_element(self, # <<<<<<<<<<<<<< @@ -470,8 +466,8 @@ int copy; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":383 - * self.cstream.seek(8 - mod8, 1) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":385 + * return 0 * * cpdef inline cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<< * ''' Read numeric data element into ndarray @@ -483,7 +479,7 @@ int copy; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":561 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":564 * return size * * cdef read_mi_matrix(self, int process=1): # <<<<<<<<<<<<<< @@ -496,7 +492,7 @@ int process; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":593 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":596 * return self.array_from_header(header, process) * * cpdef array_from_header(self, VarHeader5 header, int process=1): # <<<<<<<<<<<<<< @@ -509,7 +505,7 @@ int process; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/streams.pxd":3 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":3 * # -*- python -*- or rather like * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -523,7 +519,7 @@ PyObject *fobj; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":115 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":116 * * * cdef class VarHeader5: # <<<<<<<<<<<<<< @@ -544,7 +540,7 @@ size_t nzmax; }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":127 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":128 * * * cdef class VarReader5: # <<<<<<<<<<<<<< @@ -572,7 +568,7 @@ }; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/streams.pxd":3 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":3 * # -*- python -*- or rather like * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -589,7 +585,7 @@ static struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":127 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":128 * * * cdef class VarReader5: # <<<<<<<<<<<<<< @@ -600,11 +596,11 @@ struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 { int (*cread_tag)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, char *); PyObject *(*read_element)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void **, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args); - void (*read_element_into)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void *); + int (*read_element_into)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void *); PyArrayObject *(*read_numeric)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric *__pyx_optional_args); PyObject *(*read_int8_string)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *); int (*read_into_int32s)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_int32_t *); - void (*cread_full_tag)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *); + int (*cread_full_tag)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *); struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *(*read_header)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch); size_t (*size_from_header)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *); PyObject *(*read_mi_matrix)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix *__pyx_optional_args); @@ -665,6 +661,8 @@ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -675,13 +673,17 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ +static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ + +static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (PyList_Append(L, x) < 0) return NULL; @@ -698,7 +700,10 @@ } } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; @@ -708,11 +713,11 @@ } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -725,14 +730,14 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -745,15 +750,15 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -767,7 +772,7 @@ r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } @@ -799,8 +804,8 @@ } __Pyx_BufFmt_StackElem; +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/ @@ -816,9 +821,6 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -832,8 +834,6 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ @@ -939,6 +939,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -953,8 +955,6 @@ static CYTHON_INLINE npy_uint32 __Pyx_PyInt_from_py_npy_uint32(PyObject *); -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ @@ -968,76 +968,81 @@ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_version */ +/* Module declarations from cpython.version */ -/* Module declarations from python_ref */ +/* Module declarations from cpython.ref */ -/* Module declarations from python_exc */ +/* Module declarations from cpython.exc */ -/* Module declarations from python_module */ +/* Module declarations from cpython.module */ -/* Module declarations from python_mem */ +/* Module declarations from cpython.mem */ -/* Module declarations from python_tuple */ +/* Module declarations from cpython.tuple */ -/* Module declarations from python_list */ +/* Module declarations from cpython.list */ -/* Module declarations from stdio */ +/* Module declarations from libc.stdio */ -/* Module declarations from python_object */ +/* Module declarations from cpython.object */ -/* Module declarations from python_sequence */ +/* Module declarations from cpython.sequence */ -/* Module declarations from python_mapping */ +/* Module declarations from cpython.mapping */ -/* Module declarations from python_iterator */ +/* Module declarations from cpython.iterator */ -/* Module declarations from python_type */ +/* Module declarations from cpython.type */ -/* Module declarations from python_number */ +/* Module declarations from cpython.number */ -/* Module declarations from python_int */ +/* Module declarations from cpython.int */ -/* Module declarations from python_bool */ +/* Module declarations from __builtin__ */ -/* Module declarations from python_unicode */ +/* Module declarations from cpython.bool */ -/* Module declarations from python_long */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; +/* Module declarations from cpython.long */ -/* Module declarations from python_float */ +/* Module declarations from cpython.float */ -/* Module declarations from python_complex */ +/* Module declarations from cpython.complex */ -/* Module declarations from python_string */ +/* Module declarations from cpython.string */ -/* Module declarations from python_dict */ +/* Module declarations from cpython.unicode */ -/* Module declarations from python_instance */ +/* Module declarations from cpython.dict */ -/* Module declarations from python_function */ +/* Module declarations from cpython.instance */ -/* Module declarations from python_method */ +/* Module declarations from cpython.function */ -/* Module declarations from python_weakref */ +/* Module declarations from cpython.method */ -/* Module declarations from python_getargs */ +/* Module declarations from cpython.weakref */ -/* Module declarations from python_cobject */ +/* Module declarations from cpython.getargs */ -/* Module declarations from python_oldbuffer */ +/* Module declarations from cpython.pythread */ -/* Module declarations from python_set */ +/* Module declarations from cpython.cobject */ -/* Module declarations from python_buffer */ +/* Module declarations from cpython.oldbuffer */ -/* Module declarations from python_bytes */ +/* Module declarations from cpython.set */ -/* Module declarations from python_pycapsule */ +/* Module declarations from cpython.buffer */ -/* Module declarations from python */ +/* Module declarations from cpython.bytes */ -/* Module declarations from stdlib */ +/* Module declarations from cpython.pycapsule */ +/* Module declarations from cpython */ + +/* Module declarations from libc.stdlib */ + /* Module declarations from numpy */ /* Module declarations from numpy */ @@ -1070,7 +1075,6 @@ int __pyx_module_is_main_scipy__io__matlab__mio5_utils = 0; /* Implementation of scipy.io.matlab.mio5_utils */ -static PyObject *__pyx_builtin_basestring; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; @@ -1093,25 +1097,26 @@ static char __pyx_k_15[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_16[] = "Format string allocated too short."; static char __pyx_k_17[] = " Cython mio5 utility routines (-*- python -*- like)\n\n"; -static char __pyx_k_18[] = "scipy.io.matlab.miobase"; -static char __pyx_k_19[] = "*"; -static char __pyx_k_20[] = "scipy.io.matlab.mio_utils"; -static char __pyx_k_21[] = "scipy.io.matlab.mio5_params"; -static char __pyx_k_22[] = "scipy.sparse"; -static char __pyx_k_23[] = "<"; -static char __pyx_k_24[] = ">"; -static char __pyx_k_25[] = "VarReader5.set_stream (line 185)"; -static char __pyx_k_26[] = "VarReader5.read_tag (line 192)"; -static char __pyx_k_27[] = "VarReader5.read_numeric (line 383)"; -static char __pyx_k_28[] = "VarReader5.read_full_tag (line 459)"; -static char __pyx_k_29[] = "VarReader5.read_header (line 492)"; -static char __pyx_k_30[] = "VarReader5.array_from_header (line 593)"; -static char __pyx_k_31[] = "VarReader5.read_real_complex (line 659)"; -static char __pyx_k_32[] = "VarReader5.read_char (line 706)"; -static char __pyx_k_33[] = "VarReader5.read_cells (line 767)"; -static char __pyx_k_34[] = "VarReader5.read_fieldnames (line 780)"; -static char __pyx_k_35[] = "VarReader5.read_struct (line 808)"; -static char __pyx_k_36[] = "VarReader5.read_opaque (line 848)"; +static char __pyx_k_18[] = "numpy.compat"; +static char __pyx_k_19[] = "scipy.io.matlab.miobase"; +static char __pyx_k_20[] = "*"; +static char __pyx_k_21[] = "scipy.io.matlab.mio_utils"; +static char __pyx_k_22[] = "scipy.io.matlab.mio5_params"; +static char __pyx_k_23[] = "scipy.sparse"; +static char __pyx_k_24[] = "<"; +static char __pyx_k_25[] = ">"; +static char __pyx_k_26[] = "VarReader5.set_stream (line 186)"; +static char __pyx_k_27[] = "VarReader5.read_tag (line 193)"; +static char __pyx_k_28[] = "VarReader5.read_numeric (line 385)"; +static char __pyx_k_29[] = "VarReader5.read_full_tag (line 461)"; +static char __pyx_k_30[] = "VarReader5.read_header (line 495)"; +static char __pyx_k_31[] = "VarReader5.array_from_header (line 596)"; +static char __pyx_k_32[] = "VarReader5.read_real_complex (line 662)"; +static char __pyx_k_33[] = "VarReader5.read_char (line 709)"; +static char __pyx_k_34[] = "VarReader5.read_cells (line 770)"; +static char __pyx_k_35[] = "VarReader5.read_fieldnames (line 783)"; +static char __pyx_k_36[] = "VarReader5.read_struct (line 811)"; +static char __pyx_k_37[] = "VarReader5.read_opaque (line 851)"; static char __pyx_k__B[] = "B"; static char __pyx_k__F[] = "F"; static char __pyx_k__H[] = "H"; @@ -1120,6 +1125,7 @@ static char __pyx_k__O[] = "O"; static char __pyx_k__Q[] = "Q"; static char __pyx_k__T[] = "T"; +static char __pyx_k__U[] = "U"; static char __pyx_k__b[] = "b"; static char __pyx_k__d[] = "d"; static char __pyx_k__f[] = "f"; @@ -1149,6 +1155,7 @@ static char __pyx_k__seek[] = "seek"; static char __pyx_k__array[] = "array"; static char __pyx_k__ascii[] = "ascii"; +static char __pyx_k__asstr[] = "asstr"; static char __pyx_k__descr[] = "descr"; static char __pyx_k__dtype[] = "dtype"; static char __pyx_k__empty[] = "empty"; @@ -1176,6 +1183,7 @@ static char __pyx_k__object[] = "object"; static char __pyx_k__pycopy[] = "pycopy"; static char __pyx_k__sparse[] = "sparse"; +static char __pyx_k__asbytes[] = "asbytes"; static char __pyx_k__cstream[] = "cstream"; static char __pyx_k__ndarray[] = "ndarray"; static char __pyx_k__preader[] = "preader"; @@ -1202,7 +1210,6 @@ static char __pyx_k__sys_is_le[] = "sys_is_le"; static char __pyx_k__ValueError[] = "ValueError"; static char __pyx_k__VarReader5[] = "VarReader5"; -static char __pyx_k__basestring[] = "basestring"; static char __pyx_k__bool_dtype[] = "bool_dtype"; static char __pyx_k__byte_order[] = "byte_order"; static char __pyx_k__csc_matrix[] = "csc_matrix"; @@ -1263,9 +1270,9 @@ static PyObject *__pyx_n_s_20; static PyObject *__pyx_n_s_21; static PyObject *__pyx_n_s_22; -static PyObject *__pyx_kp_s_23; +static PyObject *__pyx_n_s_23; static PyObject *__pyx_kp_s_24; -static PyObject *__pyx_kp_u_25; +static PyObject *__pyx_kp_s_25; static PyObject *__pyx_kp_u_26; static PyObject *__pyx_kp_u_27; static PyObject *__pyx_kp_u_28; @@ -1278,6 +1285,7 @@ static PyObject *__pyx_kp_u_34; static PyObject *__pyx_kp_u_35; static PyObject *__pyx_kp_u_36; +static PyObject *__pyx_kp_u_37; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_kp_s_5; static PyObject *__pyx_kp_s_6; @@ -1292,6 +1300,7 @@ static PyObject *__pyx_n_s__RuntimeError; static PyObject *__pyx_n_s__T; static PyObject *__pyx_n_s__TypeError; +static PyObject *__pyx_n_s__U; static PyObject *__pyx_n_s__U1_dtype; static PyObject *__pyx_n_s__ValueError; static PyObject *__pyx_n_s__VarReader5; @@ -1302,10 +1311,11 @@ static PyObject *__pyx_n_s__arr; static PyObject *__pyx_n_s__array; static PyObject *__pyx_n_s__array_from_header; +static PyObject *__pyx_n_s__asbytes; static PyObject *__pyx_n_s__ascii; +static PyObject *__pyx_n_s__asstr; static PyObject *__pyx_n_s__astype; static PyObject *__pyx_n_s__base; -static PyObject *__pyx_n_s__basestring; static PyObject *__pyx_n_s__bool; static PyObject *__pyx_n_s__bool_dtype; static PyObject *__pyx_n_s__buf; @@ -1408,7 +1418,7 @@ static PyObject *__pyx_int_neg_1; static PyObject *__pyx_int_15; -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":108 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":109 * * * cpdef cnp.uint32_t byteswap_u4(cnp.uint32_t u4): # <<<<<<<<<<<<<< @@ -1421,7 +1431,7 @@ __pyx_t_5numpy_uint32_t __pyx_r; __Pyx_RefNannySetupContext("byteswap_u4"); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":112 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":113 * ((u4 << 8) & 0xff0000U) | * ((u4 >> 8 & 0xff00u)) | * (u4 >> 24)) # <<<<<<<<<<<<<< @@ -1437,7 +1447,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":108 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":109 * * * cpdef cnp.uint32_t byteswap_u4(cnp.uint32_t u4): # <<<<<<<<<<<<<< @@ -1453,15 +1463,16 @@ __Pyx_RefNannySetupContext("byteswap_u4"); __pyx_self = __pyx_self; assert(__pyx_arg_u4); { - __pyx_v_u4 = __Pyx_PyInt_from_py_npy_uint32(__pyx_arg_u4); if (unlikely((__pyx_v_u4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_u4 = __Pyx_PyInt_from_py_npy_uint32(__pyx_arg_u4); if (unlikely((__pyx_v_u4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.byteswap_u4"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_v_u4, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_v_u4, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -1479,7 +1490,229 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":148 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":117 + * + * cdef class VarHeader5: + * cdef readonly object name # <<<<<<<<<<<<<< + * cdef readonly int mclass + * cdef readonly object dims + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->name); + __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->name; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":118 + * cdef class VarHeader5: + * cdef readonly object name + * cdef readonly int mclass # <<<<<<<<<<<<<< + * cdef readonly object dims + * cdef cnp.int32_t dims_ptr[_MAT_MAXDIMS] + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->mclass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.mclass.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":119 + * cdef readonly object name + * cdef readonly int mclass + * cdef readonly object dims # <<<<<<<<<<<<<< + * cdef cnp.int32_t dims_ptr[_MAT_MAXDIMS] + * cdef int n_dims + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims); + __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->dims; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":124 + * cdef int is_complex + * cdef int is_logical + * cdef public int is_global # <<<<<<<<<<<<<< + * cdef size_t nzmax + * + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->is_global); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.is_global.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self)->is_global = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.is_global.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":129 + * + * cdef class VarReader5: + * cdef public int is_swapped, little_endian # <<<<<<<<<<<<<< + * cdef int struct_as_record + * cdef object codecs, uint16_codec + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.is_swapped.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.is_swapped.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.little_endian.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.little_endian.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":149 * int chars_as_strings * * def __new__(self, preader): # <<<<<<<<<<<<<< @@ -1520,7 +1753,7 @@ else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_preader = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { @@ -1530,98 +1763,96 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__new__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.__cinit__"); + __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF(__pyx_v_preader); __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dt = Py_None; __Pyx_INCREF(Py_None); __pyx_v_bool_dtype = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":149 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":150 * * def __new__(self, preader): * self.is_swapped = preader.byte_order == swapped_code # <<<<<<<<<<<<<< * if self.is_swapped: * self.little_endian = not sys_is_le */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__byte_order); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__byte_order); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__swapped_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__swapped_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":150 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":151 * def __new__(self, preader): * self.is_swapped = preader.byte_order == swapped_code * if self.is_swapped: # <<<<<<<<<<<<<< * self.little_endian = not sys_is_le * else: */ - __pyx_t_4 = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped; - if (__pyx_t_4) { + if (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":151 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":152 * self.is_swapped = preader.byte_order == swapped_code * if self.is_swapped: * self.little_endian = not sys_is_le # <<<<<<<<<<<<<< * else: * self.little_endian = sys_is_le */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = (!__pyx_t_5); goto __pyx_L6; } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":153 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":154 * self.little_endian = not sys_is_le * else: * self.little_endian = sys_is_le # <<<<<<<<<<<<<< * # option affecting reading of matlab struct arrays * self.struct_as_record = preader.struct_as_record */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian = __pyx_t_4; } __pyx_L6:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":155 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":156 * self.little_endian = sys_is_le * # option affecting reading of matlab struct arrays * self.struct_as_record = preader.struct_as_record # <<<<<<<<<<<<<< * # store codecs for text matrix reading * self.codecs = preader.codecs */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__struct_as_record); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__struct_as_record); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->struct_as_record = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":157 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":158 * self.struct_as_record = preader.struct_as_record * # store codecs for text matrix reading * self.codecs = preader.codecs # <<<<<<<<<<<<<< * self.uint16_codec = preader.uint16_codec * # set c-optimized stream object from python file-like object */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__codecs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__codecs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs); @@ -1629,14 +1860,14 @@ ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->codecs = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":158 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":159 * # store codecs for text matrix reading * self.codecs = preader.codecs * self.uint16_codec = preader.uint16_codec # <<<<<<<<<<<<<< * # set c-optimized stream object from python file-like object * self.set_stream(preader.mat_stream) */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__uint16_codec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__uint16_codec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec); @@ -1644,73 +1875,73 @@ ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->uint16_codec = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":160 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":161 * self.uint16_codec = preader.uint16_codec * # set c-optimized stream object from python file-like object * self.set_stream(preader.mat_stream) # <<<<<<<<<<<<<< * # options for element processing * self.mat_dtype = preader.mat_dtype */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":162 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":163 * self.set_stream(preader.mat_stream) * # options for element processing * self.mat_dtype = preader.mat_dtype # <<<<<<<<<<<<<< * self.chars_as_strings = preader.chars_as_strings * self.squeeze_me = preader.squeeze_me */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->mat_dtype = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":163 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":164 * # options for element processing * self.mat_dtype = preader.mat_dtype * self.chars_as_strings = preader.chars_as_strings # <<<<<<<<<<<<<< * self.squeeze_me = preader.squeeze_me * # copy refs to dtypes into object pointer array. Store preader */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__chars_as_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__chars_as_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->chars_as_strings = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":164 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":165 * self.mat_dtype = preader.mat_dtype * self.chars_as_strings = preader.chars_as_strings * self.squeeze_me = preader.squeeze_me # <<<<<<<<<<<<<< * # copy refs to dtypes into object pointer array. Store preader * # to keep preader.dtypes, class_dtypes alive. We only need the */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__squeeze_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__squeeze_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->squeeze_me = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":168 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":169 * # to keep preader.dtypes, class_dtypes alive. We only need the * # integer-keyed dtypes * self.preader = preader # <<<<<<<<<<<<<< * for key, dt in preader.dtypes.items(): - * if isinstance(key, basestring): + * if isinstance(key, str): */ __Pyx_INCREF(__pyx_v_preader); __Pyx_GIVEREF(__pyx_v_preader); @@ -1718,25 +1949,25 @@ __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->preader); ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->preader = __pyx_v_preader; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":169 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":170 * # integer-keyed dtypes * self.preader = preader * for key, dt in preader.dtypes.items(): # <<<<<<<<<<<<<< - * if isinstance(key, basestring): + * if isinstance(key, str): * continue */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__dtypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__dtypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_6 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1750,7 +1981,7 @@ } else { __pyx_t_2 = PyIter_Next(__pyx_t_1); if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); @@ -1767,14 +1998,14 @@ __pyx_v_dt = __pyx_t_7; __pyx_t_7 = 0; } else { - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_EndUnpack(__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_key); __pyx_v_key = __pyx_t_3; @@ -1784,19 +2015,19 @@ __pyx_t_7 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":170 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":171 * self.preader = preader * for key, dt in preader.dtypes.items(): - * if isinstance(key, basestring): # <<<<<<<<<<<<<< + * if isinstance(key, str): # <<<<<<<<<<<<<< * continue * self.dtypes[key] = dt */ - __pyx_t_5 = PyObject_IsInstance(__pyx_v_key, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyString_Check(__pyx_v_key); if (__pyx_t_5) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":171 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":172 * for key, dt in preader.dtypes.items(): - * if isinstance(key, basestring): + * if isinstance(key, str): * continue # <<<<<<<<<<<<<< * self.dtypes[key] = dt * # copy refs to class_dtypes into object pointer array @@ -1806,38 +2037,38 @@ } __pyx_L9:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":172 - * if isinstance(key, basestring): + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":173 + * if isinstance(key, str): * continue * self.dtypes[key] = dt # <<<<<<<<<<<<<< * # copy refs to class_dtypes into object pointer array * for key, dt in preader.class_dtypes.items(): */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->dtypes[__pyx_t_9]) = ((PyObject *)__pyx_v_dt); __pyx_L7_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":174 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":175 * self.dtypes[key] = dt * # copy refs to class_dtypes into object pointer array * for key, dt in preader.class_dtypes.items(): # <<<<<<<<<<<<<< - * if isinstance(key, basestring): + * if isinstance(key, str): * continue */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__class_dtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__class_dtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -1851,7 +2082,7 @@ } else { __pyx_t_1 = PyIter_Next(__pyx_t_2); if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_1); @@ -1868,14 +2099,14 @@ __pyx_v_dt = __pyx_t_3; __pyx_t_3 = 0; } else { - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_EndUnpack(__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_key); __pyx_v_key = __pyx_t_7; @@ -1885,19 +2116,19 @@ __pyx_t_3 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":175 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":176 * # copy refs to class_dtypes into object pointer array * for key, dt in preader.class_dtypes.items(): - * if isinstance(key, basestring): # <<<<<<<<<<<<<< + * if isinstance(key, str): # <<<<<<<<<<<<<< * continue * self.class_dtypes[key] = dt */ - __pyx_t_5 = PyObject_IsInstance(__pyx_v_key, __pyx_builtin_basestring); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyString_Check(__pyx_v_key); if (__pyx_t_5) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":176 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":177 * for key, dt in preader.class_dtypes.items(): - * if isinstance(key, basestring): + * if isinstance(key, str): * continue # <<<<<<<<<<<<<< * self.class_dtypes[key] = dt * # cache correctly byte ordered dtypes @@ -1907,51 +2138,50 @@ } __pyx_L12:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":177 - * if isinstance(key, basestring): + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":178 + * if isinstance(key, str): * continue * self.class_dtypes[key] = dt # <<<<<<<<<<<<<< * # cache correctly byte ordered dtypes * if self.little_endian: */ - __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->class_dtypes[__pyx_t_9]) = ((PyObject *)__pyx_v_dt); __pyx_L10_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":179 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":180 * self.class_dtypes[key] = dt * # cache correctly byte ordered dtypes * if self.little_endian: # <<<<<<<<<<<<<< * self.U1_dtype = np.dtype('little_endian; - if (__pyx_t_4) { + if (((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->little_endian) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":180 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":181 * # cache correctly byte ordered dtypes * if self.little_endian: * self.U1_dtype = np.dtype('U1') */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype)); @@ -1961,28 +2191,28 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":182 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":183 * self.U1_dtype = np.dtype('U1') # <<<<<<<<<<<<<< * bool_dtype = np.dtype('bool') * */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->U1_dtype)); @@ -1991,24 +2221,24 @@ } __pyx_L13:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":183 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":184 * else: * self.U1_dtype = np.dtype('>U1') * bool_dtype = np.dtype('bool') # <<<<<<<<<<<<<< * * def set_stream(self, fobj): */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__bool)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__bool)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bool)); - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2030,13 +2260,11 @@ __Pyx_DECREF(__pyx_v_key); __Pyx_DECREF(__pyx_v_dt); __Pyx_DECREF(__pyx_v_bool_dtype); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF(__pyx_v_preader); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":185 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":186 * bool_dtype = np.dtype('bool') * * def set_stream(self, fobj): # <<<<<<<<<<<<<< @@ -2051,14 +2279,14 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("set_stream"); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":190 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":191 * Called from Python when initiating a variable read * ''' * self.cstream = streams.make_stream(fobj) # <<<<<<<<<<<<<< * * def read_tag(self): */ - __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->cstream); @@ -2078,7 +2306,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":192 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":193 * self.cstream = streams.make_stream(fobj) * * def read_tag(self): # <<<<<<<<<<<<<< @@ -2086,9 +2314,9 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag[] = " Read tag mdtype and byte_count\n\n Does necessary swapping and takes account of SDE formats.\n\n See also ``read_full_tag`` method.\n \n Returns\n -------\n mdtype : int\n matlab data type code\n byte_count : int\n number of bytes following that comprise the data\n tag_data : None or str\n Any data from the tag itself. This is None for a full tag,\n and string length `byte_count` if this is a small data\n element.\n "; -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { __pyx_t_5numpy_uint32_t __pyx_v_mdtype; __pyx_t_5numpy_uint32_t __pyx_v_byte_count; char __pyx_v_tag_ptr[4]; @@ -2101,9 +2329,8 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("read_tag"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":213 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":214 * cdef char tag_ptr[4] * cdef int tag_res * cdef object tag_data = None # <<<<<<<<<<<<<< @@ -2113,17 +2340,17 @@ __Pyx_INCREF(Py_None); __pyx_v_tag_data = Py_None; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":214 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":215 * cdef int tag_res * cdef object tag_data = None * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) # <<<<<<<<<<<<<< * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count), __pyx_v_tag_ptr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count), __pyx_v_tag_ptr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tag_res = __pyx_t_1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":215 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":216 * cdef object tag_data = None * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) * if tag_res == 2: # sde format # <<<<<<<<<<<<<< @@ -2133,14 +2360,14 @@ __pyx_t_2 = (__pyx_v_tag_res == 2); if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":216 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":217 * tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] # <<<<<<<<<<<<<< * return (mdtype, byte_count, tag_data) * */ - __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_tag_ptr + 0, __pyx_v_byte_count - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_tag_ptr + 0, __pyx_v_byte_count - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_v_tag_data); __pyx_v_tag_data = ((PyObject *)__pyx_t_3); @@ -2149,7 +2376,7 @@ } __pyx_L5:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":217 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":218 * if tag_res == 2: # sde format * tag_data = tag_ptr[:byte_count] * return (mdtype, byte_count, tag_data) # <<<<<<<<<<<<<< @@ -2157,11 +2384,11 @@ * cdef int cread_tag(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -2186,13 +2413,12 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tag_data); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":219 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":220 * return (mdtype, byte_count, tag_data) * * cdef int cread_tag(self, # <<<<<<<<<<<<<< @@ -2208,14 +2434,12 @@ __pyx_t_5numpy_uint32_t __pyx_v_u4s[2]; int __pyx_r; int __pyx_t_1; - __pyx_t_5numpy_uint16_t __pyx_t_2; - int __pyx_t_3; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("cread_tag"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":234 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":235 * cdef cnp.uint16_t mdtype_sde, byte_count_sde * cdef cnp.uint32_t mdtype * cdef cnp.uint32_t* u4_ptr = data_ptr # <<<<<<<<<<<<<< @@ -2224,26 +2448,25 @@ */ __pyx_v_u4_ptr = ((__pyx_t_5numpy_uint32_t *)__pyx_v_data_ptr); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":262 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":263 * # first four bytes are two little-endian uint16 values, first * # ``mdtype`` and second ``byte_count``. * self.cstream.read_into(u4s, 8) # <<<<<<<<<<<<<< * if self.is_swapped: * mdtype = byteswap_u4(u4s[0]) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":263 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":264 * # ``mdtype`` and second ``byte_count``. * self.cstream.read_into(u4s, 8) * if self.is_swapped: # <<<<<<<<<<<<<< * mdtype = byteswap_u4(u4s[0]) * else: */ - __pyx_t_1 = __pyx_v_self->is_swapped; - if (__pyx_t_1) { + if (__pyx_v_self->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":264 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":265 * self.cstream.read_into(u4s, 8) * if self.is_swapped: * mdtype = byteswap_u4(u4s[0]) # <<<<<<<<<<<<<< @@ -2255,7 +2478,7 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":266 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":267 * mdtype = byteswap_u4(u4s[0]) * else: * mdtype = u4s[0] # <<<<<<<<<<<<<< @@ -2266,7 +2489,7 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":269 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":270 * # The most significant two bytes of a U4 *mdtype* will always be * # 0, if they are not, this must be SDE format * byte_count_sde = mdtype >> 16 # <<<<<<<<<<<<<< @@ -2275,17 +2498,16 @@ */ __pyx_v_byte_count_sde = (__pyx_v_mdtype >> 16); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":270 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":271 * # 0, if they are not, this must be SDE format * byte_count_sde = mdtype >> 16 * if byte_count_sde: # small data element format # <<<<<<<<<<<<<< * mdtype_sde = mdtype & 0xffff * if byte_count_sde > 4: */ - __pyx_t_2 = __pyx_v_byte_count_sde; - if (__pyx_t_2) { + if (__pyx_v_byte_count_sde) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":271 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":272 * byte_count_sde = mdtype >> 16 * if byte_count_sde: # small data element format * mdtype_sde = mdtype & 0xffff # <<<<<<<<<<<<<< @@ -2294,36 +2516,36 @@ */ __pyx_v_mdtype_sde = (__pyx_v_mdtype & 0xffff); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":272 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":273 * if byte_count_sde: # small data element format * mdtype_sde = mdtype & 0xffff * if byte_count_sde > 4: # <<<<<<<<<<<<<< * raise ValueError('Error in SDE format data') * return -1 */ - __pyx_t_3 = (__pyx_v_byte_count_sde > 4); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_byte_count_sde > 4); + if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":273 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":274 * mdtype_sde = mdtype & 0xffff * if byte_count_sde > 4: * raise ValueError('Error in SDE format data') # <<<<<<<<<<<<<< * return -1 * u4_ptr[0] = u4s[1] */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_3)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":274 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":275 * if byte_count_sde > 4: * raise ValueError('Error in SDE format data') * return -1 # <<<<<<<<<<<<<< @@ -2336,7 +2558,7 @@ } __pyx_L5:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":275 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":276 * raise ValueError('Error in SDE format data') * return -1 * u4_ptr[0] = u4s[1] # <<<<<<<<<<<<<< @@ -2345,7 +2567,7 @@ */ (__pyx_v_u4_ptr[0]) = (__pyx_v_u4s[1]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":276 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":277 * return -1 * u4_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype_sde # <<<<<<<<<<<<<< @@ -2354,7 +2576,7 @@ */ (__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype_sde; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":277 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":278 * u4_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype_sde * byte_count_ptr[0] = byte_count_sde # <<<<<<<<<<<<<< @@ -2363,7 +2585,7 @@ */ (__pyx_v_byte_count_ptr[0]) = __pyx_v_byte_count_sde; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":278 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":279 * mdtype_ptr[0] = mdtype_sde * byte_count_ptr[0] = byte_count_sde * return 2 # <<<<<<<<<<<<<< @@ -2376,17 +2598,16 @@ } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":280 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":281 * return 2 * # regular element * if self.is_swapped: # <<<<<<<<<<<<<< * byte_count_ptr[0] = byteswap_u4(u4s[1]) * else: */ - __pyx_t_1 = __pyx_v_self->is_swapped; - if (__pyx_t_1) { + if (__pyx_v_self->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":281 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":282 * # regular element * if self.is_swapped: * byte_count_ptr[0] = byteswap_u4(u4s[1]) # <<<<<<<<<<<<<< @@ -2398,7 +2619,7 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":283 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":284 * byte_count_ptr[0] = byteswap_u4(u4s[1]) * else: * byte_count_ptr[0] = u4s[1] # <<<<<<<<<<<<<< @@ -2409,7 +2630,7 @@ } __pyx_L6:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":284 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":285 * else: * byte_count_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype # <<<<<<<<<<<<<< @@ -2418,7 +2639,7 @@ */ (__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":285 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":286 * byte_count_ptr[0] = u4s[1] * mdtype_ptr[0] = mdtype * u4_ptr[0] = 0 # <<<<<<<<<<<<<< @@ -2427,7 +2648,7 @@ */ (__pyx_v_u4_ptr[0]) = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":286 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":287 * mdtype_ptr[0] = mdtype * u4_ptr[0] = 0 * return 1 # <<<<<<<<<<<<<< @@ -2440,17 +2661,16 @@ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.cread_tag"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":288 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":289 * return 1 * * cdef object read_element(self, # <<<<<<<<<<<<<< @@ -2460,7 +2680,7 @@ static PyObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void **__pyx_v_pp, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":292 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":293 * cnp.uint32_t *byte_count_ptr, * void **pp, * int copy=True): # <<<<<<<<<<<<<< @@ -2487,20 +2707,19 @@ __pyx_v_copy = __pyx_optional_args->copy; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":328 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":329 * cdef int tag_res = self.cread_tag(mdtype_ptr, * byte_count_ptr, * tag_data) # <<<<<<<<<<<<<< * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, __pyx_v_tag_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, __pyx_v_tag_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tag_res = __pyx_t_1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":329 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":330 * byte_count_ptr, * tag_data) * mdtype = mdtype_ptr[0] # <<<<<<<<<<<<<< @@ -2509,7 +2728,7 @@ */ __pyx_v_mdtype = (__pyx_v_mdtype_ptr[0]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":330 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":331 * tag_data) * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<< @@ -2518,7 +2737,7 @@ */ __pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":331 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":332 * mdtype = mdtype_ptr[0] * byte_count = byte_count_ptr[0] * if tag_res == 1: # full format # <<<<<<<<<<<<<< @@ -2528,7 +2747,7 @@ __pyx_t_2 = (__pyx_v_tag_res == 1); if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":335 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":336 * byte_count, * pp, * copy) # <<<<<<<<<<<<<< @@ -2537,41 +2756,40 @@ */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.copy = __pyx_v_copy; - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_string(__pyx_v_self->cstream, __pyx_v_byte_count, __pyx_v_pp, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_string(__pyx_v_self->cstream, __pyx_v_byte_count, __pyx_v_pp, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":337 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":338 * copy) * # Seek to next 64-bit boundary * mod8 = byte_count % 8 # <<<<<<<<<<<<<< * if mod8: * self.cstream.seek(8 - mod8, 1) */ - __pyx_v_mod8 = (__pyx_v_byte_count % 8); + __pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":338 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":339 * # Seek to next 64-bit boundary * mod8 = byte_count % 8 * if mod8: # <<<<<<<<<<<<<< * self.cstream.seek(8 - mod8, 1) * else: # SDE format, make safer home for data */ - __pyx_t_1 = __pyx_v_mod8; - if (__pyx_t_1) { + if (__pyx_v_mod8) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":339 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":340 * mod8 = byte_count % 8 * if mod8: * self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<< * else: # SDE format, make safer home for data - * data = PyString_FromStringAndSize(tag_data, byte_count) + * data = PyBytes_FromStringAndSize(tag_data, byte_count) */ __pyx_t_5.__pyx_n = 1; __pyx_t_5.whence = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -2579,37 +2797,37 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":341 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":342 * self.cstream.seek(8 - mod8, 1) * else: # SDE format, make safer home for data - * data = PyString_FromStringAndSize(tag_data, byte_count) # <<<<<<<<<<<<<< + * data = PyBytes_FromStringAndSize(tag_data, byte_count) # <<<<<<<<<<<<<< * pp[0] = data * return data */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_tag_data, __pyx_v_byte_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_tag_data, __pyx_v_byte_count)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":342 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":343 * else: # SDE format, make safer home for data - * data = PyString_FromStringAndSize(tag_data, byte_count) + * data = PyBytes_FromStringAndSize(tag_data, byte_count) * pp[0] = data # <<<<<<<<<<<<<< * return data * */ - __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_pp[0]) = ((char *)__pyx_t_6); + __pyx_t_6 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + (__pyx_v_pp[0]) = __pyx_t_6; } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":343 - * data = PyString_FromStringAndSize(tag_data, byte_count) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":344 + * data = PyBytes_FromStringAndSize(tag_data, byte_count) * pp[0] = data * return data # <<<<<<<<<<<<<< * - * cdef void read_element_into(self, + * cdef int read_element_into(self, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); @@ -2624,41 +2842,40 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_data); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":345 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":346 * return data * - * cdef void read_element_into(self, # <<<<<<<<<<<<<< - * cnp.uint32_t *mdtype_ptr, - * cnp.uint32_t *byte_count_ptr, + * cdef int read_element_into(self, # <<<<<<<<<<<<<< + * cnp.uint32_t *mdtype_ptr, + * cnp.uint32_t *byte_count_ptr, */ -static void __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element_into(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void *__pyx_v_ptr) { +static int __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element_into(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void *__pyx_v_ptr) { int __pyx_v_mod8; int __pyx_v_res; __pyx_t_5numpy_uint32_t __pyx_v_byte_count; + int __pyx_r; int __pyx_t_1; int __pyx_t_2; struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek __pyx_t_3; __Pyx_RefNannySetupContext("read_element_into"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":374 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":375 * mdtype_ptr, * byte_count_ptr, * ptr) # <<<<<<<<<<<<<< * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, ((char *)__pyx_v_ptr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, ((char *)__pyx_v_ptr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = __pyx_t_1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":375 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":376 * byte_count_ptr, * ptr) * cdef cnp.uint32_t byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<< @@ -2667,7 +2884,7 @@ */ __pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":376 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":377 * ptr) * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format # <<<<<<<<<<<<<< @@ -2677,45 +2894,44 @@ __pyx_t_2 = (__pyx_v_res == 1); if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":377 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":378 * cdef cnp.uint32_t byte_count = byte_count_ptr[0] * if res == 1: # full format * res = self.cstream.read_into(ptr, byte_count) # <<<<<<<<<<<<<< * # Seek to next 64-bit boundary * mod8 = byte_count % 8 */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, __pyx_v_ptr, __pyx_v_byte_count); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, __pyx_v_ptr, __pyx_v_byte_count); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = __pyx_t_1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":379 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":380 * res = self.cstream.read_into(ptr, byte_count) * # Seek to next 64-bit boundary * mod8 = byte_count % 8 # <<<<<<<<<<<<<< * if mod8: * self.cstream.seek(8 - mod8, 1) */ - __pyx_v_mod8 = (__pyx_v_byte_count % 8); + __pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":380 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":381 * # Seek to next 64-bit boundary * mod8 = byte_count % 8 * if mod8: # <<<<<<<<<<<<<< * self.cstream.seek(8 - mod8, 1) - * + * return 0 */ - __pyx_t_1 = __pyx_v_mod8; - if (__pyx_t_1) { + if (__pyx_v_mod8) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":381 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":382 * mod8 = byte_count % 8 * if mod8: * self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<< + * return 0 * - * cpdef inline cnp.ndarray read_numeric(self, int copy=True): */ __pyx_t_3.__pyx_n = 1; __pyx_t_3.whence = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; @@ -2723,16 +2939,28 @@ } __pyx_L3:; + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":383 + * if mod8: + * self.cstream.seek(8 - mod8, 1) + * return 0 # <<<<<<<<<<<<<< + * + * cpdef inline cnp.ndarray read_numeric(self, int copy=True): + */ + __pyx_r = 0; goto __pyx_L0; + + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("scipy.io.matlab.mio5_utils.VarReader5.read_element_into"); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_element_into"); + __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":383 - * self.cstream.seek(8 - mod8, 1) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":385 + * return 0 * * cpdef inline cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<< * ''' Read numeric data element into ndarray @@ -2756,34 +2984,32 @@ PyObject *__pyx_t_3 = NULL; struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element __pyx_t_4; PyObject *__pyx_t_5; - int __pyx_t_6; __Pyx_RefNannySetupContext("read_numeric"); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_copy = __pyx_optional_args->copy; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_el = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyInt_FromLong(__pyx_v_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2792,7 +3018,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":396 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":398 * cdef cnp.ndarray el * cdef object data = self.read_element( * &mdtype, &byte_count, &data_ptr, copy) # <<<<<<<<<<<<<< @@ -2801,12 +3027,12 @@ */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.copy = __pyx_v_copy; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":397 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":399 * cdef object data = self.read_element( * &mdtype, &byte_count, &data_ptr, copy) * cdef cnp.dtype dt = self.dtypes[mdtype] # <<<<<<<<<<<<<< @@ -2817,7 +3043,7 @@ __Pyx_INCREF(((PyObject *)((PyArray_Descr *)__pyx_t_5))); __pyx_v_dt = ((PyArray_Descr *)__pyx_t_5); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":398 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":400 * &mdtype, &byte_count, &data_ptr, copy) * cdef cnp.dtype dt = self.dtypes[mdtype] * el_count = byte_count // dt.itemsize # <<<<<<<<<<<<<< @@ -2826,11 +3052,11 @@ */ if (unlikely(__pyx_v_dt->elsize == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_el_count = (__pyx_v_byte_count / __pyx_v_dt->elsize); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":399 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":401 * cdef cnp.dtype dt = self.dtypes[mdtype] * el_count = byte_count // dt.itemsize * cdef int flags = 0 # <<<<<<<<<<<<<< @@ -2839,17 +3065,16 @@ */ __pyx_v_flags = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":400 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":402 * el_count = byte_count // dt.itemsize * cdef int flags = 0 * if copy: # <<<<<<<<<<<<<< * flags = cnp.NPY_WRITEABLE * Py_INCREF( dt) */ - __pyx_t_6 = __pyx_v_copy; - if (__pyx_t_6) { + if (__pyx_v_copy) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":401 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":403 * cdef int flags = 0 * if copy: * flags = cnp.NPY_WRITEABLE # <<<<<<<<<<<<<< @@ -2861,7 +3086,7 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":402 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":404 * if copy: * flags = cnp.NPY_WRITEABLE * Py_INCREF( dt) # <<<<<<<<<<<<<< @@ -2870,20 +3095,20 @@ */ Py_INCREF(((PyObject *)__pyx_v_dt)); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":410 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":412 * data_ptr, * flags, * NULL) # <<<<<<<<<<<<<< * Py_INCREF( data) * PyArray_Set_BASE(el, data) */ - __pyx_t_1 = ((PyObject *)PyArray_NewFromDescr((&PyArray_Type), __pyx_v_dt, 1, (&__pyx_v_el_count), NULL, ((void *)__pyx_v_data_ptr), __pyx_v_flags, ((PyObject *)NULL))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyArray_NewFromDescr((&PyArray_Type), __pyx_v_dt, 1, (&__pyx_v_el_count), NULL, ((void *)__pyx_v_data_ptr), __pyx_v_flags, ((PyObject *)NULL))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_el)); __pyx_v_el = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":411 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":413 * flags, * NULL) * Py_INCREF( data) # <<<<<<<<<<<<<< @@ -2892,7 +3117,7 @@ */ Py_INCREF(__pyx_v_data); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":412 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":414 * NULL) * Py_INCREF( data) * PyArray_Set_BASE(el, data) # <<<<<<<<<<<<<< @@ -2901,7 +3126,7 @@ */ PyArray_Set_BASE(__pyx_v_el, __pyx_v_data); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":413 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":415 * Py_INCREF( data) * PyArray_Set_BASE(el, data) * return el # <<<<<<<<<<<<<< @@ -2925,14 +3150,13 @@ __Pyx_DECREF((PyObject *)__pyx_v_el); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF((PyObject *)__pyx_v_dt); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":383 - * self.cstream.seek(8 - mod8, 1) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":385 + * return 0 * * cpdef inline cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<< * ''' Read numeric data element into ndarray @@ -2958,38 +3182,39 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - if (kw_args > 1) { + if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__copy); - if (unlikely(value)) { values[0] = value; kw_args--; } + if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_numeric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_numeric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } if (values[0]) { - __pyx_v_copy = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_copy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_copy = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_copy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_copy = ((int)1); } } else { __pyx_v_copy = ((int)1); switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_copy = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_copy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + case 1: __pyx_v_copy = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_copy == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 0: break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_numeric", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("read_numeric", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_numeric"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.copy = __pyx_v_copy; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_numeric(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_numeric(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3007,7 +3232,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":415 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":417 * return el * * cdef inline object read_int8_string(self): # <<<<<<<<<<<<<< @@ -3025,23 +3250,22 @@ int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_int8_string"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":427 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":429 * void *ptr * object data * data = self.read_element(&mdtype, &byte_count, &ptr) # <<<<<<<<<<<<<< * if mdtype != miINT8: * raise TypeError('Expecting miINT8 as data type') */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), (&__pyx_v_ptr), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), (&__pyx_v_ptr), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":428 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":430 * object data * data = self.read_element(&mdtype, &byte_count, &ptr) * if mdtype != miINT8: # <<<<<<<<<<<<<< @@ -3051,29 +3275,29 @@ __pyx_t_2 = (__pyx_v_mdtype != __pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT8); if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":429 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":431 * data = self.read_element(&mdtype, &byte_count, &ptr) * if mdtype != miINT8: * raise TypeError('Expecting miINT8 as data type') # <<<<<<<<<<<<<< * return data * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_4)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":430 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":432 * if mdtype != miINT8: * raise TypeError('Expecting miINT8 as data type') * return data # <<<<<<<<<<<<<< @@ -3094,13 +3318,12 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_data); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":432 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":434 * return data * * cdef int read_into_int32s(self, cnp.int32_t *int32p) except -1: # <<<<<<<<<<<<<< @@ -3115,52 +3338,51 @@ int __pyx_v_n_ints; int __pyx_r; int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; int __pyx_t_5; __Pyx_RefNannySetupContext("read_into_int32s"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":449 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":451 * cnp.uint32_t mdtype, byte_count * int i * self.read_element_into(&mdtype, &byte_count, int32p) # <<<<<<<<<<<<<< * if mdtype != miINT32: * raise TypeError('Expecting miINT32 as data type') */ - ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element_into(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void *)__pyx_v_int32p)); + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element_into(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void *)__pyx_v_int32p)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":450 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":452 * int i * self.read_element_into(&mdtype, &byte_count, int32p) * if mdtype != miINT32: # <<<<<<<<<<<<<< * raise TypeError('Expecting miINT32 as data type') * return -1 */ - __pyx_t_1 = (__pyx_v_mdtype != __pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT32); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_mdtype != __pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT32); + if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":451 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":453 * self.read_element_into(&mdtype, &byte_count, int32p) * if mdtype != miINT32: * raise TypeError('Expecting miINT32 as data type') # <<<<<<<<<<<<<< * return -1 * cdef int n_ints = byte_count // 4 */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); + __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":452 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":454 * if mdtype != miINT32: * raise TypeError('Expecting miINT32 as data type') * return -1 # <<<<<<<<<<<<<< @@ -3173,37 +3395,36 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":453 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":455 * raise TypeError('Expecting miINT32 as data type') * return -1 * cdef int n_ints = byte_count // 4 # <<<<<<<<<<<<<< * if self.is_swapped: * for i in range(n_ints): */ - __pyx_v_n_ints = (__pyx_v_byte_count / 4); + __pyx_v_n_ints = __Pyx_div_long(__pyx_v_byte_count, 4); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":454 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":456 * return -1 * cdef int n_ints = byte_count // 4 * if self.is_swapped: # <<<<<<<<<<<<<< * for i in range(n_ints): * int32p[i] = byteswap_u4(int32p[i]) */ - __pyx_t_4 = __pyx_v_self->is_swapped; - if (__pyx_t_4) { + if (__pyx_v_self->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":455 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":457 * cdef int n_ints = byte_count // 4 * if self.is_swapped: * for i in range(n_ints): # <<<<<<<<<<<<<< * int32p[i] = byteswap_u4(int32p[i]) * return n_ints */ - __pyx_t_4 = __pyx_v_n_ints; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { + __pyx_t_1 = __pyx_v_n_ints; + for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":456 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":458 * if self.is_swapped: * for i in range(n_ints): * int32p[i] = byteswap_u4(int32p[i]) # <<<<<<<<<<<<<< @@ -3216,7 +3437,7 @@ } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":457 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":459 * for i in range(n_ints): * int32p[i] = byteswap_u4(int32p[i]) * return n_ints # <<<<<<<<<<<<<< @@ -3229,17 +3450,16 @@ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_into_int32s"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":459 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":461 * return n_ints * * def read_full_tag(self): # <<<<<<<<<<<<<< @@ -3247,56 +3467,57 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_full_tag(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_full_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_full_tag[] = " Python method for reading full u4, u4 tag from stream\n\n Returns\n -------\n mdtype : int32\n matlab data type code\n byte_count : int32\n number of data bytes following\n\n Notes\n -----\n Assumes tag is in fact full, that is, is not a small data\n element. This means it can skip some checks and makes it\n slightly faster than ``read_tag``\n "; -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_full_tag(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_full_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { __pyx_t_5numpy_uint32_t __pyx_v_mdtype; __pyx_t_5numpy_uint32_t __pyx_v_byte_count; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("read_full_tag"); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":476 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":478 * ''' * cdef cnp.uint32_t mdtype, byte_count * self.cread_full_tag(&mdtype, &byte_count) # <<<<<<<<<<<<<< * return mdtype, byte_count * */ - ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_full_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count)); + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_full_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_mdtype), (&__pyx_v_byte_count)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":477 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":479 * cdef cnp.uint32_t mdtype, byte_count * self.cread_full_tag(&mdtype, &byte_count) * return mdtype, byte_count # <<<<<<<<<<<<<< * - * cdef void cread_full_tag(self, + * cdef int cread_full_tag(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_full_tag"); __pyx_r = NULL; __pyx_L0:; @@ -3305,40 +3526,39 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":479 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":481 * return mdtype, byte_count * - * cdef void cread_full_tag(self, # <<<<<<<<<<<<<< - * cnp.uint32_t* mdtype, - * cnp.uint32_t* byte_count): + * cdef int cread_full_tag(self, # <<<<<<<<<<<<<< + * cnp.uint32_t* mdtype, + * cnp.uint32_t* byte_count) except -1: */ -static void __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_full_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count) { +static int __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_full_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count) { __pyx_t_5numpy_uint32_t __pyx_v_u4s[2]; + int __pyx_r; int __pyx_t_1; __Pyx_RefNannySetupContext("cread_full_tag"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":484 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":486 * ''' C method for reading full u4, u4 tag from stream''' * cdef cnp.uint32_t u4s[2] * self.cstream.read_into(u4s, 8) # <<<<<<<<<<<<<< * if self.is_swapped: * mdtype[0] = byteswap_u4(u4s[0]) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":485 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":487 * cdef cnp.uint32_t u4s[2] * self.cstream.read_into(u4s, 8) * if self.is_swapped: # <<<<<<<<<<<<<< * mdtype[0] = byteswap_u4(u4s[0]) * byte_count[0] = byteswap_u4(u4s[1]) */ - __pyx_t_1 = __pyx_v_self->is_swapped; - if (__pyx_t_1) { + if (__pyx_v_self->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":486 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":488 * self.cstream.read_into(u4s, 8) * if self.is_swapped: * mdtype[0] = byteswap_u4(u4s[0]) # <<<<<<<<<<<<<< @@ -3347,7 +3567,7 @@ */ (__pyx_v_mdtype[0]) = __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4((__pyx_v_u4s[0]), 0); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":487 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":489 * if self.is_swapped: * mdtype[0] = byteswap_u4(u4s[0]) * byte_count[0] = byteswap_u4(u4s[1]) # <<<<<<<<<<<<<< @@ -3359,43 +3579,55 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":489 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":491 * byte_count[0] = byteswap_u4(u4s[1]) * else: * mdtype[0] = u4s[0] # <<<<<<<<<<<<<< * byte_count[0] = u4s[1] - * + * return 0 */ (__pyx_v_mdtype[0]) = (__pyx_v_u4s[0]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":490 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":492 * else: * mdtype[0] = u4s[0] * byte_count[0] = u4s[1] # <<<<<<<<<<<<<< + * return 0 * - * cpdef VarHeader5 read_header(self): */ (__pyx_v_byte_count[0]) = (__pyx_v_u4s[1]); } __pyx_L3:; + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":493 + * mdtype[0] = u4s[0] + * byte_count[0] = u4s[1] + * return 0 # <<<<<<<<<<<<<< + * + * cpdef VarHeader5 read_header(self): + */ + __pyx_r = 0; goto __pyx_L0; + + __pyx_r = 0; + goto __pyx_L0; __pyx_L1_error:; - __Pyx_WriteUnraisable("scipy.io.matlab.mio5_utils.VarReader5.cread_full_tag"); + __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.cread_full_tag"); + __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); + return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":492 - * byte_count[0] = u4s[1] +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":495 + * return 0 * * cpdef VarHeader5 read_header(self): # <<<<<<<<<<<<<< * ''' Return matrix header for current stream position * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, int __pyx_skip_dispatch) { __pyx_t_5numpy_uint32_t __pyx_v_u4s[2]; __pyx_t_5numpy_uint32_t __pyx_v_flags_class; @@ -3410,19 +3642,18 @@ int __pyx_t_4; int __pyx_t_5; __Pyx_RefNannySetupContext("read_header"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)Py_None); __Pyx_INCREF(Py_None); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3431,35 +3662,34 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":506 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":509 * VarHeader5 header * # Read and discard mdtype and byte_count * self.cstream.read_into(u4s, 8) # <<<<<<<<<<<<<< * # get array flags and nzmax * self.cstream.read_into(u4s, 8) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":508 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":511 * self.cstream.read_into(u4s, 8) * # get array flags and nzmax * self.cstream.read_into(u4s, 8) # <<<<<<<<<<<<<< * if self.is_swapped: * flags_class = byteswap_u4(u4s[0]) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":509 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":512 * # get array flags and nzmax * self.cstream.read_into(u4s, 8) * if self.is_swapped: # <<<<<<<<<<<<<< * flags_class = byteswap_u4(u4s[0]) * nzmax = byteswap_u4(u4s[1]) */ - __pyx_t_3 = __pyx_v_self->is_swapped; - if (__pyx_t_3) { + if (__pyx_v_self->is_swapped) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":510 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":513 * self.cstream.read_into(u4s, 8) * if self.is_swapped: * flags_class = byteswap_u4(u4s[0]) # <<<<<<<<<<<<<< @@ -3468,7 +3698,7 @@ */ __pyx_v_flags_class = __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4((__pyx_v_u4s[0]), 0); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":511 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":514 * if self.is_swapped: * flags_class = byteswap_u4(u4s[0]) * nzmax = byteswap_u4(u4s[1]) # <<<<<<<<<<<<<< @@ -3480,7 +3710,7 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":513 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":516 * nzmax = byteswap_u4(u4s[1]) * else: * flags_class = u4s[0] # <<<<<<<<<<<<<< @@ -3489,7 +3719,7 @@ */ __pyx_v_flags_class = (__pyx_v_u4s[0]); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":514 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":517 * else: * flags_class = u4s[0] * nzmax = u4s[1] # <<<<<<<<<<<<<< @@ -3500,20 +3730,20 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":515 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":518 * flags_class = u4s[0] * nzmax = u4s[1] * header = VarHeader5() # <<<<<<<<<<<<<< * mc = flags_class & 0xFF * header.mclass = mc */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_header)); __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":516 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":519 * nzmax = u4s[1] * header = VarHeader5() * mc = flags_class & 0xFF # <<<<<<<<<<<<<< @@ -3522,7 +3752,7 @@ */ __pyx_v_mc = (__pyx_v_flags_class & 0xFF); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":517 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":520 * header = VarHeader5() * mc = flags_class & 0xFF * header.mclass = mc # <<<<<<<<<<<<<< @@ -3531,7 +3761,7 @@ */ __pyx_v_header->mclass = __pyx_v_mc; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":518 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":521 * mc = flags_class & 0xFF * header.mclass = mc * header.is_logical = flags_class >> 9 & 1 # <<<<<<<<<<<<<< @@ -3540,7 +3770,7 @@ */ __pyx_v_header->is_logical = ((__pyx_v_flags_class >> 9) & 1); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":519 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":522 * header.mclass = mc * header.is_logical = flags_class >> 9 & 1 * header.is_global = flags_class >> 10 & 1 # <<<<<<<<<<<<<< @@ -3549,7 +3779,7 @@ */ __pyx_v_header->is_global = ((__pyx_v_flags_class >> 10) & 1); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":520 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":523 * header.is_logical = flags_class >> 9 & 1 * header.is_global = flags_class >> 10 & 1 * header.is_complex = flags_class >> 11 & 1 # <<<<<<<<<<<<<< @@ -3558,7 +3788,7 @@ */ __pyx_v_header->is_complex = ((__pyx_v_flags_class >> 11) & 1); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":521 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":524 * header.is_global = flags_class >> 10 & 1 * header.is_complex = flags_class >> 11 & 1 * header.nzmax = nzmax # <<<<<<<<<<<<<< @@ -3567,7 +3797,7 @@ */ __pyx_v_header->nzmax = __pyx_v_nzmax; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":524 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":527 * # all miMATRIX types except the mxOPAQUE_CLASS have dims and a * # name. * if mc == mxOPAQUE_CLASS: # <<<<<<<<<<<<<< @@ -3577,7 +3807,7 @@ __pyx_t_4 = (__pyx_v_mc == __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOPAQUE_CLASS); if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":525 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":528 * # name. * if mc == mxOPAQUE_CLASS: * header.name = None # <<<<<<<<<<<<<< @@ -3590,7 +3820,7 @@ __Pyx_DECREF(__pyx_v_header->name); __pyx_v_header->name = Py_None; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":526 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":529 * if mc == mxOPAQUE_CLASS: * header.name = None * header.dims = None # <<<<<<<<<<<<<< @@ -3603,7 +3833,7 @@ __Pyx_DECREF(__pyx_v_header->dims); __pyx_v_header->dims = Py_None; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":527 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":530 * header.name = None * header.dims = None * return header # <<<<<<<<<<<<<< @@ -3618,17 +3848,17 @@ } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":528 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":531 * header.dims = None * return header * header.n_dims = self.read_into_int32s(header.dims_ptr) # <<<<<<<<<<<<<< * if header.n_dims > _MAT_MAXDIMS: * raise ValueError('Too many dimensions (%d) for numpy arrays' */ - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_into_int32s(__pyx_v_self, __pyx_v_header->dims_ptr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_into_int32s(__pyx_v_self, __pyx_v_header->dims_ptr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_header->n_dims = __pyx_t_3; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":529 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":532 * return header * header.n_dims = self.read_into_int32s(header.dims_ptr) * if header.n_dims > _MAT_MAXDIMS: # <<<<<<<<<<<<<< @@ -3638,41 +3868,41 @@ __pyx_t_4 = (__pyx_v_header->n_dims > 32); if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":531 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":534 * if header.n_dims > _MAT_MAXDIMS: * raise ValueError('Too many dimensions (%d) for numpy arrays' * % header.n_dims) # <<<<<<<<<<<<<< * # convert dims to list * header.dims = [] */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_header->n_dims); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_header->n_dims); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":533 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":536 * % header.n_dims) * # convert dims to list * header.dims = [] # <<<<<<<<<<<<<< * for i in range(header.n_dims): * header.dims.append(header.dims_ptr[i]) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __Pyx_GOTREF(__pyx_v_header->dims); @@ -3680,7 +3910,7 @@ __pyx_v_header->dims = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":534 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":537 * # convert dims to list * header.dims = [] * for i in range(header.n_dims): # <<<<<<<<<<<<<< @@ -3691,29 +3921,29 @@ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":535 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":538 * header.dims = [] * for i in range(header.n_dims): * header.dims.append(header.dims_ptr[i]) # <<<<<<<<<<<<<< * header.name = self.read_int8_string() * return header */ - __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((__pyx_v_header->dims_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32((__pyx_v_header->dims_ptr[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_header->dims, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_header->dims, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":536 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":539 * for i in range(header.n_dims): * header.dims.append(header.dims_ptr[i]) * header.name = self.read_int8_string() # <<<<<<<<<<<<<< * return header * */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_header->name); @@ -3721,7 +3951,7 @@ __pyx_v_header->name = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":537 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":540 * header.dims.append(header.dims_ptr[i]) * header.name = self.read_int8_string() * return header # <<<<<<<<<<<<<< @@ -3742,28 +3972,27 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_header); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":492 - * byte_count[0] = u4s[1] +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":495 + * return 0 * * cpdef VarHeader5 read_header(self): # <<<<<<<<<<<<<< * ''' Return matrix header for current stream position * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header[] = " Return matrix header for current stream position\n\n Returns matrix headers at top level and sub levels\n "; -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_header"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_header(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_header(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3781,7 +4010,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":539 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":542 * return header * * cdef inline size_t size_from_header(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -3791,18 +4020,13 @@ static CYTHON_INLINE size_t __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_size_from_header(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header) { size_t __pyx_v_size; - PyObject *__pyx_v_i; + int __pyx_v_i; size_t __pyx_r; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; + int __pyx_t_1; + int __pyx_t_2; __Pyx_RefNannySetupContext("size_from_header"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); - __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":556 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":559 * ''' * # calculate number of items in array from dims product * cdef size_t size = 1 # <<<<<<<<<<<<<< @@ -3811,62 +4035,28 @@ */ __pyx_v_size = 1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":557 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":560 * # calculate number of items in array from dims product * cdef size_t size = 1 * for i in range(header.n_dims): # <<<<<<<<<<<<<< * size *= header.dims_ptr[i] * return size */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_header->n_dims); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; - } else { - __pyx_t_2 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF(__pyx_v_i); + __pyx_t_1 = __pyx_v_header->n_dims; + for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":558 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":561 * cdef size_t size = 1 * for i in range(header.n_dims): * size *= header.dims_ptr[i] # <<<<<<<<<<<<<< * return size * */ - __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_size *= (__pyx_v_header->dims_ptr[__pyx_t_4]); + __pyx_v_size *= (__pyx_v_header->dims_ptr[__pyx_v_i]); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":559 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":562 * for i in range(header.n_dims): * size *= header.dims_ptr[i] * return size # <<<<<<<<<<<<<< @@ -3877,21 +4067,12 @@ goto __pyx_L0; __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("scipy.io.matlab.mio5_utils.VarReader5.size_from_header"); - __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_i); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":561 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":564 * return size * * cdef read_mi_matrix(self, int process=1): # <<<<<<<<<<<<<< @@ -3906,71 +4087,71 @@ __pyx_t_5numpy_uint32_t __pyx_v_byte_count; PyObject *__pyx_r = NULL; int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header __pyx_t_5; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header __pyx_t_6; __Pyx_RefNannySetupContext("read_mi_matrix"); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_process = __pyx_optional_args->process; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":582 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":585 * object arr * # read full tag * self.cread_full_tag(&mdtype, &byte_count) # <<<<<<<<<<<<<< * if mdtype != miMATRIX: * raise TypeError('Expecting matrix here') */ - ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_full_tag(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count)); + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_full_tag(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":583 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":586 * # read full tag * self.cread_full_tag(&mdtype, &byte_count) * if mdtype != miMATRIX: # <<<<<<<<<<<<<< * raise TypeError('Expecting matrix here') * if byte_count == 0: # empty matrix */ - __pyx_t_1 = (__pyx_v_mdtype != __pyx_e_5scipy_2io_6matlab_10mio5_utils_miMATRIX); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_mdtype != __pyx_e_5scipy_2io_6matlab_10mio5_utils_miMATRIX); + if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":584 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":587 * self.cread_full_tag(&mdtype, &byte_count) * if mdtype != miMATRIX: * raise TypeError('Expecting matrix here') # <<<<<<<<<<<<<< * if byte_count == 0: # empty matrix * if process and self.squeeze_me: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_7)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); + __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":585 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":588 * if mdtype != miMATRIX: * raise TypeError('Expecting matrix here') * if byte_count == 0: # empty matrix # <<<<<<<<<<<<<< * if process and self.squeeze_me: * return np.array([]) */ - __pyx_t_1 = (__pyx_v_byte_count == 0); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_v_byte_count == 0); + if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":586 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":589 * raise TypeError('Expecting matrix here') * if byte_count == 0: # empty matrix * if process and self.squeeze_me: # <<<<<<<<<<<<<< @@ -3978,13 +4159,13 @@ * else: */ if (__pyx_v_process) { - __pyx_t_1 = __pyx_v_self->squeeze_me; + __pyx_t_2 = __pyx_v_self->squeeze_me; } else { - __pyx_t_1 = __pyx_v_process; + __pyx_t_2 = __pyx_v_process; } - if (__pyx_t_1) { + if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":587 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":590 * if byte_count == 0: # empty matrix * if process and self.squeeze_me: * return np.array([]) # <<<<<<<<<<<<<< @@ -3992,30 +4173,30 @@ * return np.array([[]]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; goto __pyx_L5; } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":589 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":592 * return np.array([]) * else: * return np.array([[]]) # <<<<<<<<<<<<<< @@ -4023,29 +4204,29 @@ * return self.array_from_header(header, process) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); + PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; } __pyx_L5:; @@ -4053,20 +4234,20 @@ } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":590 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":593 * else: * return np.array([[]]) * header = self.read_header() # <<<<<<<<<<<<<< * return self.array_from_header(header, process) * */ - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_header(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_header(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_v_header)); - __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":591 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":594 * return np.array([[]]) * header = self.read_header() * return self.array_from_header(header, process) # <<<<<<<<<<<<<< @@ -4074,31 +4255,30 @@ * cpdef array_from_header(self, VarHeader5 header, int process=1): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5.__pyx_n = 1; - __pyx_t_5.process = __pyx_v_process; - __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->array_from_header(__pyx_v_self, __pyx_v_header, 0, &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_6.__pyx_n = 1; + __pyx_t_6.process = __pyx_v_process; + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->array_from_header(__pyx_v_self, __pyx_v_header, 0, &__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_header); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":593 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":596 * return self.array_from_header(header, process) * * cpdef array_from_header(self, VarHeader5 header, int process=1): # <<<<<<<<<<<<<< @@ -4118,16 +4298,13 @@ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6; + PyObject *__pyx_t_5; __Pyx_RefNannySetupContext("array_from_header"); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_process = __pyx_optional_args->process; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_arr = Py_None; __Pyx_INCREF(Py_None); __pyx_v_mat_dtype = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_classname = Py_None; __Pyx_INCREF(Py_None); @@ -4135,13 +4312,13 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__array_from_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__array_from_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_process); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_process); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_header)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_header)); @@ -4149,7 +4326,7 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -4160,7 +4337,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":611 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":614 * object arr * cnp.dtype mat_dtype * cdef int mc = header.mclass # <<<<<<<<<<<<<< @@ -4169,7 +4346,7 @@ */ __pyx_v_mc = __pyx_v_header->mclass; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":612 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":615 * cnp.dtype mat_dtype * cdef int mc = header.mclass * if (mc == mxDOUBLE_CLASS # <<<<<<<<<<<<<< @@ -4178,7 +4355,7 @@ */ switch (__pyx_v_mc) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":613 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":616 * cdef int mc = header.mclass * if (mc == mxDOUBLE_CLASS * or mc == mxSINGLE_CLASS # <<<<<<<<<<<<<< @@ -4187,7 +4364,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxDOUBLE_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":614 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":617 * if (mc == mxDOUBLE_CLASS * or mc == mxSINGLE_CLASS * or mc == mxINT8_CLASS # <<<<<<<<<<<<<< @@ -4196,7 +4373,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSINGLE_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":615 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":618 * or mc == mxSINGLE_CLASS * or mc == mxINT8_CLASS * or mc == mxUINT8_CLASS # <<<<<<<<<<<<<< @@ -4205,7 +4382,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT8_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":616 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":619 * or mc == mxINT8_CLASS * or mc == mxUINT8_CLASS * or mc == mxINT16_CLASS # <<<<<<<<<<<<<< @@ -4214,7 +4391,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT8_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":617 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":620 * or mc == mxUINT8_CLASS * or mc == mxINT16_CLASS * or mc == mxUINT16_CLASS # <<<<<<<<<<<<<< @@ -4223,7 +4400,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT16_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":618 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":621 * or mc == mxINT16_CLASS * or mc == mxUINT16_CLASS * or mc == mxINT32_CLASS # <<<<<<<<<<<<<< @@ -4232,7 +4409,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT16_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":619 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":622 * or mc == mxUINT16_CLASS * or mc == mxINT32_CLASS * or mc == mxUINT32_CLASS # <<<<<<<<<<<<<< @@ -4241,7 +4418,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT32_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":620 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":623 * or mc == mxINT32_CLASS * or mc == mxUINT32_CLASS * or mc == mxINT64_CLASS # <<<<<<<<<<<<<< @@ -4250,7 +4427,7 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT32_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":621 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":624 * or mc == mxUINT32_CLASS * or mc == mxINT64_CLASS * or mc == mxUINT64_CLASS): # numeric matrix # <<<<<<<<<<<<<< @@ -4260,20 +4437,20 @@ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT64_CLASS: case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT64_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":622 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":625 * or mc == mxINT64_CLASS * or mc == mxUINT64_CLASS): # numeric matrix * arr = self.read_real_complex(header) # <<<<<<<<<<<<<< * if process and self.mat_dtype: # might need to recast * if header.is_logical: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_real_complex(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_real_complex(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":623 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":626 * or mc == mxUINT64_CLASS): # numeric matrix * arr = self.read_real_complex(header) * if process and self.mat_dtype: # might need to recast # <<<<<<<<<<<<<< @@ -4287,17 +4464,16 @@ } if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":624 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":627 * arr = self.read_real_complex(header) * if process and self.mat_dtype: # might need to recast * if header.is_logical: # <<<<<<<<<<<<<< * mat_dtype = self.bool_dtype * else: */ - __pyx_t_5 = __pyx_v_header->is_logical; - if (__pyx_t_5) { + if (__pyx_v_header->is_logical) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":625 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":628 * if process and self.mat_dtype: # might need to recast * if header.is_logical: * mat_dtype = self.bool_dtype # <<<<<<<<<<<<<< @@ -4311,36 +4487,36 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":627 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":630 * mat_dtype = self.bool_dtype * else: * mat_dtype = self.class_dtypes[mc] # <<<<<<<<<<<<<< * arr = arr.astype(mat_dtype) * elif mc == mxSPARSE_CLASS: */ - __pyx_t_6 = (__pyx_v_self->class_dtypes[__pyx_v_mc]); - if (!(likely(((((PyObject *)__pyx_t_6)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_t_6), __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(((PyObject *)__pyx_t_6)); + __pyx_t_5 = (__pyx_v_self->class_dtypes[__pyx_v_mc]); + if (!(likely(((((PyObject *)__pyx_t_5)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_t_5), __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_v_mat_dtype)); - __pyx_v_mat_dtype = ((PyArray_Descr *)((PyObject *)__pyx_t_6)); + __pyx_v_mat_dtype = ((PyArray_Descr *)((PyObject *)__pyx_t_5)); } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":628 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":631 * else: * mat_dtype = self.class_dtypes[mc] * arr = arr.astype(mat_dtype) # <<<<<<<<<<<<<< * elif mc == mxSPARSE_CLASS: * arr = self.read_sparse(header) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_mat_dtype)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_mat_dtype)); __Pyx_GIVEREF(((PyObject *)__pyx_v_mat_dtype)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4352,7 +4528,7 @@ __pyx_L3:; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":629 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":632 * mat_dtype = self.class_dtypes[mc] * arr = arr.astype(mat_dtype) * elif mc == mxSPARSE_CLASS: # <<<<<<<<<<<<<< @@ -4361,20 +4537,20 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSPARSE_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":630 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":633 * arr = arr.astype(mat_dtype) * elif mc == mxSPARSE_CLASS: * arr = self.read_sparse(header) # <<<<<<<<<<<<<< * # no current processing makes sense for sparse * return arr */ - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_sparse(__pyx_v_self, __pyx_v_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_sparse(__pyx_v_self, __pyx_v_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":632 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":635 * arr = self.read_sparse(header) * # no current processing makes sense for sparse * return arr # <<<<<<<<<<<<<< @@ -4387,7 +4563,7 @@ goto __pyx_L0; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":633 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":636 * # no current processing makes sense for sparse * return arr * elif mc == mxCHAR_CLASS: # <<<<<<<<<<<<<< @@ -4396,20 +4572,20 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxCHAR_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":634 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":637 * return arr * elif mc == mxCHAR_CLASS: * arr = self.read_char(header) # <<<<<<<<<<<<<< * if process and self.chars_as_strings: * arr = chars_to_strings(arr) */ - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_char(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_char(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":635 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":638 * elif mc == mxCHAR_CLASS: * arr = self.read_char(header) * if process and self.chars_as_strings: # <<<<<<<<<<<<<< @@ -4423,21 +4599,21 @@ } if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":636 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":639 * arr = self.read_char(header) * if process and self.chars_as_strings: * arr = chars_to_strings(arr) # <<<<<<<<<<<<<< * elif mc == mxCELL_CLASS: * arr = self.read_cells(header) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__chars_to_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__chars_to_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4449,7 +4625,7 @@ __pyx_L5:; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":637 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":640 * if process and self.chars_as_strings: * arr = chars_to_strings(arr) * elif mc == mxCELL_CLASS: # <<<<<<<<<<<<<< @@ -4458,21 +4634,21 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxCELL_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":638 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":641 * arr = chars_to_strings(arr) * elif mc == mxCELL_CLASS: * arr = self.read_cells(header) # <<<<<<<<<<<<<< * elif mc == mxSTRUCT_CLASS: * arr = self.read_struct(header) */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_cells(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_cells(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":639 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":642 * elif mc == mxCELL_CLASS: * arr = self.read_cells(header) * elif mc == mxSTRUCT_CLASS: # <<<<<<<<<<<<<< @@ -4481,85 +4657,96 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSTRUCT_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":640 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":643 * arr = self.read_cells(header) * elif mc == mxSTRUCT_CLASS: * arr = self.read_struct(header) # <<<<<<<<<<<<<< * elif mc == mxOBJECT_CLASS: # like structs, but with classname - * classname = self.read_int8_string() + * classname = asstr(self.read_int8_string()) */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_struct(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_struct(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":641 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":644 * elif mc == mxSTRUCT_CLASS: * arr = self.read_struct(header) * elif mc == mxOBJECT_CLASS: # like structs, but with classname # <<<<<<<<<<<<<< - * classname = self.read_int8_string() + * classname = asstr(self.read_int8_string()) * arr = self.read_struct(header) */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOBJECT_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":642 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":645 * arr = self.read_struct(header) * elif mc == mxOBJECT_CLASS: # like structs, but with classname - * classname = self.read_int8_string() # <<<<<<<<<<<<<< + * classname = asstr(self.read_int8_string()) # <<<<<<<<<<<<<< * arr = self.read_struct(header) * arr = mio5p.MatlabObject(arr, classname) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__asstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_classname); - __pyx_v_classname = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_classname = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":643 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":646 * elif mc == mxOBJECT_CLASS: # like structs, but with classname - * classname = self.read_int8_string() + * classname = asstr(self.read_int8_string()) * arr = self.read_struct(header) # <<<<<<<<<<<<<< * arr = mio5p.MatlabObject(arr, classname) * elif mc == mxFUNCTION_CLASS: # just a matrix of struct type */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_struct(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_struct(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":644 - * classname = self.read_int8_string() + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":647 + * classname = asstr(self.read_int8_string()) * arr = self.read_struct(header) * arr = mio5p.MatlabObject(arr, classname) # <<<<<<<<<<<<<< * elif mc == mxFUNCTION_CLASS: # just a matrix of struct type * arr = self.read_mi_matrix() */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__MatlabObject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MatlabObject); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); __Pyx_INCREF(__pyx_v_classname); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_classname); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_classname); __Pyx_GIVEREF(__pyx_v_classname); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":645 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":648 * arr = self.read_struct(header) * arr = mio5p.MatlabObject(arr, classname) * elif mc == mxFUNCTION_CLASS: # just a matrix of struct type # <<<<<<<<<<<<<< @@ -4568,45 +4755,45 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxFUNCTION_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":646 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":649 * arr = mio5p.MatlabObject(arr, classname) * elif mc == mxFUNCTION_CLASS: # just a matrix of struct type * arr = self.read_mi_matrix() # <<<<<<<<<<<<<< * arr = mio5p.MatlabFunction(arr) * # to make them more re-writeable - don't squeeze */ - __pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_arr = __pyx_t_1; + __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":647 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":650 * elif mc == mxFUNCTION_CLASS: # just a matrix of struct type * arr = self.read_mi_matrix() * arr = mio5p.MatlabFunction(arr) # <<<<<<<<<<<<<< * # to make them more re-writeable - don't squeeze * return arr */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__MatlabFunction); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__MatlabFunction); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_arr = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":649 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":652 * arr = mio5p.MatlabFunction(arr) * # to make them more re-writeable - don't squeeze * return arr # <<<<<<<<<<<<<< @@ -4619,7 +4806,7 @@ goto __pyx_L0; break; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":650 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":653 * # to make them more re-writeable - don't squeeze * return arr * elif mc == mxOPAQUE_CLASS: # <<<<<<<<<<<<<< @@ -4628,45 +4815,45 @@ */ case __pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOPAQUE_CLASS: - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":651 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":654 * return arr * elif mc == mxOPAQUE_CLASS: * arr = self.read_opaque(header) # <<<<<<<<<<<<<< * arr = mio5p.MatlabOpaque(arr) * # to make them more re-writeable - don't squeeze */ - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_opaque(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_opaque(__pyx_v_self, __pyx_v_header, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_arr = __pyx_t_3; + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":652 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":655 * elif mc == mxOPAQUE_CLASS: * arr = self.read_opaque(header) * arr = mio5p.MatlabOpaque(arr) # <<<<<<<<<<<<<< * # to make them more re-writeable - don't squeeze * return arr */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MatlabOpaque); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__MatlabOpaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_arr = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":654 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":657 * arr = mio5p.MatlabOpaque(arr) * # to make them more re-writeable - don't squeeze * return arr # <<<<<<<<<<<<<< @@ -4680,7 +4867,7 @@ break; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":655 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":658 * # to make them more re-writeable - don't squeeze * return arr * if process and self.squeeze_me: # <<<<<<<<<<<<<< @@ -4694,7 +4881,7 @@ } if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":656 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":659 * return arr * if process and self.squeeze_me: * return squeeze_element(arr) # <<<<<<<<<<<<<< @@ -4702,25 +4889,25 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__squeeze_element); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__squeeze_element); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; goto __pyx_L6; } __pyx_L6:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":657 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":660 * if process and self.squeeze_me: * return squeeze_element(arr) * return arr # <<<<<<<<<<<<<< @@ -4744,14 +4931,12 @@ __Pyx_DECREF(__pyx_v_arr); __Pyx_DECREF((PyObject *)__pyx_v_mat_dtype); __Pyx_DECREF(__pyx_v_classname); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":593 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":596 * return self.array_from_header(header, process) * * cpdef array_from_header(self, VarHeader5 header, int process=1): # <<<<<<<<<<<<<< @@ -4784,24 +4969,24 @@ if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (kw_args > 1) { + if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__process); - if (unlikely(value)) { values[1] = value; kw_args--; } + if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "array_from_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "array_from_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)values[0]); if (values[1]) { - __pyx_v_process = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_process == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_process = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_process == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_process = ((int)1); } } else { __pyx_v_process = ((int)1); switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_process = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_process == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + case 2: __pyx_v_process = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_process == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} case 1: __pyx_v_header = ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)PyTuple_GET_ITEM(__pyx_args, 0)); break; default: goto __pyx_L5_argtuple_error; @@ -4809,16 +4994,17 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("array_from_header", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("array_from_header", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.array_from_header"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.process = __pyx_v_process; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->array_from_header(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), __pyx_v_header, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->array_from_header(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), __pyx_v_header, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4836,7 +5022,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":659 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":662 * return arr * * cpdef cnp.ndarray read_real_complex(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -4852,30 +5038,27 @@ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric __pyx_t_5; + struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric __pyx_t_4; __Pyx_RefNannySetupContext("read_real_complex"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_res_j = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_real_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_real_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_real_complex)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_header)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_header)); __Pyx_GIVEREF(((PyObject *)__pyx_v_header)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4884,62 +5067,61 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":663 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":666 * cdef: * cnp.ndarray res, res_j * if header.is_complex: # <<<<<<<<<<<<<< * # avoid array copy to save memory * res = self.read_numeric(False) */ - __pyx_t_4 = __pyx_v_header->is_complex; - if (__pyx_t_4) { + if (__pyx_v_header->is_complex) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":665 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":668 * if header.is_complex: * # avoid array copy to save memory * res = self.read_numeric(False) # <<<<<<<<<<<<<< * res_j = self.read_numeric(False) * res = res + (res_j * 1j) */ - __pyx_t_5.__pyx_n = 1; - __pyx_t_5.copy = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4.__pyx_n = 1; + __pyx_t_4.copy = 0; + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_res)); __pyx_v_res = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":666 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":669 * # avoid array copy to save memory * res = self.read_numeric(False) * res_j = self.read_numeric(False) # <<<<<<<<<<<<<< * res = res + (res_j * 1j) * else: */ - __pyx_t_5.__pyx_n = 1; - __pyx_t_5.copy = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4.__pyx_n = 1; + __pyx_t_4.copy = 0; + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_res_j)); __pyx_v_res_j = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":667 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":670 * res = self.read_numeric(False) * res_j = self.read_numeric(False) * res = res + (res_j * 1j) # <<<<<<<<<<<<<< * else: * res = self.read_numeric() */ - __pyx_t_1 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_res_j), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_res_j), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_res), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_res), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_res)); __pyx_v_res = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -4947,14 +5129,14 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":669 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":672 * res = res + (res_j * 1j) * else: * res = self.read_numeric() # <<<<<<<<<<<<<< * return res.reshape(header.dims[::-1]).T * */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_res)); __pyx_v_res = ((PyArrayObject *)__pyx_t_1); @@ -4962,7 +5144,7 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":670 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":673 * else: * res = self.read_numeric() * return res.reshape(header.dims[::-1]).T # <<<<<<<<<<<<<< @@ -4970,26 +5152,26 @@ * cdef object read_sparse(self, VarHeader5 header): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_res), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_res), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_3); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_3); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -5005,14 +5187,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_res); __Pyx_DECREF((PyObject *)__pyx_v_res_j); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":659 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":662 * return arr * * cpdef cnp.ndarray read_real_complex(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -5026,9 +5206,9 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_real_complex"); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_real_complex(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_real_complex(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5046,7 +5226,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":672 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":675 * return res.reshape(header.dims[::-1]).T * * cdef object read_sparse(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -5064,105 +5244,101 @@ size_t __pyx_v_nnz; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; size_t __pyx_t_5; - size_t __pyx_t_6; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("read_sparse"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_rowind = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_indptr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_data_j = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":676 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":679 * cdef cnp.ndarray rowind, indptr, data, data_j * cdef size_t M, N, nnz * rowind = self.read_numeric() # <<<<<<<<<<<<<< * indptr = self.read_numeric() * if header.is_complex: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_rowind)); __pyx_v_rowind = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":677 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":680 * cdef size_t M, N, nnz * rowind = self.read_numeric() * indptr = self.read_numeric() # <<<<<<<<<<<<<< * if header.is_complex: * # avoid array copy to save memory */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_indptr)); __pyx_v_indptr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":678 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":681 * rowind = self.read_numeric() * indptr = self.read_numeric() * if header.is_complex: # <<<<<<<<<<<<<< * # avoid array copy to save memory * data = self.read_numeric(False) */ - __pyx_t_2 = __pyx_v_header->is_complex; - if (__pyx_t_2) { + if (__pyx_v_header->is_complex) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":680 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":683 * if header.is_complex: * # avoid array copy to save memory * data = self.read_numeric(False) # <<<<<<<<<<<<<< * data_j = self.read_numeric(False) * data = data + (data_j * 1j) */ - __pyx_t_3.__pyx_n = 1; - __pyx_t_3.copy = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.copy = 0; + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_data)); __pyx_v_data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":681 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":684 * # avoid array copy to save memory * data = self.read_numeric(False) * data_j = self.read_numeric(False) # <<<<<<<<<<<<<< * data = data + (data_j * 1j) * else: */ - __pyx_t_3.__pyx_n = 1; - __pyx_t_3.copy = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.copy = 0; + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_data_j)); __pyx_v_data_j = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":682 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":685 * data = self.read_numeric(False) * data_j = self.read_numeric(False) * data = data + (data_j * 1j) # <<<<<<<<<<<<<< * else: * data = self.read_numeric() */ - __pyx_t_1 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_data_j), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_data_j), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_data), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_data), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_data)); __pyx_v_data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -5170,14 +5346,14 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":684 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":687 * data = data + (data_j * 1j) * else: * data = self.read_numeric() # <<<<<<<<<<<<<< * ''' From the matlab (TM) API documentation, last found here: * http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/ */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_numeric(__pyx_v_self, 0, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_data)); __pyx_v_data = ((PyArrayObject *)__pyx_t_1); @@ -5185,7 +5361,7 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":697 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":700 * to each rowind * ''' * M,N = header.dims # <<<<<<<<<<<<<< @@ -5195,86 +5371,86 @@ if (PyTuple_CheckExact(__pyx_v_header->dims) && likely(PyTuple_GET_SIZE(__pyx_v_header->dims) == 2)) { PyObject* tuple = __pyx_v_header->dims; __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_M = __pyx_t_5; - __pyx_v_N = __pyx_t_6; + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_M = __pyx_t_4; + __pyx_v_N = __pyx_t_5; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_v_header->dims); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_v_header->dims); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_M = __pyx_t_6; - __pyx_v_N = __pyx_t_5; + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_v_M = __pyx_t_5; + __pyx_v_N = __pyx_t_4; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":698 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":701 * ''' * M,N = header.dims * indptr = indptr[:N+1] # <<<<<<<<<<<<<< * nnz = indptr[-1] * rowind = rowind[:nnz] */ - __pyx_t_4 = PySequence_GetSlice(((PyObject *)__pyx_v_indptr), 0, (__pyx_v_N + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(((PyObject *)__pyx_v_indptr), 0, (__pyx_v_N + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_indptr)); - __pyx_v_indptr = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_indptr = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":699 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":702 * M,N = header.dims * indptr = indptr[:N+1] * nnz = indptr[-1] # <<<<<<<<<<<<<< * rowind = rowind[:nnz] * data = data[:nnz] */ - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_indptr), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyInt_AsSize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_nnz = __pyx_t_5; + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_indptr), -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_AsSize_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_nnz = __pyx_t_4; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":700 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":703 * indptr = indptr[:N+1] * nnz = indptr[-1] * rowind = rowind[:nnz] # <<<<<<<<<<<<<< * data = data[:nnz] * return scipy.sparse.csc_matrix( */ - __pyx_t_4 = PySequence_GetSlice(((PyObject *)__pyx_v_rowind), 0, __pyx_v_nnz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(((PyObject *)__pyx_v_rowind), 0, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_rowind)); - __pyx_v_rowind = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_rowind = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":701 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":704 * nnz = indptr[-1] * rowind = rowind[:nnz] * data = data[:nnz] # <<<<<<<<<<<<<< * return scipy.sparse.csc_matrix( * (data,rowind,indptr), */ - __pyx_t_4 = PySequence_GetSlice(((PyObject *)__pyx_v_data), 0, __pyx_v_nnz); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(((PyObject *)__pyx_v_data), 0, __pyx_v_nnz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_data)); - __pyx_v_data = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_data = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":702 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":705 * rowind = rowind[:nnz] * data = data[:nnz] * return scipy.sparse.csc_matrix( # <<<<<<<<<<<<<< @@ -5282,23 +5458,23 @@ * shape=(M,N)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__scipy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__scipy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__csc_matrix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":703 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":706 * data = data[:nnz] * return scipy.sparse.csc_matrix( * (data,rowind,indptr), # <<<<<<<<<<<<<< * shape=(M,N)) * */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_data)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_data)); @@ -5309,61 +5485,61 @@ __Pyx_INCREF(((PyObject *)__pyx_v_indptr)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_indptr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_indptr)); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":702 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":705 * rowind = rowind[:nnz] * data = data[:nnz] * return scipy.sparse.csc_matrix( # <<<<<<<<<<<<<< * (data,rowind,indptr), * shape=(M,N)) */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":704 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":707 * return scipy.sparse.csc_matrix( * (data,rowind,indptr), * shape=(M,N)) # <<<<<<<<<<<<<< * * cpdef cnp.ndarray read_char(self, VarHeader5 header): */ - __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_M); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_M); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_v_N); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__shape), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_r = __pyx_t_9; __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__shape), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_7, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_sparse"); __pyx_r = 0; __pyx_L0:; @@ -5371,14 +5547,12 @@ __Pyx_DECREF((PyObject *)__pyx_v_indptr); __Pyx_DECREF((PyObject *)__pyx_v_data); __Pyx_DECREF((PyObject *)__pyx_v_data_j); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":706 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":709 * shape=(M,N)) * * cpdef cnp.ndarray read_char(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -5406,10 +5580,7 @@ int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; - int __pyx_t_9; __Pyx_RefNannySetupContext("read_char"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); __pyx_v_codec = Py_None; __Pyx_INCREF(Py_None); __pyx_v_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -5418,19 +5589,19 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_char)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_header)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_header)); __Pyx_GIVEREF(((PyObject *)__pyx_v_header)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5439,7 +5610,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":732 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":735 * object data, res, codec * cnp.ndarray arr * cdef size_t length = self.size_from_header(header) # <<<<<<<<<<<<<< @@ -5448,7 +5619,7 @@ */ __pyx_v_length = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->size_from_header(__pyx_v_self, __pyx_v_header); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":734 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":737 * cdef size_t length = self.size_from_header(header) * data = self.read_element( * &mdtype, &byte_count, &data_ptr, True) # <<<<<<<<<<<<<< @@ -5457,13 +5628,13 @@ */ __pyx_t_4.__pyx_n = 1; __pyx_t_4.copy = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_element(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), ((void **)(&__pyx_v_data_ptr)), &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_data); __pyx_v_data = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":739 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":742 * # a length 1 type encoding, like ascii, or length 2 type * # encoding * cdef cnp.dtype dt = self.dtypes[mdtype] # <<<<<<<<<<<<<< @@ -5474,7 +5645,7 @@ __Pyx_INCREF(((PyObject *)((PyArray_Descr *)__pyx_t_5))); __pyx_v_dt = ((PyArray_Descr *)__pyx_t_5); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":740 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":743 * # encoding * cdef cnp.dtype dt = self.dtypes[mdtype] * if mdtype == miUINT16: # <<<<<<<<<<<<<< @@ -5484,7 +5655,7 @@ __pyx_t_6 = (__pyx_v_mdtype == __pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT16); if (__pyx_t_6) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":741 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":744 * cdef cnp.dtype dt = self.dtypes[mdtype] * if mdtype == miUINT16: * codec = self.uint16_codec # <<<<<<<<<<<<<< @@ -5495,99 +5666,99 @@ __Pyx_DECREF(__pyx_v_codec); __pyx_v_codec = __pyx_v_self->uint16_codec; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":742 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":745 * if mdtype == miUINT16: * codec = self.uint16_codec * if self.codecs['uint16_len'] == 1: # need LSBs only # <<<<<<<<<<<<<< * arr = np.ndarray(shape=(length,), * dtype=dt, */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_self->codecs, ((PyObject *)__pyx_n_s__uint16_len)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_self->codecs, ((PyObject *)__pyx_n_s__uint16_len)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":743 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":746 * codec = self.uint16_codec * if self.codecs['uint16_len'] == 1: # need LSBs only * arr = np.ndarray(shape=(length,), # <<<<<<<<<<<<<< * dtype=dt, * buffer=data) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__shape), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__shape), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":744 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":747 * if self.codecs['uint16_len'] == 1: # need LSBs only * arr = np.ndarray(shape=(length,), * dtype=dt, # <<<<<<<<<<<<<< * buffer=data) * data = arr.astype(np.uint8).tostring() */ - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_dt)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_dt)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":745 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":748 * arr = np.ndarray(shape=(length,), * dtype=dt, * buffer=data) # <<<<<<<<<<<<<< * data = arr.astype(np.uint8).tostring() * elif mdtype == miINT8 or mdtype == miUINT8: */ - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__buffer), __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__buffer), __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_arr)); __pyx_v_arr = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":746 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":749 * dtype=dt, * buffer=data) * data = arr.astype(np.uint8).tostring() # <<<<<<<<<<<<<< * elif mdtype == miINT8 or mdtype == miUINT8: * codec = 'ascii' */ - __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_s__astype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_s__astype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__tostring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__tostring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_data); @@ -5599,23 +5770,25 @@ goto __pyx_L3; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":747 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":750 * buffer=data) * data = arr.astype(np.uint8).tostring() * elif mdtype == miINT8 or mdtype == miUINT8: # <<<<<<<<<<<<<< * codec = 'ascii' * elif mdtype in self.codecs: # encoded char data */ - __pyx_t_6 = (__pyx_v_mdtype == __pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT8); - if (!__pyx_t_6) { - __pyx_t_8 = (__pyx_v_mdtype == __pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT8); - __pyx_t_9 = __pyx_t_8; - } else { - __pyx_t_9 = __pyx_t_6; + switch (__pyx_v_mdtype) { + case __pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT8: + case __pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT8: + __pyx_t_6 = 1; + break; + default: + __pyx_t_6 = 0; + break; } - if (__pyx_t_9) { + if (__pyx_t_6) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":748 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":751 * data = arr.astype(np.uint8).tostring() * elif mdtype == miINT8 or mdtype == miUINT8: * codec = 'ascii' # <<<<<<<<<<<<<< @@ -5628,66 +5801,66 @@ goto __pyx_L3; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":749 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":752 * elif mdtype == miINT8 or mdtype == miUINT8: * codec = 'ascii' * elif mdtype in self.codecs: # encoded char data # <<<<<<<<<<<<<< * codec = self.codecs[mdtype] * if not codec: */ - __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = ((PySequence_Contains(__pyx_v_self->codecs, __pyx_t_1))); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = ((PySequence_Contains(__pyx_v_self->codecs, __pyx_t_1))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_6) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":750 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":753 * codec = 'ascii' * elif mdtype in self.codecs: # encoded char data * codec = self.codecs[mdtype] # <<<<<<<<<<<<<< * if not codec: * raise TypeError('Do not support encoding %d' % mdtype) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->codecs, __pyx_v_mdtype, sizeof(__pyx_t_5numpy_uint32_t)+1, __Pyx_PyInt_to_py_npy_uint32); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->codecs, __pyx_v_mdtype, sizeof(__pyx_t_5numpy_uint32_t)+1, __Pyx_PyInt_to_py_npy_uint32); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_codec); __pyx_v_codec = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":751 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":754 * elif mdtype in self.codecs: # encoded char data * codec = self.codecs[mdtype] * if not codec: # <<<<<<<<<<<<<< * raise TypeError('Do not support encoding %d' % mdtype) * else: */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_codec); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = (!__pyx_t_9); - if (__pyx_t_6) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_codec); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = (!__pyx_t_6); + if (__pyx_t_8) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":752 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":755 * codec = self.codecs[mdtype] * if not codec: * raise TypeError('Do not support encoding %d' % mdtype) # <<<<<<<<<<<<<< * else: * raise ValueError('Type %d does not appear to be char type' */ - __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; @@ -5695,47 +5868,47 @@ } /*else*/ { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":755 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":758 * else: * raise ValueError('Type %d does not appear to be char type' * % mdtype) # <<<<<<<<<<<<<< * uc_str = data.decode(codec) * # cast to array to deal with 2, 4 byte width characters */ - __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":756 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":759 * raise ValueError('Type %d does not appear to be char type' * % mdtype) * uc_str = data.decode(codec) # <<<<<<<<<<<<<< * # cast to array to deal with 2, 4 byte width characters - * arr = np.array(uc_str) + * arr = np.array(uc_str, dtype='U') */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_data, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_data, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_codec); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_codec); __Pyx_GIVEREF(__pyx_v_codec); - __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5743,35 +5916,39 @@ __pyx_v_uc_str = __pyx_t_7; __pyx_t_7 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":758 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":761 * uc_str = data.decode(codec) * # cast to array to deal with 2, 4 byte width characters - * arr = np.array(uc_str) # <<<<<<<<<<<<<< + * arr = np.array(uc_str, dtype='U') # <<<<<<<<<<<<<< * dt = self.U1_dtype * # could take this to numpy C-API level, but probably not worth */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_uc_str); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_uc_str); __Pyx_GIVEREF(__pyx_v_uc_str); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__U)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_arr)); - __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":759 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":762 * # cast to array to deal with 2, 4 byte width characters - * arr = np.array(uc_str) + * arr = np.array(uc_str, dtype='U') * dt = self.U1_dtype # <<<<<<<<<<<<<< * # could take this to numpy C-API level, but probably not worth * # it @@ -5780,7 +5957,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_dt)); __pyx_v_dt = __pyx_v_self->U1_dtype; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":762 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":765 * # could take this to numpy C-API level, but probably not worth * # it * return np.ndarray(shape=header.dims, # <<<<<<<<<<<<<< @@ -5788,40 +5965,40 @@ * buffer=arr, */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__shape), __pyx_v_header->dims) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__shape), __pyx_v_header->dims) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":763 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":766 * # it * return np.ndarray(shape=header.dims, * dtype=dt, # <<<<<<<<<<<<<< * buffer=arr, * order='F') */ - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_dt)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_dt)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":764 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":767 * return np.ndarray(shape=header.dims, * dtype=dt, * buffer=arr, # <<<<<<<<<<<<<< * order='F') * */ - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__buffer), ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__F)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__buffer), ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__F)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; goto __pyx_L0; __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -5839,14 +6016,12 @@ __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XDECREF((PyObject *)__pyx_v_dt); __Pyx_DECREF(__pyx_v_uc_str); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":706 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":709 * shape=(M,N)) * * cpdef cnp.ndarray read_char(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -5860,9 +6035,9 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_char"); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_char(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_char(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -5880,7 +6055,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":767 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":770 * order='F') * * cpdef cnp.ndarray read_cells(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -5912,28 +6087,26 @@ size_t __pyx_t_12; PyObject **__pyx_t_13; __Pyx_RefNannySetupContext("read_cells"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tupdims = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_tupdims = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_result.buf = NULL; /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_cells); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_cells)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_header)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_header)); __Pyx_GIVEREF(((PyObject *)__pyx_v_header)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5942,31 +6115,31 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":773 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":776 * cnp.ndarray[object, ndim=1] result * # Account for fortran indexing of cells * tupdims = tuple(header.dims[::-1]) # <<<<<<<<<<<<<< * cdef size_t length = self.size_from_header(header) * result = np.empty(length, dtype=object) */ - __pyx_t_1 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_tupdims); - __pyx_v_tupdims = __pyx_t_3; + __Pyx_DECREF(((PyObject *)__pyx_v_tupdims)); + __pyx_v_tupdims = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":774 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":777 * # Account for fortran indexing of cells * tupdims = tuple(header.dims[::-1]) * cdef size_t length = self.size_from_header(header) # <<<<<<<<<<<<<< @@ -5975,34 +6148,34 @@ */ __pyx_v_length = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->size_from_header(__pyx_v_self, __pyx_v_header); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":775 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":778 * tupdims = tuple(header.dims[::-1]) * cdef size_t length = self.size_from_header(header) * result = np.empty(length, dtype=object) # <<<<<<<<<<<<<< * for i in range(length): * result[i] = self.read_mi_matrix() */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6019,14 +6192,14 @@ } __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; - if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_result)); __pyx_v_result = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":776 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":779 * cdef size_t length = self.size_from_header(header) * result = np.empty(length, dtype=object) * for i in range(length): # <<<<<<<<<<<<<< @@ -6037,21 +6210,21 @@ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":777 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":780 * result = np.empty(length, dtype=object) * for i in range(length): * result[i] = self.read_mi_matrix() # <<<<<<<<<<<<<< * return result.reshape(tupdims).T * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __pyx_v_i; __pyx_t_6 = -1; - if (unlikely(__pyx_t_12 >= __pyx_bshape_0_result)) __pyx_t_6 = 0; + if (unlikely(__pyx_t_12 >= (size_t)__pyx_bshape_0_result)) __pyx_t_6 = 0; if (unlikely(__pyx_t_6 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_6); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_12, __pyx_bstride_0_result); __Pyx_GOTREF(*__pyx_t_13); @@ -6061,7 +6234,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":778 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":781 * for i in range(length): * result[i] = self.read_mi_matrix() * return result.reshape(tupdims).T # <<<<<<<<<<<<<< @@ -6069,21 +6242,21 @@ * def read_fieldnames(self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_tupdims); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tupdims); - __Pyx_GIVEREF(__pyx_v_tupdims); - __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_INCREF(((PyObject *)__pyx_v_tupdims)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_tupdims)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_tupdims)); + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; @@ -6107,14 +6280,12 @@ __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_result); __Pyx_DECREF(__pyx_v_tupdims); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":767 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":770 * order='F') * * cpdef cnp.ndarray read_cells(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -6128,9 +6299,9 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_cells"); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_cells(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_cells(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6148,7 +6319,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":780 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":783 * return result.reshape(tupdims).T * * def read_fieldnames(self): # <<<<<<<<<<<<<< @@ -6156,15 +6327,15 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_fieldnames(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_fieldnames(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_fieldnames[] = " Read fieldnames for struct-like matrix '\n\n Python wrapper for cdef'ed method\n "; -static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_fieldnames(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_fieldnames(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_n_names; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_fieldnames"); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":786 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":789 * ''' * cdef int n_names * return self.cread_fieldnames(&n_names) # <<<<<<<<<<<<<< @@ -6172,7 +6343,7 @@ * cdef inline object cread_fieldnames(self, int *n_names_ptr): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_fieldnames(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_n_names)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->cread_fieldnames(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), (&__pyx_v_n_names)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6190,7 +6361,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":788 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":791 * return self.cread_fieldnames(&n_names) * * cdef inline object cread_fieldnames(self, int *n_names_ptr): # <<<<<<<<<<<<<< @@ -6215,22 +6386,22 @@ Py_ssize_t __pyx_t_5; char *__pyx_t_6; int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("cread_fieldnames"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_name = Py_None; __Pyx_INCREF(Py_None); __pyx_v_field_names = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":794 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":797 * object name, field_names * # Read field names into list * cdef int res = self.read_into_int32s(&namelength) # <<<<<<<<<<<<<< * if res != 1: * raise ValueError('Only one value for namelength') */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_into_int32s(__pyx_v_self, (&__pyx_v_namelength)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_into_int32s(__pyx_v_self, (&__pyx_v_namelength)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = __pyx_t_1; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":795 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":798 * # Read field names into list * cdef int res = self.read_into_int32s(&namelength) * if res != 1: # <<<<<<<<<<<<<< @@ -6240,119 +6411,131 @@ __pyx_t_2 = (__pyx_v_res != 1); if (__pyx_t_2) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":796 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":799 * cdef int res = self.read_into_int32s(&namelength) * if res != 1: * raise ValueError('Only one value for namelength') # <<<<<<<<<<<<<< * cdef object names = self.read_int8_string() * field_names = [] */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":797 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":800 * if res != 1: * raise ValueError('Only one value for namelength') * cdef object names = self.read_int8_string() # <<<<<<<<<<<<<< * field_names = [] - * n_names = PyString_Size(names) // namelength + * n_names = PyBytes_Size(names) // namelength */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_names = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":798 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":801 * raise ValueError('Only one value for namelength') * cdef object names = self.read_int8_string() * field_names = [] # <<<<<<<<<<<<<< - * n_names = PyString_Size(names) // namelength + * n_names = PyBytes_Size(names) // namelength * cdef char *n_ptr = names */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_v_field_names); __pyx_v_field_names = ((PyObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":799 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":802 * cdef object names = self.read_int8_string() * field_names = [] - * n_names = PyString_Size(names) // namelength # <<<<<<<<<<<<<< + * n_names = PyBytes_Size(names) // namelength # <<<<<<<<<<<<<< * cdef char *n_ptr = names * for i in range(n_names): */ - __pyx_t_5 = PyString_Size(__pyx_v_names); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyBytes_Size(__pyx_v_names); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(__pyx_v_namelength == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_namelength == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_5))) { PyErr_Format(PyExc_OverflowError, "value too large to perform division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_n_names = __Pyx_div_Py_ssize_t(__pyx_t_5, __pyx_v_namelength); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":800 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":803 * field_names = [] - * n_names = PyString_Size(names) // namelength + * n_names = PyBytes_Size(names) // namelength * cdef char *n_ptr = names # <<<<<<<<<<<<<< * for i in range(n_names): - * name = PyString_FromString(n_ptr) + * name = PyBytes_FromString(n_ptr) */ - __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_names); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyBytes_AsString(__pyx_v_names); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n_ptr = __pyx_t_6; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":801 - * n_names = PyString_Size(names) // namelength + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":804 + * n_names = PyBytes_Size(names) // namelength * cdef char *n_ptr = names * for i in range(n_names): # <<<<<<<<<<<<<< - * name = PyString_FromString(n_ptr) - * field_names.append(name) + * name = PyBytes_FromString(n_ptr) + * field_names.append(asstr(name)) */ __pyx_t_1 = __pyx_v_n_names; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_1; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":802 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":805 * cdef char *n_ptr = names * for i in range(n_names): - * name = PyString_FromString(n_ptr) # <<<<<<<<<<<<<< - * field_names.append(name) + * name = PyBytes_FromString(n_ptr) # <<<<<<<<<<<<<< + * field_names.append(asstr(name)) * n_ptr += namelength */ - __pyx_t_4 = PyString_FromString(__pyx_v_n_ptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((PyObject *)PyBytes_FromString(__pyx_v_n_ptr)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_name); __pyx_v_name = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":803 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":806 * for i in range(n_names): - * name = PyString_FromString(n_ptr) - * field_names.append(name) # <<<<<<<<<<<<<< + * name = PyBytes_FromString(n_ptr) + * field_names.append(asstr(name)) # <<<<<<<<<<<<<< * n_ptr += namelength * n_names_ptr[0] = n_names */ - __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_field_names, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__asstr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + __pyx_t_8 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_field_names, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":804 - * name = PyString_FromString(n_ptr) - * field_names.append(name) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":807 + * name = PyBytes_FromString(n_ptr) + * field_names.append(asstr(name)) * n_ptr += namelength # <<<<<<<<<<<<<< * n_names_ptr[0] = n_names * return field_names @@ -6360,8 +6543,8 @@ __pyx_v_n_ptr += __pyx_v_namelength; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":805 - * field_names.append(name) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":808 + * field_names.append(asstr(name)) * n_ptr += namelength * n_names_ptr[0] = n_names # <<<<<<<<<<<<<< * return field_names @@ -6369,7 +6552,7 @@ */ (__pyx_v_n_names_ptr[0]) = __pyx_v_n_names; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":806 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":809 * n_ptr += namelength * n_names_ptr[0] = n_names * return field_names # <<<<<<<<<<<<<< @@ -6386,19 +6569,19 @@ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.cread_fieldnames"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_name); __Pyx_DECREF(__pyx_v_field_names); __Pyx_XDECREF(__pyx_v_names); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":808 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":811 * return field_names * * cpdef cnp.ndarray read_struct(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -6428,10 +6611,10 @@ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - size_t __pyx_t_8; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + size_t __pyx_t_7; + int __pyx_t_8; PyArrayObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; @@ -6440,8 +6623,6 @@ int __pyx_t_14; PyObject **__pyx_t_15; __Pyx_RefNannySetupContext("read_struct"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF((PyObject *)__pyx_v_header); __pyx_v_rec_res = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_dt = Py_None; __Pyx_INCREF(Py_None); @@ -6455,19 +6636,19 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_struct)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_header)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_header)); __Pyx_GIVEREF(((PyObject *)__pyx_v_header)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6476,43 +6657,43 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":821 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":824 * object dt, tupdims * # Read field names into list * cdef object field_names = self.cread_fieldnames(&n_names) # <<<<<<<<<<<<<< * # Prepare struct array * tupdims = tuple(header.dims[::-1]) */ - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_fieldnames(__pyx_v_self, (&__pyx_v_n_names)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_fieldnames(__pyx_v_self, (&__pyx_v_n_names)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_field_names = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":823 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":826 * cdef object field_names = self.cread_fieldnames(&n_names) * # Prepare struct array * tupdims = tuple(header.dims[::-1]) # <<<<<<<<<<<<<< * cdef size_t length = self.size_from_header(header) * if self.struct_as_record: # to record arrays */ - __pyx_t_1 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_header->dims, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_tupdims); __pyx_v_tupdims = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":824 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":827 * # Prepare struct array * tupdims = tuple(header.dims[::-1]) * cdef size_t length = self.size_from_header(header) # <<<<<<<<<<<<<< @@ -6521,27 +6702,26 @@ */ __pyx_v_length = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->size_from_header(__pyx_v_self, __pyx_v_header); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":825 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":828 * tupdims = tuple(header.dims[::-1]) * cdef size_t length = self.size_from_header(header) * if self.struct_as_record: # to record arrays # <<<<<<<<<<<<<< * if not n_names: * # If there are no field names, there is no dtype */ - __pyx_t_4 = __pyx_v_self->struct_as_record; - if (__pyx_t_4) { + if (__pyx_v_self->struct_as_record) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":826 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":829 * cdef size_t length = self.size_from_header(header) * if self.struct_as_record: # to record arrays * if not n_names: # <<<<<<<<<<<<<< * # If there are no field names, there is no dtype * # representation we can use, falling back to empty */ - __pyx_t_5 = (!__pyx_v_n_names); - if (__pyx_t_5) { + __pyx_t_4 = (!__pyx_v_n_names); + if (__pyx_t_4) { - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":830 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":833 * # representation we can use, falling back to empty * # object * return np.empty(tupdims, dtype=object).T # <<<<<<<<<<<<<< @@ -6549,28 +6729,28 @@ * rec_res = np.empty(length, dtype=dt) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_tupdims); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tupdims); __Pyx_GIVEREF(__pyx_v_tupdims); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; @@ -6578,32 +6758,32 @@ } __pyx_L4:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":831 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":834 * # object * return np.empty(tupdims, dtype=object).T * dt = [(field_name, object) for field_name in field_names] # <<<<<<<<<<<<<< * rec_res = np.empty(length, dtype=dt) * for i in range(length): */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); if (PyList_CheckExact(__pyx_v_field_names) || PyTuple_CheckExact(__pyx_v_field_names)) { - __pyx_t_7 = 0; __pyx_t_6 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_6); + __pyx_t_6 = 0; __pyx_t_5 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); } for (;;) { - if (likely(PyList_CheckExact(__pyx_t_6))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; - } else if (likely(PyTuple_CheckExact(__pyx_t_6))) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; + if (likely(PyList_CheckExact(__pyx_t_5))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; + } else if (likely(PyTuple_CheckExact(__pyx_t_5))) { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; } else { - __pyx_t_3 = PyIter_Next(__pyx_t_6); + __pyx_t_3 = PyIter_Next(__pyx_t_5); if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_3); @@ -6611,7 +6791,7 @@ __Pyx_DECREF(__pyx_v_field_name); __pyx_v_field_name = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_field_name); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field_name); @@ -6619,59 +6799,59 @@ __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); - __pyx_t_4 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_3); if (unlikely(__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_v_dt); __pyx_v_dt = ((PyObject *)__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":832 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":835 * return np.empty(tupdims, dtype=object).T * dt = [(field_name, object) for field_name in field_names] * rec_res = np.empty(length, dtype=dt) # <<<<<<<<<<<<<< * for i in range(length): * for field_name in field_names: */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_v_dt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_v_dt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_rec_res)); __pyx_v_rec_res = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":833 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":836 * dt = [(field_name, object) for field_name in field_names] * rec_res = np.empty(length, dtype=dt) * for i in range(length): # <<<<<<<<<<<<<< * for field_name in field_names: * rec_res[i][field_name] = self.read_mi_matrix() */ - __pyx_t_8 = __pyx_v_length; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_8; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":834 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":837 * rec_res = np.empty(length, dtype=dt) * for i in range(length): * for field_name in field_names: # <<<<<<<<<<<<<< @@ -6679,22 +6859,22 @@ * return rec_res.reshape(tupdims).T */ if (PyList_CheckExact(__pyx_v_field_names) || PyTuple_CheckExact(__pyx_v_field_names)) { - __pyx_t_7 = 0; __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = 0; __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; } else { __pyx_t_2 = PyIter_Next(__pyx_t_1); if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); @@ -6703,25 +6883,25 @@ __pyx_v_field_name = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":835 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":838 * for i in range(length): * for field_name in field_names: * rec_res[i][field_name] = self.read_mi_matrix() # <<<<<<<<<<<<<< * return rec_res.reshape(tupdims).T * # Backward compatibility with previous format */ - __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_rec_res), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_rec_res), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetItem(__pyx_t_3, __pyx_v_field_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_3, __pyx_v_field_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":836 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":839 * for field_name in field_names: * rec_res[i][field_name] = self.read_mi_matrix() * return rec_res.reshape(tupdims).T # <<<<<<<<<<<<<< @@ -6729,21 +6909,21 @@ * obj_template = mio5p.mat_struct() */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_rec_res), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_rec_res), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tupdims); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tupdims); __Pyx_GIVEREF(__pyx_v_tupdims); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; @@ -6751,68 +6931,68 @@ } __pyx_L3:; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":838 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":841 * return rec_res.reshape(tupdims).T * # Backward compatibility with previous format * obj_template = mio5p.mat_struct() # <<<<<<<<<<<<<< * obj_template._fieldnames = field_names * result = np.empty(length, dtype=object) */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__mat_struct); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__mat_struct); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_obj_template); __pyx_v_obj_template = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":839 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":842 * # Backward compatibility with previous format * obj_template = mio5p.mat_struct() * obj_template._fieldnames = field_names # <<<<<<<<<<<<<< * result = np.empty(length, dtype=object) * for i in range(length): */ - if (PyObject_SetAttr(__pyx_v_obj_template, __pyx_n_s___fieldnames, __pyx_v_field_names) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_obj_template, __pyx_n_s___fieldnames, __pyx_v_field_names) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":840 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":843 * obj_template = mio5p.mat_struct() * obj_template._fieldnames = field_names * result = np.empty(length, dtype=object) # <<<<<<<<<<<<<< * for i in range(length): * item = pycopy(obj_template) */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = ((PyArrayObject *)__pyx_t_6); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result); - __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_4 < 0)) { + __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_8 < 0)) { PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); @@ -6823,47 +7003,47 @@ } __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; - if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_result = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":841 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":844 * obj_template._fieldnames = field_names * result = np.empty(length, dtype=object) * for i in range(length): # <<<<<<<<<<<<<< * item = pycopy(obj_template) * for name in field_names: */ - __pyx_t_8 = __pyx_v_length; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_8; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; + __pyx_t_7 = __pyx_v_length; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":842 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":845 * result = np.empty(length, dtype=object) * for i in range(length): * item = pycopy(obj_template) # <<<<<<<<<<<<<< * for name in field_names: * item.__dict__[name] = self.read_mi_matrix() */ - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__pycopy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__pycopy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_obj_template); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_obj_template); __Pyx_GIVEREF(__pyx_v_obj_template); - __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_item); __pyx_v_item = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":843 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":846 * for i in range(length): * item = pycopy(obj_template) * for name in field_names: # <<<<<<<<<<<<<< @@ -6871,22 +7051,22 @@ * result[i] = item */ if (PyList_CheckExact(__pyx_v_field_names) || PyTuple_CheckExact(__pyx_v_field_names)) { - __pyx_t_7 = 0; __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = 0; __pyx_t_1 = __pyx_v_field_names; __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_field_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; } else { __pyx_t_2 = PyIter_Next(__pyx_t_1); if (!__pyx_t_2) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); @@ -6895,24 +7075,24 @@ __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":844 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":847 * item = pycopy(obj_template) * for name in field_names: * item.__dict__[name] = self.read_mi_matrix() # <<<<<<<<<<<<<< * result[i] = item * return result.reshape(tupdims).T */ - __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_v_item, __pyx_n_s____dict__); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetItem(__pyx_t_6, __pyx_v_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = PyObject_GetAttr(__pyx_v_item, __pyx_n_s____dict__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyObject_SetItem(__pyx_t_5, __pyx_v_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":845 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":848 * for name in field_names: * item.__dict__[name] = self.read_mi_matrix() * result[i] = item # <<<<<<<<<<<<<< @@ -6927,7 +7107,7 @@ } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_result)) __pyx_t_14 = 0; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_14); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result); __Pyx_GOTREF(*__pyx_t_15); @@ -6936,7 +7116,7 @@ __Pyx_GIVEREF(*__pyx_t_15); } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":846 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":849 * item.__dict__[name] = self.read_mi_matrix() * result[i] = item * return result.reshape(tupdims).T # <<<<<<<<<<<<<< @@ -6944,21 +7124,21 @@ * cpdef cnp.ndarray read_opaque(self, VarHeader5 hdr): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tupdims); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tupdims); __Pyx_GIVEREF(__pyx_v_tupdims); - __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; @@ -6969,7 +7149,7 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result); @@ -6989,14 +7169,12 @@ __Pyx_DECREF(__pyx_v_obj_template); __Pyx_DECREF(__pyx_v_item); __Pyx_DECREF(__pyx_v_name); - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF((PyObject *)__pyx_v_header); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":808 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":811 * return field_names * * cpdef cnp.ndarray read_struct(self, VarHeader5 header): # <<<<<<<<<<<<<< @@ -7010,9 +7188,9 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_struct"); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "header", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_struct(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_struct(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_header), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7030,7 +7208,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":848 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":851 * return result.reshape(tupdims).T * * cpdef cnp.ndarray read_opaque(self, VarHeader5 hdr): # <<<<<<<<<<<<<< @@ -7051,19 +7229,19 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__read_opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_opaque)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_hdr)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_hdr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_hdr)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7072,100 +7250,100 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":864 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":867 * See the comments at the beginning of ``mio5.py`` * ''' * cdef cnp.ndarray res = np.empty((1,), dtype=OPAQUE_DTYPE) # <<<<<<<<<<<<<< * res[0]['s0'] = self.read_int8_string() * res[0]['s1'] = self.read_int8_string() */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_res = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":865 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":868 * ''' * cdef cnp.ndarray res = np.empty((1,), dtype=OPAQUE_DTYPE) * res[0]['s0'] = self.read_int8_string() # <<<<<<<<<<<<<< * res[0]['s1'] = self.read_int8_string() * res[0]['s2'] = self.read_int8_string() */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s0), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s0), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":866 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":869 * cdef cnp.ndarray res = np.empty((1,), dtype=OPAQUE_DTYPE) * res[0]['s0'] = self.read_int8_string() * res[0]['s1'] = self.read_int8_string() # <<<<<<<<<<<<<< * res[0]['s2'] = self.read_int8_string() * res[0]['arr'] = self.read_mi_matrix() */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s1), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s1), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":867 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":870 * res[0]['s0'] = self.read_int8_string() * res[0]['s1'] = self.read_int8_string() * res[0]['s2'] = self.read_int8_string() # <<<<<<<<<<<<<< * res[0]['arr'] = self.read_mi_matrix() * return res */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_int8_string(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s2), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s2), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":868 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":871 * res[0]['s1'] = self.read_int8_string() * res[0]['s2'] = self.read_int8_string() * res[0]['arr'] = self.read_mi_matrix() # <<<<<<<<<<<<<< * return res */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->read_mi_matrix(__pyx_v_self, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_res), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__arr), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__arr), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":869 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":872 * res[0]['s2'] = self.read_int8_string() * res[0]['arr'] = self.read_mi_matrix() * return res # <<<<<<<<<<<<<< @@ -7191,7 +7369,7 @@ return __pyx_r; } -/* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":848 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":851 * return result.reshape(tupdims).T * * cpdef cnp.ndarray read_opaque(self, VarHeader5 hdr): # <<<<<<<<<<<<<< @@ -7205,9 +7383,9 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("read_opaque"); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hdr), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "hdr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hdr), __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5, 1, "hdr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_opaque(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_hdr), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self)->__pyx_vtab)->read_opaque(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_hdr), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7225,7 +7403,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":187 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -7233,8 +7411,8 @@ * # requirements, and does not yet fullfill the PEP. */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; @@ -7259,9 +7437,8 @@ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":193 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7270,7 +7447,7 @@ */ __pyx_v_endian_detector = 1; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":194 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7279,7 +7456,7 @@ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":196 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -7288,7 +7465,7 @@ */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":198 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -7298,7 +7475,7 @@ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":199 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -7310,7 +7487,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":201 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -7321,7 +7498,7 @@ } __pyx_L5:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":203 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":204 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -7331,7 +7508,7 @@ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":204 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":205 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -7345,29 +7522,29 @@ } if (__pyx_t_3) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":205 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":206 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_11)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_11)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_11)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":207 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":208 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -7377,7 +7554,7 @@ __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":208 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":209 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -7391,29 +7568,29 @@ } if (__pyx_t_2) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":209 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":210 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_12)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_12)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_12)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":211 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -7422,7 +7599,7 @@ */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":212 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -7431,17 +7608,16 @@ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":213 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. */ - __pyx_t_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":216 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -7450,7 +7626,7 @@ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":217 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -7459,7 +7635,7 @@ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":218 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -7470,7 +7646,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":219 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":220 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -7479,7 +7655,7 @@ */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":220 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -7492,7 +7668,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":222 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -7501,7 +7677,7 @@ */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":223 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -7512,7 +7688,7 @@ } __pyx_L8:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":224 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -7521,7 +7697,7 @@ */ __pyx_v_info->suboffsets = NULL; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":225 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -7530,7 +7706,7 @@ */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":226 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -7539,7 +7715,7 @@ */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":229 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -7548,7 +7724,7 @@ */ __pyx_v_f = NULL; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":230 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -7558,7 +7734,7 @@ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":234 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -7567,7 +7743,7 @@ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":236 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":237 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -7583,7 +7759,7 @@ } if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":238 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -7599,7 +7775,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":241 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -7614,7 +7790,7 @@ } __pyx_L11:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":243 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -7624,7 +7800,7 @@ __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":244 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -7633,7 +7809,7 @@ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":245 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -7648,7 +7824,7 @@ } if (!__pyx_t_2) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":246 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7668,29 +7844,29 @@ } if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":247 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_13)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":248 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":249 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -7703,7 +7879,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":249 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":250 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -7716,7 +7892,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":250 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":251 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -7729,7 +7905,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":251 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":252 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -7742,7 +7918,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":252 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":253 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -7755,7 +7931,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":253 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":254 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -7768,7 +7944,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":254 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":255 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -7781,7 +7957,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":255 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":256 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -7794,7 +7970,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":256 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":257 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -7807,7 +7983,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":257 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":258 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -7820,7 +7996,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":258 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":259 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -7833,7 +8009,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":259 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":260 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -7846,7 +8022,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":260 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":261 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -7859,7 +8035,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":261 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":262 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -7872,7 +8048,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":262 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":263 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -7885,7 +8061,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":263 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":264 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -7898,7 +8074,7 @@ goto __pyx_L14; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":264 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":265 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -7912,33 +8088,33 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":266 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":267 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -7947,7 +8123,7 @@ */ __pyx_v_info->format = __pyx_v_f; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":268 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -7960,7 +8136,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":270 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -7969,7 +8145,7 @@ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":271 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -7978,7 +8154,7 @@ */ (__pyx_v_info->format[0]) = '^'; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":272 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -7987,17 +8163,17 @@ */ __pyx_v_offset = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":275 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":276 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -8025,12 +8201,11 @@ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":278 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -8038,13 +8213,12 @@ * stdlib.free(info.format) */ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":279 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":280 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -8054,7 +8228,7 @@ __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":280 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -8066,7 +8240,7 @@ } __pyx_L5:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":281 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":282 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -8076,7 +8250,7 @@ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":282 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -8088,11 +8262,10 @@ } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":755 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -8105,7 +8278,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":756 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -8113,7 +8286,7 @@ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8131,7 +8304,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":758 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -8144,7 +8317,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":759 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -8152,7 +8325,7 @@ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8170,7 +8343,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":761 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -8183,7 +8356,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":762 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -8191,7 +8364,7 @@ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8209,7 +8382,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":764 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -8222,7 +8395,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":765 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -8230,7 +8403,7 @@ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8248,7 +8421,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":767 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -8261,7 +8434,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":768 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -8269,7 +8442,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -8287,7 +8460,7 @@ return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":770 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -8315,14 +8488,13 @@ int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":777 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -8331,7 +8503,7 @@ */ __pyx_v_endian_detector = 1; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":778 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -8340,7 +8512,7 @@ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":781 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -8350,7 +8522,7 @@ if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -8359,21 +8531,21 @@ __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":782 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":783 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -8383,7 +8555,7 @@ if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -8393,57 +8565,57 @@ __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":785 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":786 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_15)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_15)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_15)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":788 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -8458,7 +8630,7 @@ } if (!__pyx_t_7) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":789 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -8478,29 +8650,29 @@ } if (__pyx_t_6) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":790 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_13)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":800 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -8508,16 +8680,16 @@ * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":801 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -8526,7 +8698,7 @@ */ (__pyx_v_f[0]) = 120; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":802 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -8535,7 +8707,7 @@ */ __pyx_v_f += 1; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":803 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -8545,7 +8717,7 @@ (__pyx_v_offset[0]) += 1; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":805 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -8554,7 +8726,7 @@ */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":807 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -8564,20 +8736,20 @@ __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":808 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":809 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -8587,288 +8759,288 @@ __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":810 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_16)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_16)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_16)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":813 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":814 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":815 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":816 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":817 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":818 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":819 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":820 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":821 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":822 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":823 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":824 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":825 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":826 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -8877,19 +9049,19 @@ goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":827 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -8898,19 +9070,19 @@ goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":828 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -8919,19 +9091,19 @@ goto __pyx_L11; } - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":829 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -8939,30 +9111,30 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":831 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":832 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -8974,21 +9146,21 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":836 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":837 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -9013,12 +9185,11 @@ __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":952 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -9030,10 +9201,8 @@ PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":954 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -9043,7 +9212,7 @@ __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":955 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -9055,7 +9224,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":957 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -9064,7 +9233,7 @@ */ Py_INCREF(__pyx_v_base); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":958 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -9075,7 +9244,7 @@ } __pyx_L3:; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":959 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -9084,7 +9253,7 @@ */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":960 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -9093,12 +9262,10 @@ */ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":962 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -9110,9 +9277,8 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":963 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -9122,7 +9288,7 @@ __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":964 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -9137,7 +9303,7 @@ } /*else*/ { - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":966 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -9151,7 +9317,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -9198,15 +9363,41 @@ return 0; } -static struct PyMethodDef __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarHeader5[] = { +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_name(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(o); +} + +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_mclass(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(o); +} + +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_dims(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(o); +} + +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_is_global(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(o); +} + +static int __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_is_global(PyObject *o, PyObject *v, void *x) { + if (v) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarHeader5[] = { {0, 0, 0, 0} }; -static struct PyMemberDef __pyx_members_5scipy_2io_6matlab_10mio5_utils_VarHeader5[] = { - {(char *)"name", T_OBJECT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5, name), READONLY, 0}, - {(char *)"mclass", T_INT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5, mclass), READONLY, 0}, - {(char *)"dims", T_OBJECT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5, dims), READONLY, 0}, - {(char *)"is_global", T_INT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5, is_global), 0, 0}, +static struct PyGetSetDef __pyx_getsets_5scipy_2io_6matlab_10mio5_utils_VarHeader5[] = { + {(char *)"name", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_name, 0, 0, 0}, + {(char *)"mclass", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_mclass, 0, 0, 0}, + {(char *)"dims", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_dims, 0, 0, 0}, + {(char *)"is_global", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_is_global, __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_is_global, 0, 0}, {0, 0, 0, 0, 0} }; @@ -9234,10 +9425,10 @@ 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else 0, /*reserved*/ - #else - 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9263,7 +9454,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -9317,7 +9508,11 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_VarHeader5, /*tp_as_number*/ &__pyx_tp_as_sequence_VarHeader5, /*tp_as_sequence*/ @@ -9337,8 +9532,8 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarHeader5, /*tp_methods*/ - __pyx_members_5scipy_2io_6matlab_10mio5_utils_VarHeader5, /*tp_members*/ - 0, /*tp_getset*/ + 0, /*tp_members*/ + __pyx_getsets_5scipy_2io_6matlab_10mio5_utils_VarHeader5, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -9438,7 +9633,35 @@ return 0; } -static struct PyMethodDef __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarReader5[] = { +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_is_swapped(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___get__(o); +} + +static int __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_is_swapped(PyObject *o, PyObject *v, void *x) { + if (v) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_little_endian(PyObject *o, void *x) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___get__(o); +} + +static int __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_little_endian(PyObject *o, PyObject *v, void *x) { + if (v) { + return __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarReader5[] = { {__Pyx_NAMESTR("set_stream"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_set_stream, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_set_stream)}, {__Pyx_NAMESTR("read_tag"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_tag)}, {__Pyx_NAMESTR("read_numeric"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric)}, @@ -9454,9 +9677,9 @@ {0, 0, 0, 0} }; -static struct PyMemberDef __pyx_members_5scipy_2io_6matlab_10mio5_utils_VarReader5[] = { - {(char *)"is_swapped", T_INT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5, is_swapped), 0, 0}, - {(char *)"little_endian", T_INT, offsetof(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5, little_endian), 0, 0}, +static struct PyGetSetDef __pyx_getsets_5scipy_2io_6matlab_10mio5_utils_VarReader5[] = { + {(char *)"is_swapped", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_is_swapped, __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_is_swapped, 0, 0}, + {(char *)"little_endian", __pyx_getprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_little_endian, __pyx_setprop_5scipy_2io_6matlab_10mio5_utils_10VarReader5_little_endian, 0, 0}, {0, 0, 0, 0, 0} }; @@ -9484,10 +9707,10 @@ 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else 0, /*reserved*/ - #else - 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -9513,7 +9736,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -9567,7 +9790,11 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_VarReader5, /*tp_as_number*/ &__pyx_tp_as_sequence_VarReader5, /*tp_as_sequence*/ @@ -9587,8 +9814,8 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5scipy_2io_6matlab_10mio5_utils_VarReader5, /*tp_methods*/ - __pyx_members_5scipy_2io_6matlab_10mio5_utils_VarReader5, /*tp_members*/ - 0, /*tp_getset*/ + 0, /*tp_members*/ + __pyx_getsets_5scipy_2io_6matlab_10mio5_utils_VarReader5, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -9610,13 +9837,11 @@ #endif }; -static struct PyMethodDef __pyx_methods[] = { +static PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("byteswap_u4"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_10mio5_utils_byteswap_u4, METH_O, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -9646,9 +9871,9 @@ {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1}, {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1}, {&__pyx_n_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 1}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, + {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1}, {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0}, - {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, + {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0}, {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0}, {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0}, {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0}, @@ -9661,6 +9886,7 @@ {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0}, {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0}, {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0}, + {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, @@ -9675,6 +9901,7 @@ {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__T, __pyx_k__T, sizeof(__pyx_k__T), 0, 0, 1, 1}, {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, + {&__pyx_n_s__U, __pyx_k__U, sizeof(__pyx_k__U), 0, 0, 1, 1}, {&__pyx_n_s__U1_dtype, __pyx_k__U1_dtype, sizeof(__pyx_k__U1_dtype), 0, 0, 1, 1}, {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, {&__pyx_n_s__VarReader5, __pyx_k__VarReader5, sizeof(__pyx_k__VarReader5), 0, 0, 1, 1}, @@ -9685,10 +9912,11 @@ {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1}, {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1}, {&__pyx_n_s__array_from_header, __pyx_k__array_from_header, sizeof(__pyx_k__array_from_header), 0, 0, 1, 1}, + {&__pyx_n_s__asbytes, __pyx_k__asbytes, sizeof(__pyx_k__asbytes), 0, 0, 1, 1}, {&__pyx_n_s__ascii, __pyx_k__ascii, sizeof(__pyx_k__ascii), 0, 0, 1, 1}, + {&__pyx_n_s__asstr, __pyx_k__asstr, sizeof(__pyx_k__asstr), 0, 0, 1, 1}, {&__pyx_n_s__astype, __pyx_k__astype, sizeof(__pyx_k__astype), 0, 0, 1, 1}, {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1}, - {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1}, {&__pyx_n_s__bool, __pyx_k__bool, sizeof(__pyx_k__bool), 0, 0, 1, 1}, {&__pyx_n_s__bool_dtype, __pyx_k__bool_dtype, sizeof(__pyx_k__bool_dtype), 0, 0, 1, 1}, {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1}, @@ -9790,12 +10018,11 @@ {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_n_s__basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -9835,12 +10062,10 @@ } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_mio5_utils(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -9873,18 +10098,18 @@ __pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE = ((PyArray_Descr *)Py_None); Py_INCREF(Py_None); /*--- Function export code ---*/ /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarHeader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "VarHeader5", (PyObject *)&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarHeader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarHeader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "VarHeader5", (PyObject *)&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarHeader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5 = &__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarHeader5; __pyx_vtabptr_5scipy_2io_6matlab_10mio5_utils_VarReader5 = &__pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5; #if PY_MAJOR_VERSION >= 3 __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.cread_tag = (int (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, char *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_tag; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_element = (PyObject *(*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void **, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element; - __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_element_into = (void (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element_into; + __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_element_into = (int (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element_into; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_numeric = (PyArrayObject *(*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric *__pyx_optional_args))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_int8_string = (PyObject *(*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_int8_string; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_into_int32s = (int (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_int32_t *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_into_int32s; - __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.cread_full_tag = (void (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_full_tag; + __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.cread_full_tag = (int (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_full_tag; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_header = (struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *(*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_header; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.size_from_header = (size_t (*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_size_from_header; __pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_mi_matrix = (PyObject *(*)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix *__pyx_optional_args))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix; @@ -9916,25 +10141,26 @@ *(void(**)(void))&__pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_struct = (void(*)(void))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_struct; *(void(**)(void))&__pyx_vtable_5scipy_2io_6matlab_10mio5_utils_VarReader5.read_opaque = (void(*)(void))__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_opaque; #endif - if (PyType_Ready(&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5.tp_dict, __pyx_vtabptr_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "VarReader5", (PyObject *)&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5.tp_dict, __pyx_vtabptr_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "VarReader5", (PyObject *)&__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarReader5 = &__pyx_type_5scipy_2io_6matlab_10mio5_utils_VarReader5; /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream = __Pyx_ImportType("scipy.io.matlab.streams", "GenericStream", sizeof(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream), 1); if (unlikely(!__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_GetVtable(__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream->tp_dict, &__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream = __Pyx_ImportType("scipy.io.matlab.streams", "GenericStream", sizeof(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream), 1); if (unlikely(!__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_GetVtable(__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream->tp_dict, &__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("scipy.io.matlab.streams"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ImportFunction(__pyx_t_1, "make_stream", (void (**)(void))&__pyx_f_5scipy_2io_6matlab_7streams_make_stream, "struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *(PyObject *, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":15 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":15 * ''' * * import sys # <<<<<<<<<<<<<< @@ -9946,12 +10172,12 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":17 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":17 * import sys * * from copy import copy as pycopy # <<<<<<<<<<<<<< * - * from python cimport Py_INCREF, Py_DECREF + * from cpython cimport Py_INCREF, Py_DECREF */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); @@ -9967,19 +10193,47 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":29 - * PyString_FromStringAndSize + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":29 + * PyBytes_FromStringAndSize * * import numpy as np # <<<<<<<<<<<<<< + * from numpy.compat import asbytes, asstr * cimport numpy as cnp - * */ __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":48 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":30 + * + * import numpy as np + * from numpy.compat import asbytes, asstr # <<<<<<<<<<<<<< + * cimport numpy as cnp + * + */ + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__asbytes)); + PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__asbytes)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asbytes)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__asstr)); + PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__asstr)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__asstr)); + __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_18), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__asbytes, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asstr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__asstr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":49 * # Numpy must be initialized before any code using the numpy C-API * # directly * cnp.import_array() # <<<<<<<<<<<<<< @@ -9988,120 +10242,111 @@ */ import_array(); - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":58 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":59 * * cimport streams * import scipy.io.matlab.miobase as miob # <<<<<<<<<<<<<< * from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings * import scipy.io.matlab.mio5_params as mio5p */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_n_s_19)); - PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s_19)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_18), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__miob, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_n_s_20)); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s_20)); + __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_19), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__miob, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":59 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":60 * cimport streams * import scipy.io.matlab.miobase as miob * from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings # <<<<<<<<<<<<<< * import scipy.io.matlab.mio5_params as mio5p * import scipy.sparse */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_n_s__squeeze_element)); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__squeeze_element)); + PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__squeeze_element)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__squeeze_element)); __Pyx_INCREF(((PyObject *)__pyx_n_s__chars_to_strings)); - PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__chars_to_strings)); + PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__chars_to_strings)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chars_to_strings)); - __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_20), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_21), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__squeeze_element); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__squeeze_element); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__squeeze_element, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__squeeze_element, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__chars_to_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chars_to_strings, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__chars_to_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chars_to_strings, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":60 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":61 * import scipy.io.matlab.miobase as miob * from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings * import scipy.io.matlab.mio5_params as mio5p # <<<<<<<<<<<<<< * import scipy.sparse * */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_n_s_19)); - PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s_19)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_21), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__mio5p, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_n_s_20)); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s_20)); + __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_22), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__mio5p, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":61 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":62 * from scipy.io.matlab.mio_utils import squeeze_element, chars_to_strings * import scipy.io.matlab.mio5_params as mio5p * import scipy.sparse # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_22), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__scipy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s_23), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__scipy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":101 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":102 * mxOBJECT_CLASS_FROM_MATRIX_H = 18 * * sys_is_le = sys.byteorder == 'little' # <<<<<<<<<<<<<< * native_code = sys_is_le and '<' or '>' * swapped_code = sys_is_le and '>' or '<' */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__byteorder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__byteorder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__little), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__little), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys_is_le, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys_is_le, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":102 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":103 * * sys_is_le = sys.byteorder == 'little' * native_code = sys_is_le and '<' or '>' # <<<<<<<<<<<<<< * swapped_code = sys_is_le and '>' or '<' * */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - __pyx_t_3 = __pyx_kp_s_23; - } else { - __pyx_t_3 = __pyx_t_2; - __pyx_t_2 = 0; - } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_4) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); __pyx_t_2 = __pyx_kp_s_24; @@ -10109,20 +10354,38 @@ __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__native_code, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); + __pyx_t_3 = __pyx_kp_s_25; + } else { + __pyx_t_3 = __pyx_t_2; + __pyx_t_2 = 0; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__native_code, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":103 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":104 * sys_is_le = sys.byteorder == 'little' * native_code = sys_is_le and '<' or '>' * swapped_code = sys_is_le and '>' or '<' # <<<<<<<<<<<<<< * * cdef cnp.dtype OPAQUE_DTYPE = mio5p.OPAQUE_DTYPE */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); + __pyx_t_2 = __pyx_kp_s_25; + } else { + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_4) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); __pyx_t_3 = __pyx_kp_s_24; @@ -10130,168 +10393,159 @@ __pyx_t_3 = __pyx_t_2; __pyx_t_2 = 0; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_4) { - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - __pyx_t_2 = __pyx_kp_s_23; - } else { - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__swapped_code, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__swapped_code, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":105 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":106 * swapped_code = sys_is_le and '>' or '<' * * cdef cnp.dtype OPAQUE_DTYPE = mio5p.OPAQUE_DTYPE # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__OPAQUE_DTYPE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__OPAQUE_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE)); __Pyx_DECREF(((PyObject *)__pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE)); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE = ((PyArray_Descr *)__pyx_t_2); + __pyx_t_2 = 0; - /* "/home/mb312/scipybuild/scipy/scipy/io/matlab/mio5_utils.pyx":1 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio5_utils.pyx":1 * ''' Cython mio5 utility routines (-*- python -*- like) # <<<<<<<<<<<<<< * * ''' */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__set_stream); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_25), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_26), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_26), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_27), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_numeric); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_27), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_full_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_28), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_full_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_28), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_29), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_29), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array_from_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_30), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array_from_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_30), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_real_complex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_31), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_real_complex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_char); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_32), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_char); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_32), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_cells); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_33), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_cells); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_33), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_fieldnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_34), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_fieldnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_34), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_struct); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_35), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_struct); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_35), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__read_opaque); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_36), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__VarReader5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__read_opaque); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_5, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_kp_u_37), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "/home/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/python_type.pxd":2 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/cpython/type.pxd":2 * * cdef extern from "Python.h": # <<<<<<<<<<<<<< * # The C structure of the objects used to describe built-in types. @@ -10318,16 +10572,14 @@ #endif } -static const char *__pyx_filenames[] = { - "mio5_utils.pyx", - "numpy.pxd", - "streams.pxd", -}; - /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } static void __Pyx_RaiseDoubleKeywordsError( @@ -10462,8 +10714,13 @@ (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif } static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { @@ -10476,11 +10733,11 @@ return item; } -static int __Pyx_EndUnpack(PyObject *iter) { +static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(expected); return -1; } else if (!PyErr_Occurred()) @@ -10501,7 +10758,40 @@ return 0; } +static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { + long r = a % b; + r += ((r != 0) & ((r ^ b) < 0)) * b; + return r; +} +static CYTHON_INLINE long __Pyx_div_long(long a, long b) { + long q = a / b; + long r = a - q*b; + q -= ((r != 0) & ((r ^ b) < 0)); + return q; +} + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + + static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { unsigned int n = 1; return *(unsigned char*)(&n) != 0; @@ -10907,7 +11197,7 @@ buf->suboffsets = __Pyx_minusones; } -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -11001,30 +11291,10 @@ } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(index); } } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { #if PY_VERSION_HEX >= 0x02060000 @@ -11050,14 +11320,14 @@ #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -11073,38 +11343,37 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32 val) { - const npy_uint32 neg_one = (npy_uint32)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(npy_uint32) < sizeof(long)) { + const npy_uint32 neg_one = (npy_uint32)-1, const_zero = (npy_uint32)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(npy_uint32) == sizeof(char)) || + (sizeof(npy_uint32) == sizeof(short))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_uint32) == sizeof(long)) { + } else if ((sizeof(npy_uint32) == sizeof(int)) || + (sizeof(npy_uint32) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_uint32) > sizeof(long)) */ + } else if (sizeof(npy_uint32) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(npy_uint32), + little, !is_unsigned); } } @@ -11219,20 +11488,27 @@ #endif static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32 val) { - const npy_int32 neg_one = (npy_int32)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(npy_int32) < sizeof(long)) { + const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(npy_int32) == sizeof(char)) || + (sizeof(npy_int32) == sizeof(short))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_int32) == sizeof(long)) { + } else if ((sizeof(npy_int32) == sizeof(int)) || + (sizeof(npy_int32) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_int32) > sizeof(long)) */ + } else if (sizeof(npy_int32) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(npy_int32), + little, !is_unsigned); } } @@ -11557,6 +11833,25 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -11768,8 +12063,8 @@ } static CYTHON_INLINE npy_uint32 __Pyx_PyInt_from_py_npy_uint32(PyObject* x) { - const npy_uint32 neg_one = (npy_uint32)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; + const npy_uint32 neg_one = (npy_uint32)-1, const_zero = (npy_uint32)0; + const int is_unsigned = const_zero < neg_one; if (sizeof(npy_uint32) == sizeof(char)) { if (is_unsigned) return (npy_uint32)__Pyx_PyInt_AsUnsignedChar(x); @@ -11795,42 +12090,35 @@ return (npy_uint32)__Pyx_PyInt_AsUnsignedLongLong(x); else return (npy_uint32)__Pyx_PyInt_AsSignedLongLong(x); -#if 0 - } else if (sizeof(npy_uint32) > sizeof(short) && - sizeof(npy_uint32) < sizeof(int)) { /* __int32 ILP64 ? */ - if (is_unsigned) - return (npy_uint32)__Pyx_PyInt_AsUnsignedInt(x); - else - return (npy_uint32)__Pyx_PyInt_AsSignedInt(x); -#endif + } else { + npy_uint32 val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_VERSION_HEX < 0x03000000 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (npy_uint32)-1; } - PyErr_SetString(PyExc_TypeError, "npy_uint32"); - return (npy_uint32)-1; } -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#else - PyObject *ob = PyCapsule_New(vtable, 0, 0); #endif if (!ob) goto bad; @@ -11880,7 +12168,11 @@ PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -11922,10 +12214,10 @@ PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__"); if (!ob) goto bad; -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); +#else *(void **)vtabptr = PyCObject_AsVoidPtr(ob); -#else - *(void **)vtabptr = PyCapsule_GetPointer(ob, 0); #endif if (!*(void **)vtabptr) goto bad; @@ -11945,9 +12237,6 @@ void (*fp)(void); void *p; } tmp; -#if PY_VERSION_HEX < 0x03010000 - const char *desc, *s1, *s2; -#endif d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) @@ -11959,7 +12248,16 @@ PyModule_GetName(module), funcname); goto bad; } -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %s.%s has wrong signature (expected %s, got %s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; @@ -11971,15 +12269,7 @@ PyModule_GetName(module), funcname, sig, desc); goto bad; } - tmp.p = PyCObject_AsVoidPtr(cobj); -#else - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %s.%s has wrong signature (expected %s, got %s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); + tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) @@ -12095,8 +12385,8 @@ /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } Modified: trunk/scipy/io/matlab/mio_utils.c =================================================================== --- trunk/scipy/io/matlab/mio_utils.c 2010-09-12 01:02:35 UTC (rev 6768) +++ trunk/scipy/io/matlab/mio_utils.c 2010-09-12 01:02:58 UTC (rev 6769) @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Wed Jun 16 17:30:35 2010 */ +/* Generated by Cython 0.13 on Sat Sep 11 22:33:02 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,13 +103,37 @@ #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif +#ifndef PySet_CheckExact +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -103,32 +148,25 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif + + +#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -146,112 +184,63 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include #define __PYX_HAVE_API__scipy__io__matlab__mio_utils -#include "stdlib.h" #include "stdio.h" +#include "stdlib.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +/* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif +/* unused attribute */ +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || defined(__INTEL_COMPILER) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -261,7 +250,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -281,7 +270,6 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -307,6 +295,11 @@ #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "mio_utils.pyx", + "numpy.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -421,7 +414,9 @@ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; @@ -431,11 +426,11 @@ } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -448,14 +443,14 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -468,15 +463,15 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -490,33 +485,28 @@ r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); - #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -621,6 +611,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -642,14 +634,16 @@ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_buffer */ +/* Module declarations from cpython.buffer */ -/* Module declarations from python_ref */ +/* Module declarations from cpython.ref */ -/* Module declarations from stdlib */ +/* Module declarations from libc.stdio */ -/* Module declarations from stdio */ +/* Module declarations from cpython.object */ +/* Module declarations from libc.stdlib */ + /* Module declarations from numpy */ /* Module declarations from numpy */ @@ -783,7 +777,7 @@ static PyObject *__pyx_n_s__view; static PyObject *__pyx_int_15; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":9 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":9 * * * cpdef size_t cproduct(tup): # <<<<<<<<<<<<<< @@ -801,9 +795,8 @@ PyObject *__pyx_t_3 = NULL; size_t __pyx_t_4; __Pyx_RefNannySetupContext("cproduct"); - __Pyx_INCREF(__pyx_v_tup); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":10 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":10 * * cpdef size_t cproduct(tup): * cdef size_t res = 1 # <<<<<<<<<<<<<< @@ -812,7 +805,7 @@ */ __pyx_v_res = 1; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":12 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":12 * cdef size_t res = 1 * cdef int i * for i in range(len(tup)): # <<<<<<<<<<<<<< @@ -823,7 +816,7 @@ for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":13 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":13 * cdef int i * for i in range(len(tup)): * res *= tup[i] # <<<<<<<<<<<<<< @@ -837,7 +830,7 @@ __pyx_v_res *= __pyx_t_4; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":14 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":14 * for i in range(len(tup)): * res *= tup[i] * return res # <<<<<<<<<<<<<< @@ -854,12 +847,11 @@ __Pyx_WriteUnraisable("scipy.io.matlab.mio_utils.cproduct"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_tup); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":9 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":9 * * * cpdef size_t cproduct(tup): # <<<<<<<<<<<<<< @@ -892,7 +884,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":17 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":17 * * * cpdef object squeeze_element(cnp.ndarray arr): # <<<<<<<<<<<<<< @@ -912,7 +904,7 @@ __Pyx_RefNannySetupContext("squeeze_element"); __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":22 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":22 * The returned object may not be an ndarray - for example if we do * ``arr.item`` to return a ``mat_struct`` object from a struct array ''' * if not arr.size: # <<<<<<<<<<<<<< @@ -926,7 +918,7 @@ __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":23 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":23 * ``arr.item`` to return a ``mat_struct`` object from a struct array ''' * if not arr.size: * return np.array([]) # <<<<<<<<<<<<<< @@ -957,7 +949,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":24 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":24 * if not arr.size: * return np.array([]) * arr = np.squeeze(arr) # <<<<<<<<<<<<<< @@ -983,7 +975,7 @@ __pyx_v_arr = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":25 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":25 * return np.array([]) * arr = np.squeeze(arr) * if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar # <<<<<<<<<<<<<< @@ -1005,7 +997,7 @@ } if (__pyx_t_6) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":26 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":26 * arr = np.squeeze(arr) * if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar * return arr.item() # <<<<<<<<<<<<<< @@ -1025,7 +1017,7 @@ } __pyx_L4:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":27 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":27 * if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar * return arr.item() * return arr # <<<<<<<<<<<<<< @@ -1052,7 +1044,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":17 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":17 * * * cpdef object squeeze_element(cnp.ndarray arr): # <<<<<<<<<<<<<< @@ -1087,7 +1079,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":30 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":30 * * * cpdef cnp.ndarray chars_to_strings(in_arr): # <<<<<<<<<<<<<< @@ -1108,10 +1100,9 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("chars_to_strings"); - __Pyx_INCREF(__pyx_v_in_arr); __pyx_v_new_dt_str = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":44 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":44 * ``arr`` * ''' * cdef cnp.ndarray arr = in_arr # <<<<<<<<<<<<<< @@ -1122,7 +1113,7 @@ __Pyx_INCREF(__pyx_v_in_arr); __pyx_v_arr = ((PyArrayObject *)__pyx_v_in_arr); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":45 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":45 * ''' * cdef cnp.ndarray arr = in_arr * cdef int ndim = arr.ndim # <<<<<<<<<<<<<< @@ -1131,7 +1122,7 @@ */ __pyx_v_ndim = __pyx_v_arr->nd; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":46 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":46 * cdef cnp.ndarray arr = in_arr * cdef int ndim = arr.ndim * cdef cnp.npy_intp *dims = arr.shape # <<<<<<<<<<<<<< @@ -1140,7 +1131,7 @@ */ __pyx_v_dims = __pyx_v_arr->dimensions; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":47 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":47 * cdef int ndim = arr.ndim * cdef cnp.npy_intp *dims = arr.shape * cdef cnp.npy_intp last_dim = dims[ndim-1] # <<<<<<<<<<<<<< @@ -1149,7 +1140,7 @@ */ __pyx_v_last_dim = (__pyx_v_dims[(__pyx_v_ndim - 1)]); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":49 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":49 * cdef cnp.npy_intp last_dim = dims[ndim-1] * cdef object new_dt_str * if last_dim == 0: # deal with empty array case # <<<<<<<<<<<<<< @@ -1159,7 +1150,7 @@ __pyx_t_1 = (__pyx_v_last_dim == 0); if (__pyx_t_1) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":50 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":50 * cdef object new_dt_str * if last_dim == 0: # deal with empty array case * new_dt_str = arr.dtype.str # <<<<<<<<<<<<<< @@ -1178,7 +1169,7 @@ } /*else*/ { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":52 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":52 * new_dt_str = arr.dtype.str * else: # make new dtype string with N appended * new_dt_str = arr.dtype.str[:-1] + str(last_dim) # <<<<<<<<<<<<<< @@ -1193,7 +1184,7 @@ __pyx_t_3 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_last_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_last_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -1213,7 +1204,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":54 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":54 * new_dt_str = arr.dtype.str[:-1] + str(last_dim) * # Copy to deal with F ordered arrays * arr = np.ascontiguousarray(arr) # <<<<<<<<<<<<<< @@ -1239,7 +1230,7 @@ __pyx_v_arr = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":55 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":55 * # Copy to deal with F ordered arrays * arr = np.ascontiguousarray(arr) * arr = arr.view(new_dt_str) # <<<<<<<<<<<<<< @@ -1261,7 +1252,7 @@ __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":56 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":56 * arr = np.ascontiguousarray(arr) * arr = arr.view(new_dt_str) * return arr.reshape(in_arr.shape[:-1]) # <<<<<<<<<<<<<< @@ -1299,13 +1290,12 @@ __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_arr); __Pyx_DECREF(__pyx_v_new_dt_str); - __Pyx_DECREF(__pyx_v_in_arr); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":30 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":30 * * * cpdef cnp.ndarray chars_to_strings(in_arr): # <<<<<<<<<<<<<< @@ -1339,7 +1329,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":187 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":188 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -1347,8 +1337,8 @@ * # requirements, and does not yet fullfill the PEP. */ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; @@ -1373,9 +1363,8 @@ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":193 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":194 * # of flags * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -1384,7 +1373,7 @@ */ __pyx_v_endian_detector = 1; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":194 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":195 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -1393,7 +1382,7 @@ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":196 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":197 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -1402,7 +1391,7 @@ */ __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self)); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":198 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":199 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -1412,7 +1401,7 @@ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":199 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":200 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -1424,7 +1413,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":201 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":202 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -1435,7 +1424,7 @@ } __pyx_L5:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":203 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":204 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -1445,7 +1434,7 @@ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":204 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":205 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -1459,29 +1448,29 @@ } if (__pyx_t_3) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":205 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":206 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_1)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_1)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":207 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":208 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -1491,7 +1480,7 @@ __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); if (__pyx_t_3) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":208 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":209 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -1505,29 +1494,29 @@ } if (__pyx_t_2) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":209 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":210 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_2)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_2)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":211 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":212 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -1536,7 +1525,7 @@ */ __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self)); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":212 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":213 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -1545,17 +1534,16 @@ */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":213 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":214 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. */ - __pyx_t_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":216 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":217 * # Allocate new buffer for strides and shape info. This is allocated * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -1564,7 +1552,7 @@ */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":217 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":218 * # as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -1573,7 +1561,7 @@ */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":218 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":219 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -1584,7 +1572,7 @@ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":219 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":220 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -1593,7 +1581,7 @@ */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":220 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":221 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -1606,7 +1594,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":222 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":223 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -1615,7 +1603,7 @@ */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":223 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":224 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -1626,7 +1614,7 @@ } __pyx_L8:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":224 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":225 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -1635,7 +1623,7 @@ */ __pyx_v_info->suboffsets = NULL; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":225 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":226 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -1644,7 +1632,7 @@ */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self)); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":226 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":227 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -1653,7 +1641,7 @@ */ __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self))); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":229 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":230 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -1662,7 +1650,7 @@ */ __pyx_v_f = NULL; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":230 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":231 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -1672,7 +1660,7 @@ __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr)); __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":234 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":235 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -1681,7 +1669,7 @@ */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":236 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":237 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -1697,7 +1685,7 @@ } if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":238 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":239 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -1713,7 +1701,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":241 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":242 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -1728,7 +1716,7 @@ } __pyx_L11:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":243 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":244 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -1738,7 +1726,7 @@ __pyx_t_1 = (!__pyx_v_hasfields); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":244 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":245 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -1747,7 +1735,7 @@ */ __pyx_v_t = __pyx_v_descr->type_num; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":245 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":246 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -1762,7 +1750,7 @@ } if (!__pyx_t_2) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":246 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":247 * t = descr.type_num * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -1782,29 +1770,29 @@ } if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":247 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":248 * if ((descr.byteorder == '>' and little_endian) or * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":248 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":249 * (descr.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -1817,7 +1805,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":249 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":250 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -1830,7 +1818,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":250 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":251 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -1843,7 +1831,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":251 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":252 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -1856,7 +1844,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":252 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":253 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -1869,7 +1857,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":253 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":254 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -1882,7 +1870,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":254 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":255 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -1895,7 +1883,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":255 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":256 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -1908,7 +1896,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":256 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":257 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -1921,7 +1909,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":257 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":258 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -1934,7 +1922,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":258 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":259 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -1947,7 +1935,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":259 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":260 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -1960,7 +1948,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":260 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":261 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -1973,7 +1961,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":261 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":262 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -1986,7 +1974,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":262 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":263 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -1999,7 +1987,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":263 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":264 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -2012,7 +2000,7 @@ goto __pyx_L14; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":264 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":265 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -2026,33 +2014,33 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":266 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":267 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * info.format = f * return */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":267 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":268 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -2061,7 +2049,7 @@ */ __pyx_v_info->format = __pyx_v_f; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":268 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":269 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -2074,7 +2062,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":270 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":271 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -2083,7 +2071,7 @@ */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":271 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":272 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -2092,7 +2080,7 @@ */ (__pyx_v_info->format[0]) = '^'; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":272 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":273 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = '^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -2101,17 +2089,17 @@ */ __pyx_v_offset = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":275 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":276 * f = _util_dtypestring(descr, info.format + 1, * info.format + _buffer_format_string_len, * &offset) # <<<<<<<<<<<<<< * f[0] = 0 # Terminate format string * */ - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":276 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":277 * info.format + _buffer_format_string_len, * &offset) * f[0] = 0 # Terminate format string # <<<<<<<<<<<<<< @@ -2139,12 +2127,11 @@ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":278 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":279 * f[0] = 0 # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -2152,13 +2139,12 @@ * stdlib.free(info.format) */ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":279 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":280 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -2168,7 +2154,7 @@ __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":280 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":281 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -2180,7 +2166,7 @@ } __pyx_L5:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":281 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":282 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2190,7 +2176,7 @@ __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":282 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":283 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -2202,11 +2188,10 @@ } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":755 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":756 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -2219,7 +2204,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1"); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":756 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":757 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -2227,7 +2212,7 @@ * cdef inline object PyArray_MultiIterNew2(a, b): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2245,7 +2230,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":758 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":759 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -2258,7 +2243,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2"); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":759 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":760 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -2266,7 +2251,7 @@ * cdef inline object PyArray_MultiIterNew3(a, b, c): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2284,7 +2269,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":761 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":762 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -2297,7 +2282,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3"); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":762 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":763 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -2305,7 +2290,7 @@ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2323,7 +2308,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":764 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":765 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -2336,7 +2321,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4"); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":765 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":766 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -2344,7 +2329,7 @@ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2362,7 +2347,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":767 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":768 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -2375,7 +2360,7 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5"); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":768 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":769 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -2383,7 +2368,7 @@ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2401,7 +2386,7 @@ return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":770 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":771 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -2429,14 +2414,13 @@ int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None); __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":777 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":778 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2445,7 +2429,7 @@ */ __pyx_v_endian_detector = 1; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":778 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":779 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -2454,7 +2438,7 @@ */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":781 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":782 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -2464,7 +2448,7 @@ if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -2473,21 +2457,21 @@ __pyx_v_childname = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":782 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":783 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< * child, new_offset = fields * */ - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":783 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":784 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -2497,7 +2481,7 @@ if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -2507,57 +2491,57 @@ __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":785 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":786 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * */ - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":786 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":787 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == '>' and little_endian) or */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_5)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":788 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":789 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<< @@ -2572,7 +2556,7 @@ } if (!__pyx_t_7) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":789 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":790 * * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<< @@ -2592,29 +2576,29 @@ } if (__pyx_t_6) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":790 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":791 * if ((child.byteorder == '>' and little_endian) or * (child.byteorder == '<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":800 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":801 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -2622,16 +2606,16 @@ * f += 1 */ while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":801 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":802 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -2640,7 +2624,7 @@ */ (__pyx_v_f[0]) = 120; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":802 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":803 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -2649,7 +2633,7 @@ */ __pyx_v_f += 1; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":803 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":804 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -2659,7 +2643,7 @@ (__pyx_v_offset[0]) += 1; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":805 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":806 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -2668,7 +2652,7 @@ */ (__pyx_v_offset[0]) += __pyx_v_child->elsize; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":807 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":808 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -2678,20 +2662,20 @@ __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child)); if (__pyx_t_6) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":808 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":809 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":809 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":810 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -2701,288 +2685,288 @@ __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5); if (__pyx_t_6) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":810 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":811 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_6)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_6)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":813 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":814 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" */ - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":814 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":815 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" */ - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":815 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":816 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" */ - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":816 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":817 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" */ - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":817 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":818 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" */ - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":818 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":819 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" */ - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":819 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":820 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":820 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":821 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":821 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":822 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":822 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":823 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" */ - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":823 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":824 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" */ - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":824 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":825 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf */ - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":825 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":826 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd */ - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":826 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":827 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg */ - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -2991,19 +2975,19 @@ goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":827 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":828 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" */ - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3012,19 +2996,19 @@ goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":828 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":829 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: */ - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -3033,19 +3017,19 @@ goto __pyx_L11; } - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":829 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":830 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) */ - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -3053,30 +3037,30 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":831 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":832 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< * f += 1 * else: */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":832 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":833 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -3088,21 +3072,21 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":836 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":837 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< * return f * */ - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":837 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":838 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -3127,12 +3111,11 @@ __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":952 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":953 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -3144,10 +3127,8 @@ PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":954 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":955 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -3157,7 +3138,7 @@ __pyx_t_1 = (__pyx_v_base == Py_None); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":955 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":956 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -3169,7 +3150,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":957 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":958 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -3178,7 +3159,7 @@ */ Py_INCREF(__pyx_v_base); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":958 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":959 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -3189,7 +3170,7 @@ } __pyx_L3:; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":959 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":960 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -3198,7 +3179,7 @@ */ Py_XDECREF(__pyx_v_arr->base); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":960 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":961 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -3207,12 +3188,10 @@ */ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } -/* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":962 +/* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":963 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -3224,9 +3203,8 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":963 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":964 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -3236,7 +3214,7 @@ __pyx_t_1 = (__pyx_v_arr->base == NULL); if (__pyx_t_1) { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":964 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":965 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -3251,7 +3229,7 @@ } /*else*/ { - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":966 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":967 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -3265,21 +3243,18 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct PyMethodDef __pyx_methods[] = { +static PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("cproduct"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_9mio_utils_cproduct, METH_O, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("squeeze_element"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_9mio_utils_squeeze_element, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_9mio_utils_squeeze_element)}, {__Pyx_NAMESTR("chars_to_strings"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_9mio_utils_chars_to_strings, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_9mio_utils_chars_to_strings)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -3341,8 +3316,8 @@ }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -3378,12 +3353,10 @@ } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_mio_utils(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -3416,15 +3389,15 @@ /*--- Function export code ---*/ /*--- Type init code ---*/ /*--- Type import code ---*/ - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":5 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":5 * ''' * * import numpy as np # <<<<<<<<<<<<<< @@ -3436,7 +3409,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/mio_utils.pyx":1 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/mio_utils.pyx":1 * # -*- python -*- like file # <<<<<<<<<<<<<< * ''' Utilities for generic processing of return arrays from read * ''' @@ -3445,14 +3418,14 @@ __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__squeeze_element); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_8), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__chars_to_strings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_9), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3460,11 +3433,12 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "/Users/mb312/usr/local/lib/python2.6/site-packages/Cython/Includes/stdlib.pxd":2 + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/numpy.pxd":963 + * arr.base = baseptr * - * cdef extern from "stdlib.h" nogil: # <<<<<<<<<<<<<< - * void free(void *ptr) - * void *malloc(size_t size) + * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< + * if arr.base is NULL: + * return None */ goto __pyx_L0; __pyx_L1_error:; @@ -3486,15 +3460,14 @@ #endif } -static const char *__pyx_filenames[] = { - "mio_utils.pyx", - "numpy.pxd", -}; - /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } @@ -3510,6 +3483,30 @@ return 0; } +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 @@ -3520,76 +3517,34 @@ (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif } -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } - } - return item; -} - -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; -} - -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(index); } } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -3605,38 +3560,37 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { - const npy_intp neg_one = (npy_intp)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(npy_intp) < sizeof(long)) { +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { + const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(Py_intptr_t) == sizeof(char)) || + (sizeof(Py_intptr_t) == sizeof(short))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_intp) == sizeof(long)) { + } else if ((sizeof(Py_intptr_t) == sizeof(int)) || + (sizeof(Py_intptr_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { /* (sizeof(npy_intp) > sizeof(long)) */ + } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); } } @@ -4098,6 +4052,25 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -4363,7 +4336,11 @@ PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -4504,8 +4481,8 @@ /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } Modified: trunk/scipy/io/matlab/streams.c =================================================================== --- trunk/scipy/io/matlab/streams.c 2010-09-12 01:02:35 UTC (rev 6768) +++ trunk/scipy/io/matlab/streams.c 2010-09-12 01:02:58 UTC (rev 6769) @@ -1,18 +1,39 @@ -/* Generated by Cython 0.12.1 on Wed Jun 16 17:30:36 2010 */ +/* Generated by Cython 0.13 on Sat Sep 11 22:33:10 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include /* For offsetof */ +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,13 +103,37 @@ #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif +#ifndef PySet_CheckExact +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -103,32 +148,25 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif + + +#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -146,111 +184,63 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include #define __PYX_HAVE_API__scipy__io__matlab__streams +#include "stdio.h" +#include "pythread.h" #include "stdlib.h" -#include "fileobject.h" -#include "cStringIO.h" +#include "py3k.h" +/* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif +/* unused attribute */ +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || defined(__INTEL_COMPILER) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -260,7 +250,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -280,12 +270,17 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; +static const char *__pyx_f[] = { + "streams.pyx", + "pyalloc.pxd", + "bool.pxd", +}; + /* Type declarations */ -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":6 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":6 * cdef object fobj * * cpdef int seek(self, long int offset, int whence=*) except -1 # <<<<<<<<<<<<<< @@ -298,7 +293,7 @@ int whence; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":9 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":9 * cpdef long int tell(self) except -1 * cdef int read_into(self, void *buf, size_t n) except -1 * cdef object read_string(self, size_t n, void **pp, int copy=*) # <<<<<<<<<<<<<< @@ -311,7 +306,7 @@ int copy; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":89 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":89 * cdef class cStringStream(GenericStream): * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< @@ -324,11 +319,11 @@ int whence; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":109 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":109 * return 0 * * cdef object read_string(self, size_t n, void **pp, int copy=True): # <<<<<<<<<<<<<< - * ''' Make new memory, wrap with object + * """ Make new memory, wrap with object * */ @@ -337,12 +332,12 @@ int copy; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":132 - * self.file = PyFile_AsFile(fobj) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":135 + * npy_PyFile_DupClose(self.fobj, self.file) * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< * cdef int ret - * ''' move `offset` bytes in stream + * """ move `offset` bytes in stream */ struct __pyx_opt_args_5scipy_2io_6matlab_7streams_10FileStream_seek { @@ -350,11 +345,11 @@ int whence; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":173 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":176 * return 0 * * cdef object read_string(self, size_t n, void **pp, int copy=True): # <<<<<<<<<<<<<< - * ''' Make new memory, wrap with object ''' + * """ Make new memory, wrap with object """ * cdef object obj = pyalloc_v(n, pp) */ @@ -363,7 +358,7 @@ int copy; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":3 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pxd":3 * # -*- python -*- or rather like * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -377,7 +372,7 @@ PyObject *fobj; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":87 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":87 * * * cdef class cStringStream(GenericStream): # <<<<<<<<<<<<<< @@ -389,7 +384,7 @@ struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream __pyx_base; }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":125 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":125 * * * cdef class FileStream(GenericStream): # <<<<<<<<<<<<<< @@ -403,7 +398,7 @@ }; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":47 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":47 * * * cdef class GenericStream: # <<<<<<<<<<<<<< @@ -420,7 +415,7 @@ static struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":125 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":125 * * * cdef class FileStream(GenericStream): # <<<<<<<<<<<<<< @@ -434,7 +429,7 @@ static struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_FileStream *__pyx_vtabptr_5scipy_2io_6matlab_7streams_FileStream; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":87 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":87 * * * cdef class cStringStream(GenericStream): # <<<<<<<<<<<<<< @@ -493,6 +488,8 @@ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -504,8 +501,82 @@ static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); /*proto*/ -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} + + +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { + if (likely(o != Py_None)) { + if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); + Py_INCREF(r); + return r; + } + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { + if (likely(o != Py_None)) { + if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + return r; + } + else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { + PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); + Py_INCREF(r); + return r; + } + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + + +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ + __Pyx_GetItemInt_Generic(o, to_py_func(i))) + +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { + PyObject *r; + if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { + r = PyList_GET_ITEM(o, i); + Py_INCREF(r); + } + else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { + r = PyTuple_GET_ITEM(o, i); + Py_INCREF(r); + } + else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { + r = PySequence_GetItem(o, i); + } + else { + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + } + return r; +} + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ + static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ @@ -529,6 +600,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -552,19 +625,85 @@ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from python_ref */ +/* Module declarations from cpython.version */ -/* Module declarations from python_string */ +/* Module declarations from cpython.ref */ +/* Module declarations from cpython.exc */ + +/* Module declarations from cpython.module */ + +/* Module declarations from cpython.mem */ + +/* Module declarations from cpython.tuple */ + +/* Module declarations from cpython.list */ + +/* Module declarations from libc.stdio */ + +/* Module declarations from cpython.object */ + +/* Module declarations from cpython.sequence */ + +/* Module declarations from cpython.mapping */ + +/* Module declarations from cpython.iterator */ + +/* Module declarations from cpython.type */ + +/* Module declarations from cpython.number */ + +/* Module declarations from cpython.int */ + +/* Module declarations from __builtin__ */ + +/* Module declarations from cpython.bool */ + +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; +/* Module declarations from cpython.long */ + +/* Module declarations from cpython.float */ + +/* Module declarations from cpython.complex */ + +/* Module declarations from cpython.string */ + +/* Module declarations from cpython.unicode */ + +/* Module declarations from cpython.dict */ + +/* Module declarations from cpython.instance */ + +/* Module declarations from cpython.function */ + +/* Module declarations from cpython.method */ + +/* Module declarations from cpython.weakref */ + +/* Module declarations from cpython.getargs */ + +/* Module declarations from cpython.pythread */ + +/* Module declarations from cpython.cobject */ + +/* Module declarations from cpython.oldbuffer */ + +/* Module declarations from cpython.set */ + +/* Module declarations from cpython.buffer */ + +/* Module declarations from cpython.bytes */ + +/* Module declarations from cpython.pycapsule */ + +/* Module declarations from cpython */ + /* Module declarations from scipy.io.matlab.pyalloc */ static CYTHON_INLINE PyObject *__pyx_f_5scipy_2io_6matlab_7pyalloc_pyalloc_v(Py_ssize_t, void **); /*proto*/ -/* Module declarations from __builtin__ */ - /* Module declarations from scipy.io.matlab.streams */ static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream = 0; -static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_7streams_file = 0; static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_7streams_cStringStream = 0; static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_7streams_FileStream = 0; static struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *__pyx_f_5scipy_2io_6matlab_7streams_make_stream(PyObject *, int __pyx_skip_dispatch); /*proto*/ @@ -577,9 +716,12 @@ static char __pyx_k_2[] = "Failed seek"; static char __pyx_k_3[] = "Could not read bytes"; static char __pyx_k_4[] = " "; +static char __pyx_k_5[] = "make_stream (line 203)"; static char __pyx_k__A[] = "A"; static char __pyx_k__n[] = "n"; +static char __pyx_k__rb[] = "rb"; static char __pyx_k__st[] = "st"; +static char __pyx_k__sys[] = "sys"; static char __pyx_k__file[] = "file"; static char __pyx_k__fobj[] = "fobj"; static char __pyx_k__read[] = "read"; @@ -589,17 +731,23 @@ static char __pyx_k__whence[] = "whence"; static char __pyx_k__IOError[] = "IOError"; static char __pyx_k____main__[] = "__main__"; +static char __pyx_k____test__[] = "__test__"; static char __pyx_k__read_into[] = "read_into"; +static char __pyx_k__make_stream[] = "make_stream"; static char __pyx_k__read_string[] = "read_string"; +static char __pyx_k__version_info[] = "version_info"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_n_s__A; +static PyObject *__pyx_kp_b_4; +static PyObject *__pyx_kp_u_5; +static PyObject *__pyx_n_b__A; static PyObject *__pyx_n_s__IOError; static PyObject *__pyx_n_s____main__; +static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s__file; static PyObject *__pyx_n_s__fobj; +static PyObject *__pyx_n_s__make_stream; static PyObject *__pyx_n_s__n; static PyObject *__pyx_n_s__offset; static PyObject *__pyx_n_s__read; @@ -607,10 +755,13 @@ static PyObject *__pyx_n_s__read_string; static PyObject *__pyx_n_s__seek; static PyObject *__pyx_n_s__st; +static PyObject *__pyx_n_s__sys; static PyObject *__pyx_n_s__tell; +static PyObject *__pyx_n_s__version_info; static PyObject *__pyx_n_s__whence; +static PyObject *__pyx_int_3; -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":49 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":49 * cdef class GenericStream: * * def __init__(self, fobj): # <<<<<<<<<<<<<< @@ -652,10 +803,11 @@ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams.GenericStream.__init__"); + __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":50 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":50 * * def __init__(self, fobj): * self.fobj = fobj # <<<<<<<<<<<<<< @@ -673,7 +825,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":52 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":52 * self.fobj = fobj * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< @@ -727,7 +879,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":53 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":53 * * cpdef int seek(self, long int offset, int whence=0) except -1: * self.fobj.seek(offset, whence) # <<<<<<<<<<<<<< @@ -754,7 +906,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":54 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":54 * cpdef int seek(self, long int offset, int whence=0) except -1: * self.fobj.seek(offset, whence) * return 0 # <<<<<<<<<<<<<< @@ -778,7 +930,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":52 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":52 * self.fobj = fobj * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< @@ -811,9 +963,9 @@ if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (kw_args > 1) { + if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__whence); - if (unlikely(value)) { values[1] = value; kw_args--; } + if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -839,6 +991,7 @@ __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams.GenericStream.seek"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); @@ -863,7 +1016,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":56 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":56 * return 0 * * cpdef long int tell(self) except -1: # <<<<<<<<<<<<<< @@ -871,7 +1024,7 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static long __pyx_f_5scipy_2io_6matlab_7streams_13GenericStream_tell(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *__pyx_v_self, int __pyx_skip_dispatch) { long __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -896,7 +1049,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":57 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":57 * * cpdef long int tell(self) except -1: * return self.fobj.tell() # <<<<<<<<<<<<<< @@ -925,7 +1078,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":56 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":56 * return 0 * * cpdef long int tell(self) except -1: # <<<<<<<<<<<<<< @@ -933,8 +1086,8 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; long __pyx_t_1; PyObject *__pyx_t_2 = NULL; @@ -959,7 +1112,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":59 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":59 * return self.fobj.tell() * * def read(self, n_bytes): # <<<<<<<<<<<<<< @@ -975,7 +1128,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read"); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":60 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":60 * * def read(self, n_bytes): * return self.fobj.read(n_bytes) # <<<<<<<<<<<<<< @@ -1012,12 +1165,12 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":62 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":62 * return self.fobj.read(n_bytes) * * cdef int read_into(self, void *buf, size_t n) except -1: # <<<<<<<<<<<<<< - * ''' Read n bytes from stream into pre-allocated buffer `buf` - * ''' + * """ Read n bytes from stream into pre-allocated buffer `buf` + * """ */ static int __pyx_f_5scipy_2io_6matlab_7streams_13GenericStream_read_into(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *__pyx_v_self, void *__pyx_v_buf, size_t __pyx_v_n) { @@ -1031,14 +1184,13 @@ int __pyx_t_5; char *__pyx_t_6; __Pyx_RefNannySetupContext("read_into"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":66 - * ''' + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":66 + * """ * cdef char* d_ptr * data = self.fobj.read(n) # <<<<<<<<<<<<<< - * if PyString_Size(data) != n: + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->fobj, __pyx_n_s__read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1058,20 +1210,20 @@ __pyx_v_data = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":67 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":67 * cdef char* d_ptr * data = self.fobj.read(n) - * if PyString_Size(data) != n: # <<<<<<<<<<<<<< + * if PyBytes_Size(data) != n: # <<<<<<<<<<<<<< * raise IOError('could not read bytes') * return -1 */ - __pyx_t_4 = PyString_Size(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyBytes_Size(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_4 != __pyx_v_n); if (__pyx_t_5) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":68 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":68 * data = self.fobj.read(n) - * if PyString_Size(data) != n: + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') # <<<<<<<<<<<<<< * return -1 * d_ptr = data @@ -1088,8 +1240,8 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":69 - * if PyString_Size(data) != n: + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":69 + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') * return -1 # <<<<<<<<<<<<<< * d_ptr = data @@ -1101,17 +1253,17 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":70 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":70 * raise IOError('could not read bytes') * return -1 * d_ptr = data # <<<<<<<<<<<<<< * memcpy(buf, d_ptr, n) * return 0 */ - __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_d_ptr = __pyx_t_6; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":71 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":71 * return -1 * d_ptr = data * memcpy(buf, d_ptr, n) # <<<<<<<<<<<<<< @@ -1120,7 +1272,7 @@ */ memcpy(__pyx_v_buf, __pyx_v_d_ptr, __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":72 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":72 * d_ptr = data * memcpy(buf, d_ptr, n) * return 0 # <<<<<<<<<<<<<< @@ -1140,16 +1292,15 @@ __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_data); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":74 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":74 * return 0 * * cdef object read_string(self, size_t n, void **pp, int copy=True): # <<<<<<<<<<<<<< - * ''' Make new memory, wrap with object ''' + * """ Make new memory, wrap with object """ * data = self.fobj.read(n) */ @@ -1169,14 +1320,13 @@ __pyx_v_copy = __pyx_optional_args->copy; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_data = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":76 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":76 * cdef object read_string(self, size_t n, void **pp, int copy=True): - * ''' Make new memory, wrap with object ''' + * """ Make new memory, wrap with object """ * data = self.fobj.read(n) # <<<<<<<<<<<<<< - * if PyString_Size(data) != n: + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->fobj, __pyx_n_s__read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1196,23 +1346,23 @@ __pyx_v_data = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":77 - * ''' Make new memory, wrap with object ''' + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":77 + * """ Make new memory, wrap with object """ * data = self.fobj.read(n) - * if PyString_Size(data) != n: # <<<<<<<<<<<<<< + * if PyBytes_Size(data) != n: # <<<<<<<<<<<<<< * raise IOError('could not read bytes') * if copy != True: */ - __pyx_t_4 = PyString_Size(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyBytes_Size(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = (__pyx_t_4 != __pyx_v_n); if (__pyx_t_5) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":78 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":78 * data = self.fobj.read(n) - * if PyString_Size(data) != n: + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') # <<<<<<<<<<<<<< * if copy != True: - * pp[0] = PyString_AS_STRING(data) + * pp[0] = PyBytes_AS_STRING(data) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -1229,31 +1379,31 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":79 - * if PyString_Size(data) != n: + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":79 + * if PyBytes_Size(data) != n: * raise IOError('could not read bytes') * if copy != True: # <<<<<<<<<<<<<< - * pp[0] = PyString_AS_STRING(data) + * pp[0] = PyBytes_AS_STRING(data) * return data */ __pyx_t_5 = (__pyx_v_copy != 1); if (__pyx_t_5) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":80 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":80 * raise IOError('could not read bytes') * if copy != True: - * pp[0] = PyString_AS_STRING(data) # <<<<<<<<<<<<<< + * pp[0] = PyBytes_AS_STRING(data) # <<<<<<<<<<<<<< * return data * cdef object d_copy = pyalloc_v(n, pp) */ - (__pyx_v_pp[0]) = ((void *)PyString_AS_STRING(__pyx_v_data)); + (__pyx_v_pp[0]) = ((void *)PyBytes_AS_STRING(__pyx_v_data)); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":81 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":81 * if copy != True: - * pp[0] = PyString_AS_STRING(data) + * pp[0] = PyBytes_AS_STRING(data) * return data # <<<<<<<<<<<<<< * cdef object d_copy = pyalloc_v(n, pp) - * memcpy(pp[0], PyString_AS_STRING(data), n) + * memcpy(pp[0], PyBytes_AS_STRING(data), n) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); @@ -1263,11 +1413,11 @@ } __pyx_L4:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":82 - * pp[0] = PyString_AS_STRING(data) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":82 + * pp[0] = PyBytes_AS_STRING(data) * return data * cdef object d_copy = pyalloc_v(n, pp) # <<<<<<<<<<<<<< - * memcpy(pp[0], PyString_AS_STRING(data), n) + * memcpy(pp[0], PyBytes_AS_STRING(data), n) * return d_copy */ __pyx_t_3 = __pyx_f_5scipy_2io_6matlab_7pyalloc_pyalloc_v(__pyx_v_n, __pyx_v_pp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1275,18 +1425,18 @@ __pyx_v_d_copy = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":83 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":83 * return data * cdef object d_copy = pyalloc_v(n, pp) - * memcpy(pp[0], PyString_AS_STRING(data), n) # <<<<<<<<<<<<<< + * memcpy(pp[0], PyBytes_AS_STRING(data), n) # <<<<<<<<<<<<<< * return d_copy * */ - memcpy((__pyx_v_pp[0]), PyString_AS_STRING(__pyx_v_data), __pyx_v_n); + memcpy((__pyx_v_pp[0]), PyBytes_AS_STRING(__pyx_v_data), __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":84 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":84 * cdef object d_copy = pyalloc_v(n, pp) - * memcpy(pp[0], PyString_AS_STRING(data), n) + * memcpy(pp[0], PyBytes_AS_STRING(data), n) * return d_copy # <<<<<<<<<<<<<< * * @@ -1307,13 +1457,12 @@ __pyx_L0:; __Pyx_DECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_d_copy); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":89 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":89 * cdef class cStringStream(GenericStream): * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< @@ -1341,7 +1490,6 @@ __pyx_v_whence = __pyx_optional_args->whence; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ @@ -1373,7 +1521,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":91 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":91 * cpdef int seek(self, long int offset, int whence=0) except -1: * cdef char *ptr * if whence == 1 and offset >=0: # forward, from here # <<<<<<<<<<<<<< @@ -1389,7 +1537,7 @@ } if (__pyx_t_8) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":92 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":92 * cdef char *ptr * if whence == 1 and offset >=0: # forward, from here * StringIO_cread(self.fobj, &ptr, offset) # <<<<<<<<<<<<<< @@ -1398,7 +1546,7 @@ */ PycStringIO->cread(__pyx_v_self->__pyx_base.fobj, (&__pyx_v_ptr), __pyx_v_offset); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":93 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":93 * if whence == 1 and offset >=0: # forward, from here * StringIO_cread(self.fobj, &ptr, offset) * return 0 # <<<<<<<<<<<<<< @@ -1411,7 +1559,7 @@ } /*else*/ { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":95 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":95 * return 0 * else: # use python interface * return GenericStream.seek(self, offset, whence) # <<<<<<<<<<<<<< @@ -1436,12 +1584,11 @@ __Pyx_AddTraceback("scipy.io.matlab.streams.cStringStream.seek"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":89 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":89 * cdef class cStringStream(GenericStream): * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< @@ -1474,9 +1621,9 @@ if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (kw_args > 1) { + if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__whence); - if (unlikely(value)) { values[1] = value; kw_args--; } + if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { @@ -1502,6 +1649,7 @@ __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams.cStringStream.seek"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); @@ -1526,12 +1674,12 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":97 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":97 * return GenericStream.seek(self, offset, whence) * * cdef int read_into(self, void *buf, size_t n) except -1: # <<<<<<<<<<<<<< - * ''' Read n bytes from stream into pre-allocated buffer `buf` - * ''' + * """ Read n bytes from stream into pre-allocated buffer `buf` + * """ */ static int __pyx_f_5scipy_2io_6matlab_7streams_13cStringStream_read_into(struct __pyx_obj_5scipy_2io_6matlab_7streams_cStringStream *__pyx_v_self, void *__pyx_v_buf, size_t __pyx_v_n) { @@ -1542,9 +1690,8 @@ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_into"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":103 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":103 * size_t n_red * char* d_ptr * n_red = StringIO_cread(self.fobj, &d_ptr, n) # <<<<<<<<<<<<<< @@ -1553,7 +1700,7 @@ */ __pyx_v_n_red = PycStringIO->cread(__pyx_v_self->__pyx_base.fobj, (&__pyx_v_d_ptr), __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":104 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":104 * char* d_ptr * n_red = StringIO_cread(self.fobj, &d_ptr, n) * if n_red != n: # <<<<<<<<<<<<<< @@ -1563,7 +1710,7 @@ __pyx_t_1 = (__pyx_v_n_red != __pyx_v_n); if (__pyx_t_1) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":105 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":105 * n_red = StringIO_cread(self.fobj, &d_ptr, n) * if n_red != n: * raise IOError('could not read bytes') # <<<<<<<<<<<<<< @@ -1585,7 +1732,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":106 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":106 * if n_red != n: * raise IOError('could not read bytes') * memcpy(buf, d_ptr, n) # <<<<<<<<<<<<<< @@ -1594,7 +1741,7 @@ */ memcpy(__pyx_v_buf, ((void *)__pyx_v_d_ptr), __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":107 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":107 * raise IOError('could not read bytes') * memcpy(buf, d_ptr, n) * return 0 # <<<<<<<<<<<<<< @@ -1612,16 +1759,15 @@ __Pyx_AddTraceback("scipy.io.matlab.streams.cStringStream.read_into"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":109 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":109 * return 0 * * cdef object read_string(self, size_t n, void **pp, int copy=True): # <<<<<<<<<<<<<< - * ''' Make new memory, wrap with object + * """ Make new memory, wrap with object * */ @@ -1640,10 +1786,9 @@ __pyx_v_copy = __pyx_optional_args->copy; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":117 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":117 * char *d_ptr * object obj * cdef size_t n_red = StringIO_cread(self.fobj, &d_ptr, n) # <<<<<<<<<<<<<< @@ -1652,7 +1797,7 @@ */ __pyx_v_n_red = PycStringIO->cread(__pyx_v_self->__pyx_base.fobj, (&__pyx_v_d_ptr), __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":118 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":118 * object obj * cdef size_t n_red = StringIO_cread(self.fobj, &d_ptr, n) * if n_red != n: # <<<<<<<<<<<<<< @@ -1662,7 +1807,7 @@ __pyx_t_1 = (__pyx_v_n_red != __pyx_v_n); if (__pyx_t_1) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":119 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":119 * cdef size_t n_red = StringIO_cread(self.fobj, &d_ptr, n) * if n_red != n: * raise IOError('could not read bytes') # <<<<<<<<<<<<<< @@ -1684,7 +1829,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":120 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":120 * if n_red != n: * raise IOError('could not read bytes') * obj = pyalloc_v(n, pp) # <<<<<<<<<<<<<< @@ -1697,7 +1842,7 @@ __pyx_v_obj = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":121 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":121 * raise IOError('could not read bytes') * obj = pyalloc_v(n, pp) * memcpy(pp[0], d_ptr, n) # <<<<<<<<<<<<<< @@ -1706,7 +1851,7 @@ */ memcpy((__pyx_v_pp[0]), __pyx_v_d_ptr, __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":122 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":122 * obj = pyalloc_v(n, pp) * memcpy(pp[0], d_ptr, n) * return obj # <<<<<<<<<<<<<< @@ -1727,24 +1872,24 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_obj); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":128 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":128 * cdef FILE* file * * def __init__(self, fobj): # <<<<<<<<<<<<<< * self.fobj = fobj - * self.file = PyFile_AsFile(fobj) + * self.file = npy_PyFile_Dup(fobj, "rb") */ static int __pyx_pf_5scipy_2io_6matlab_7streams_10FileStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5scipy_2io_6matlab_7streams_10FileStream___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fobj = 0; int __pyx_r; + FILE *__pyx_t_1; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fobj,0}; __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds)) { @@ -1775,14 +1920,15 @@ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.__init__"); + __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":129 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":129 * * def __init__(self, fobj): * self.fobj = fobj # <<<<<<<<<<<<<< - * self.file = PyFile_AsFile(fobj) + * self.file = npy_PyFile_Dup(fobj, "rb") * */ __Pyx_INCREF(__pyx_v_fobj); @@ -1791,26 +1937,66 @@ __Pyx_DECREF(((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.fobj); ((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.fobj = __pyx_v_fobj; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":130 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":130 * def __init__(self, fobj): * self.fobj = fobj - * self.file = PyFile_AsFile(fobj) # <<<<<<<<<<<<<< + * self.file = npy_PyFile_Dup(fobj, "rb") # <<<<<<<<<<<<<< * - * cpdef int seek(self, long int offset, int whence=0) except -1: + * def __del__(self): */ - ((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->file = PyFile_AsFile(__pyx_v_fobj); + __pyx_t_1 = npy_PyFile_Dup(__pyx_v_fobj, __pyx_k__rb); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->file = __pyx_t_1; __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.__init__"); + __pyx_r = -1; + __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":132 - * self.file = PyFile_AsFile(fobj) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":132 + * self.file = npy_PyFile_Dup(fobj, "rb") * + * def __del__(self): # <<<<<<<<<<<<<< + * npy_PyFile_DupClose(self.fobj, self.file) + * + */ + +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream___del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream___del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = NULL; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__del__"); + + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":133 + * + * def __del__(self): + * npy_PyFile_DupClose(self.fobj, self.file) # <<<<<<<<<<<<<< + * + * cpdef int seek(self, long int offset, int whence=0) except -1: + */ + __pyx_t_1 = npy_PyFile_DupClose(((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.fobj, ((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->file); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.__del__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":135 + * npy_PyFile_DupClose(self.fobj, self.file) + * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< * cdef int ret - * ''' move `offset` bytes in stream + * """ move `offset` bytes in stream */ static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -1829,19 +2015,18 @@ __pyx_v_whence = __pyx_optional_args->whence; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_seek)) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_whence); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -1849,10 +2034,10 @@ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -1861,45 +2046,44 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":152 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":155 * ret : int - * ''' + * """ * ret = fseek(self.file, offset, whence) # <<<<<<<<<<<<<< * if ret: * raise IOError('Failed seek') */ __pyx_v_ret = fseek(__pyx_v_self->file, __pyx_v_offset, __pyx_v_whence); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":153 - * ''' + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":156 + * """ * ret = fseek(self.file, offset, whence) * if ret: # <<<<<<<<<<<<<< * raise IOError('Failed seek') * return -1 */ - __pyx_t_5 = __pyx_v_ret; - if (__pyx_t_5) { + if (__pyx_v_ret) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":154 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":157 * ret = fseek(self.file, offset, whence) * if ret: * raise IOError('Failed seek') # <<<<<<<<<<<<<< * return -1 * return ret */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":155 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":158 * if ret: * raise IOError('Failed seek') * return -1 # <<<<<<<<<<<<<< @@ -1912,7 +2096,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":156 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":159 * raise IOError('Failed seek') * return -1 * return ret # <<<<<<<<<<<<<< @@ -1932,17 +2116,16 @@ __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.seek"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":132 - * self.file = PyFile_AsFile(fobj) +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":135 + * npy_PyFile_DupClose(self.fobj, self.file) * * cpdef int seek(self, long int offset, int whence=0) except -1: # <<<<<<<<<<<<<< * cdef int ret - * ''' move `offset` bytes in stream + * """ move `offset` bytes in stream */ static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -1970,41 +2153,42 @@ if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - if (kw_args > 1) { + if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__whence); - if (unlikely(value)) { values[1] = value; kw_args--; } + if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - __pyx_v_offset = __Pyx_PyInt_AsLong(values[0]); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_offset = __Pyx_PyInt_AsLong(values[0]); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} if (values[1]) { - __pyx_v_whence = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_whence = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_whence = ((int)0); } } else { __pyx_v_whence = ((int)0); switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_whence = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 1: __pyx_v_offset = __Pyx_PyInt_AsLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + case 2: __pyx_v_whence = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_whence == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + case 1: __pyx_v_offset = __Pyx_PyInt_AsLong(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_offset == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.seek"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.whence = __pyx_v_whence; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_FileStream *)((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.seek(((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self), __pyx_v_offset, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_FileStream *)((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.seek(((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self), __pyx_v_offset, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -2022,7 +2206,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":158 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":161 * return ret * * cpdef long int tell(self): # <<<<<<<<<<<<<< @@ -2030,7 +2214,7 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static long __pyx_f_5scipy_2io_6matlab_7streams_10FileStream_tell(struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *__pyx_v_self, int __pyx_skip_dispatch) { long __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -2041,12 +2225,12 @@ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overriden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__tell); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell)) { - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2055,7 +2239,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":159 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":162 * * cpdef long int tell(self): * return ftell(self.file) # <<<<<<<<<<<<<< @@ -2077,7 +2261,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":158 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":161 * return ret * * cpdef long int tell(self): # <<<<<<<<<<<<<< @@ -2085,15 +2269,15 @@ * */ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; long __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("tell"); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_FileStream *)((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.tell(((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_FileStream *)((struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.tell(((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self), 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -2111,12 +2295,12 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":161 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":164 * return ftell(self.file) * * cdef int read_into(self, void *buf, size_t n) except -1: # <<<<<<<<<<<<<< - * ''' Read n bytes from stream into pre-allocated buffer `buf` - * ''' + * """ Read n bytes from stream into pre-allocated buffer `buf` + * """ */ static int __pyx_f_5scipy_2io_6matlab_7streams_10FileStream_read_into(struct __pyx_obj_5scipy_2io_6matlab_7streams_FileStream *__pyx_v_self, void *__pyx_v_buf, size_t __pyx_v_n) { @@ -2126,9 +2310,8 @@ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("read_into"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":167 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":170 * size_t n_red * char* d_ptr * n_red = fread(buf, 1, n, self.file) # <<<<<<<<<<<<<< @@ -2137,7 +2320,7 @@ */ __pyx_v_n_red = fread(__pyx_v_buf, 1, __pyx_v_n, __pyx_v_self->file); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":168 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":171 * char* d_ptr * n_red = fread(buf, 1, n, self.file) * if n_red != n: # <<<<<<<<<<<<<< @@ -2147,26 +2330,26 @@ __pyx_t_1 = (__pyx_v_n_red != __pyx_v_n); if (__pyx_t_1) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":169 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":172 * n_red = fread(buf, 1, n, self.file) * if n_red != n: * raise IOError('Could not read bytes') # <<<<<<<<<<<<<< * return -1 * return 0 */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":170 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":173 * if n_red != n: * raise IOError('Could not read bytes') * return -1 # <<<<<<<<<<<<<< @@ -2179,7 +2362,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":171 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":174 * raise IOError('Could not read bytes') * return -1 * return 0 # <<<<<<<<<<<<<< @@ -2197,16 +2380,15 @@ __Pyx_AddTraceback("scipy.io.matlab.streams.FileStream.read_into"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":173 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":176 * return 0 * * cdef object read_string(self, size_t n, void **pp, int copy=True): # <<<<<<<<<<<<<< - * ''' Make new memory, wrap with object ''' + * """ Make new memory, wrap with object """ * cdef object obj = pyalloc_v(n, pp) */ @@ -2224,22 +2406,21 @@ __pyx_v_copy = __pyx_optional_args->copy; } } - __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":175 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":178 * cdef object read_string(self, size_t n, void **pp, int copy=True): - * ''' Make new memory, wrap with object ''' + * """ Make new memory, wrap with object """ * cdef object obj = pyalloc_v(n, pp) # <<<<<<<<<<<<<< * cdef size_t n_red = fread(pp[0], 1, n, self.file) * if n_red != n: */ - __pyx_t_1 = __pyx_f_5scipy_2io_6matlab_7pyalloc_pyalloc_v(__pyx_v_n, __pyx_v_pp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_5scipy_2io_6matlab_7pyalloc_pyalloc_v(__pyx_v_n, __pyx_v_pp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":176 - * ''' Make new memory, wrap with object ''' + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":179 + * """ Make new memory, wrap with object """ * cdef object obj = pyalloc_v(n, pp) * cdef size_t n_red = fread(pp[0], 1, n, self.file) # <<<<<<<<<<<<<< * if n_red != n: @@ -2247,7 +2428,7 @@ */ __pyx_v_n_red = fread((__pyx_v_pp[0]), 1, __pyx_v_n, __pyx_v_self->file); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":177 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":180 * cdef object obj = pyalloc_v(n, pp) * cdef size_t n_red = fread(pp[0], 1, n, self.file) * if n_red != n: # <<<<<<<<<<<<<< @@ -2257,34 +2438,34 @@ __pyx_t_2 = (__pyx_v_n_red != __pyx_v_n); if (__pyx_t_2) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":178 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":181 * cdef size_t n_red = fread(pp[0], 1, n, self.file) * if n_red != n: * raise IOError('could not read bytes') # <<<<<<<<<<<<<< * return obj * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_1)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":179 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":182 * if n_red != n: * raise IOError('could not read bytes') * return obj # <<<<<<<<<<<<<< * - * + * def _read_into(GenericStream st, size_t n): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj); @@ -2300,15 +2481,14 @@ __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":182 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":184 + * return obj * - * * def _read_into(GenericStream st, size_t n): # <<<<<<<<<<<<<< * # for testing only. Use st.read instead * cdef char * d_ptr @@ -2346,66 +2526,67 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_read_into", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_read_into", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_read_into") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_read_into") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_st = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)values[0]); - __pyx_v_n = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_st = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_n = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_read_into", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_read_into", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams._read_into"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_v_my_str = Py_None; __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream, 1, "st", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_my_str = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream, 1, "st", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":185 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":187 * # for testing only. Use st.read instead * cdef char * d_ptr - * my_str = ' ' * n # <<<<<<<<<<<<<< + * my_str = b' ' * n # <<<<<<<<<<<<<< * d_ptr = my_str * st.read_into(d_ptr, n) */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_kp_s_4), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_kp_b_4), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_my_str); + __Pyx_DECREF(((PyObject *)__pyx_v_my_str)); __pyx_v_my_str = __pyx_t_2; __pyx_t_2 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":186 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":188 * cdef char * d_ptr - * my_str = ' ' * n + * my_str = b' ' * n * d_ptr = my_str # <<<<<<<<<<<<<< * st.read_into(d_ptr, n) * return my_str */ - __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_my_str); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyBytes_AsString(((PyObject *)__pyx_v_my_str)); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_d_ptr = __pyx_t_3; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":187 - * my_str = ' ' * n + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":189 + * my_str = b' ' * n * d_ptr = my_str * st.read_into(d_ptr, n) # <<<<<<<<<<<<<< * return my_str * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_st->__pyx_vtab)->read_into(__pyx_v_st, __pyx_v_d_ptr, __pyx_v_n); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_st->__pyx_vtab)->read_into(__pyx_v_st, __pyx_v_d_ptr, __pyx_v_n); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":188 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":190 * d_ptr = my_str * st.read_into(d_ptr, n) * return my_str # <<<<<<<<<<<<<< @@ -2413,8 +2594,8 @@ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_my_str); - __pyx_r = __pyx_v_my_str; + __Pyx_INCREF(((PyObject *)__pyx_v_my_str)); + __pyx_r = ((PyObject *)__pyx_v_my_str); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2431,7 +2612,7 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":191 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":193 * * * def _read_string(GenericStream st, size_t n): # <<<<<<<<<<<<<< @@ -2473,72 +2654,73 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_read_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_read_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_read_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_read_string") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_st = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)values[0]); - __pyx_v_n = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_st = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)PyTuple_GET_ITEM(__pyx_args, 0)); - __pyx_v_n = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_read_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_read_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.io.matlab.streams._read_string"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_v_my_str = Py_None; __Pyx_INCREF(Py_None); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream, 1, "st", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_my_str = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_st), __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream, 1, "st", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":194 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":196 * # for testing only. Use st.read instead * cdef char *d_ptr * cdef object obj = st.read_string(n, &d_ptr, True) # <<<<<<<<<<<<<< - * my_str = 'A' * n + * my_str = b'A' * n * cdef char *mys_ptr = my_str */ __pyx_t_2.__pyx_n = 1; __pyx_t_2.copy = 1; - __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_st->__pyx_vtab)->read_string(__pyx_v_st, __pyx_v_n, ((void **)(&__pyx_v_d_ptr)), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_st->__pyx_vtab)->read_string(__pyx_v_st, __pyx_v_n, ((void **)(&__pyx_v_d_ptr)), &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":195 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":197 * cdef char *d_ptr * cdef object obj = st.read_string(n, &d_ptr, True) - * my_str = 'A' * n # <<<<<<<<<<<<<< + * my_str = b'A' * n # <<<<<<<<<<<<<< * cdef char *mys_ptr = my_str * memcpy(mys_ptr, d_ptr, n) */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_n_s__A), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_n_b__A), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_my_str); + __Pyx_DECREF(((PyObject *)__pyx_v_my_str)); __pyx_v_my_str = __pyx_t_3; __pyx_t_3 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":196 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":198 * cdef object obj = st.read_string(n, &d_ptr, True) - * my_str = 'A' * n + * my_str = b'A' * n * cdef char *mys_ptr = my_str # <<<<<<<<<<<<<< * memcpy(mys_ptr, d_ptr, n) * return my_str */ - __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_my_str); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_my_str)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_mys_ptr = __pyx_t_4; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":197 - * my_str = 'A' * n + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":199 + * my_str = b'A' * n * cdef char *mys_ptr = my_str * memcpy(mys_ptr, d_ptr, n) # <<<<<<<<<<<<<< * return my_str @@ -2546,7 +2728,7 @@ */ memcpy(__pyx_v_mys_ptr, __pyx_v_d_ptr, __pyx_v_n); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":198 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":200 * cdef char *mys_ptr = my_str * memcpy(mys_ptr, d_ptr, n) * return my_str # <<<<<<<<<<<<<< @@ -2554,8 +2736,8 @@ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_my_str); - __pyx_r = __pyx_v_my_str; + __Pyx_INCREF(((PyObject *)__pyx_v_my_str)); + __pyx_r = ((PyObject *)__pyx_v_my_str); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2573,12 +2755,12 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":201 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":203 * * * cpdef GenericStream make_stream(object fobj): # <<<<<<<<<<<<<< - * ''' Make stream of correct type for file-like `fobj` - * ''' + * """ Make stream of correct type for file-like `fobj` + * """ */ static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_make_stream(PyObject *__pyx_self, PyObject *__pyx_v_fobj); /*proto*/ @@ -2589,71 +2771,118 @@ PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; + int __pyx_t_6; __Pyx_RefNannySetupContext("make_stream"); - __Pyx_INCREF(__pyx_v_fobj); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":204 - * ''' Make stream of correct type for file-like `fobj` - * ''' - * if isinstance(fobj, file): # <<<<<<<<<<<<<< - * return FileStream(fobj) - * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":206 + * """ Make stream of correct type for file-like `fobj` + * """ + * if npy_PyFile_Check(fobj): # <<<<<<<<<<<<<< + * if sys.version_info[0] >= 3: + * return GenericStream(fobj) */ - __pyx_t_1 = PyObject_TypeCheck(__pyx_v_fobj, ((PyTypeObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_file))); + __pyx_t_1 = npy_PyFile_Check(__pyx_v_fobj); if (__pyx_t_1) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":205 - * ''' - * if isinstance(fobj, file): - * return FileStream(fobj) # <<<<<<<<<<<<<< - * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): - * return cStringStream(fobj) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":207 + * """ + * if npy_PyFile_Check(fobj): + * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< + * return GenericStream(fobj) + * else: */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_fobj); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fobj); - __Pyx_GIVEREF(__pyx_v_fobj); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_FileStream)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__version_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":208 + * if npy_PyFile_Check(fobj): + * if sys.version_info[0] >= 3: + * return GenericStream(fobj) # <<<<<<<<<<<<<< + * else: + * return FileStream(fobj) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_fobj); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fobj); + __Pyx_GIVEREF(__pyx_v_fobj); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; + goto __pyx_L4; + } + /*else*/ { + + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":210 + * return GenericStream(fobj) + * else: + * return FileStream(fobj) # <<<<<<<<<<<<<< + * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): + * return cStringStream(fobj) + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_fobj); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fobj); + __Pyx_GIVEREF(__pyx_v_fobj); + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_FileStream)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + } + __pyx_L4:; goto __pyx_L3; } - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":206 - * if isinstance(fobj, file): - * return FileStream(fobj) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":211 + * else: + * return FileStream(fobj) * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): # <<<<<<<<<<<<<< * return cStringStream(fobj) * return GenericStream(fobj) */ - __pyx_t_1 = PycStringIO_InputCheck(__pyx_v_fobj); - if (!__pyx_t_1) { - __pyx_t_4 = PycStringIO_OutputCheck(__pyx_v_fobj); - __pyx_t_5 = __pyx_t_4; + __pyx_t_4 = PycStringIO_InputCheck(__pyx_v_fobj); + if (!__pyx_t_4) { + __pyx_t_5 = PycStringIO_OutputCheck(__pyx_v_fobj); + __pyx_t_6 = __pyx_t_5; } else { - __pyx_t_5 = __pyx_t_1; + __pyx_t_6 = __pyx_t_4; } - if (__pyx_t_5) { + if (__pyx_t_6) { - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":207 - * return FileStream(fobj) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":212 + * return FileStream(fobj) * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): * return cStringStream(fobj) # <<<<<<<<<<<<<< * return GenericStream(fobj) * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_fobj); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fobj); __Pyx_GIVEREF(__pyx_v_fobj); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_cStringStream)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_cStringStream)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_2); @@ -2663,7 +2892,7 @@ } __pyx_L3:; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":208 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":213 * elif PycStringIO_InputCheck(fobj) or PycStringIO_OutputCheck(fobj): * return cStringStream(fobj) * return GenericStream(fobj) # <<<<<<<<<<<<<< @@ -2671,12 +2900,12 @@ * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fobj); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fobj); __Pyx_GIVEREF(__pyx_v_fobj); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_3); @@ -2691,18 +2920,17 @@ __Pyx_AddTraceback("scipy.io.matlab.streams.make_stream"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_fobj); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":201 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":203 * * * cpdef GenericStream make_stream(object fobj): # <<<<<<<<<<<<<< - * ''' Make stream of correct type for file-like `fobj` - * ''' + * """ Make stream of correct type for file-like `fobj` + * """ */ static PyObject *__pyx_pf_5scipy_2io_6matlab_7streams_make_stream(PyObject *__pyx_self, PyObject *__pyx_v_fobj); /*proto*/ @@ -2713,7 +2941,7 @@ __Pyx_RefNannySetupContext("make_stream"); __pyx_self = __pyx_self; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -2731,12 +2959,12 @@ return __pyx_r; } -/* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/pyalloc.pxd":8 +/* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/pyalloc.pxd":8 * * # Function to allocate, wrap memory via Python string creation * cdef inline object pyalloc_v(Py_ssize_t n, void **pp): # <<<<<<<<<<<<<< - * cdef object ob = PyString_FromStringAndSize(NULL, n) - * pp[0] = PyString_AS_STRING(ob) + * cdef object ob = PyBytes_FromStringAndSize(NULL, n) + * pp[0] = PyBytes_AS_STRING(ob) */ static CYTHON_INLINE PyObject *__pyx_f_5scipy_2io_6matlab_7pyalloc_pyalloc_v(Py_ssize_t __pyx_v_n, void **__pyx_v_pp) { @@ -2745,30 +2973,30 @@ PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("pyalloc_v"); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/pyalloc.pxd":9 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/pyalloc.pxd":9 * # Function to allocate, wrap memory via Python string creation * cdef inline object pyalloc_v(Py_ssize_t n, void **pp): - * cdef object ob = PyString_FromStringAndSize(NULL, n) # <<<<<<<<<<<<<< - * pp[0] = PyString_AS_STRING(ob) + * cdef object ob = PyBytes_FromStringAndSize(NULL, n) # <<<<<<<<<<<<<< + * pp[0] = PyBytes_AS_STRING(ob) * return ob */ - __pyx_t_1 = PyString_FromStringAndSize(NULL, __pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(NULL, __pyx_v_n)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_ob = __pyx_t_1; __pyx_t_1 = 0; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/pyalloc.pxd":10 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/pyalloc.pxd":10 * cdef inline object pyalloc_v(Py_ssize_t n, void **pp): - * cdef object ob = PyString_FromStringAndSize(NULL, n) - * pp[0] = PyString_AS_STRING(ob) # <<<<<<<<<<<<<< + * cdef object ob = PyBytes_FromStringAndSize(NULL, n) + * pp[0] = PyBytes_AS_STRING(ob) # <<<<<<<<<<<<<< * return ob * */ - (__pyx_v_pp[0]) = ((void *)PyString_AS_STRING(__pyx_v_ob)); + (__pyx_v_pp[0]) = ((void *)PyBytes_AS_STRING(__pyx_v_ob)); - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/pyalloc.pxd":11 - * cdef object ob = PyString_FromStringAndSize(NULL, n) - * pp[0] = PyString_AS_STRING(ob) + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/pyalloc.pxd":11 + * cdef object ob = PyBytes_FromStringAndSize(NULL, n) + * pp[0] = PyBytes_AS_STRING(ob) * return ob # <<<<<<<<<<<<<< * * @@ -2826,7 +3054,7 @@ return 0; } -static struct PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_GenericStream[] = { +static PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_GenericStream[] = { {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_tell, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_13GenericStream_read, METH_O, __Pyx_DOCSTR(0)}, @@ -2857,10 +3085,10 @@ 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else 0, /*reserved*/ - #else - 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -2886,7 +3114,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -2940,7 +3168,11 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_GenericStream, /*tp_as_number*/ &__pyx_tp_as_sequence_GenericStream, /*tp_as_sequence*/ @@ -2993,7 +3225,7 @@ return o; } -static struct PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_cStringStream[] = { +static PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_cStringStream[] = { {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_13cStringStream_seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -3022,10 +3254,10 @@ 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else 0, /*reserved*/ - #else - 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -3051,7 +3283,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -3105,7 +3337,11 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_cStringStream, /*tp_as_number*/ &__pyx_tp_as_sequence_cStringStream, /*tp_as_sequence*/ @@ -3158,7 +3394,8 @@ return o; } -static struct PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_FileStream[] = { +static PyMethodDef __pyx_methods_5scipy_2io_6matlab_7streams_FileStream[] = { + {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream___del__, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_10FileStream_tell, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} @@ -3188,10 +3425,10 @@ 0, /*nb_coerce*/ #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else 0, /*reserved*/ - #else - 0, /*nb_long*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 @@ -3217,7 +3454,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; @@ -3271,7 +3508,11 @@ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif 0, /*tp_repr*/ &__pyx_tp_as_number_FileStream, /*tp_as_number*/ &__pyx_tp_as_sequence_FileStream, /*tp_as_sequence*/ @@ -3314,15 +3555,13 @@ #endif }; -static struct PyMethodDef __pyx_methods[] = { +static PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("_read_into"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams__read_into, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("_read_string"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams__read_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("make_stream"), (PyCFunction)__pyx_pf_5scipy_2io_6matlab_7streams_make_stream, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_2io_6matlab_7streams_make_stream)}, {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); /*proto*/ - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -3341,12 +3580,15 @@ {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_n_s__A, __pyx_k__A, sizeof(__pyx_k__A), 0, 0, 1, 1}, + {&__pyx_kp_b_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 0, 0}, + {&__pyx_kp_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 0}, + {&__pyx_n_b__A, __pyx_k__A, sizeof(__pyx_k__A), 0, 0, 0, 1}, {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, + {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1}, {&__pyx_n_s__fobj, __pyx_k__fobj, sizeof(__pyx_k__fobj), 0, 0, 1, 1}, + {&__pyx_n_s__make_stream, __pyx_k__make_stream, sizeof(__pyx_k__make_stream), 0, 0, 1, 1}, {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1}, {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1}, {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, @@ -3354,7 +3596,9 @@ {&__pyx_n_s__read_string, __pyx_k__read_string, sizeof(__pyx_k__read_string), 0, 0, 1, 1}, {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1}, {&__pyx_n_s__st, __pyx_k__st, sizeof(__pyx_k__st), 0, 0, 1, 1}, + {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1}, {&__pyx_n_s__tell, __pyx_k__tell, sizeof(__pyx_k__tell), 0, 0, 1, 1}, + {&__pyx_n_s__version_info, __pyx_k__version_info, sizeof(__pyx_k__version_info), 0, 0, 1, 1}, {&__pyx_n_s__whence, __pyx_k__whence, sizeof(__pyx_k__whence), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -3367,6 +3611,7 @@ static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; @@ -3380,6 +3625,9 @@ PyMODINIT_FUNC PyInit_streams(void) #endif { + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -3391,12 +3639,10 @@ } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_streams(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -3445,7 +3691,6 @@ if (__Pyx_SetVtable(__pyx_type_5scipy_2io_6matlab_7streams_GenericStream.tp_dict, __pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "GenericStream", (PyObject *)&__pyx_type_5scipy_2io_6matlab_7streams_GenericStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream = &__pyx_type_5scipy_2io_6matlab_7streams_GenericStream; - __pyx_ptype_5scipy_2io_6matlab_7streams_file = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "file", sizeof(PyFileObject), 0); if (unlikely(!__pyx_ptype_5scipy_2io_6matlab_7streams_file)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_5scipy_2io_6matlab_7streams_cStringStream = &__pyx_vtable_5scipy_2io_6matlab_7streams_cStringStream; __pyx_vtable_5scipy_2io_6matlab_7streams_cStringStream.__pyx_base = *__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream; #if PY_MAJOR_VERSION >= 3 @@ -3481,11 +3726,24 @@ if (__Pyx_SetAttrString(__pyx_m, "FileStream", (PyObject *)&__pyx_type_5scipy_2io_6matlab_7streams_FileStream) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5scipy_2io_6matlab_7streams_FileStream = &__pyx_type_5scipy_2io_6matlab_7streams_FileStream; /*--- Type import code ---*/ + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pyx":44 + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":3 + * # -*- python -*- or near enough * + * import sys # <<<<<<<<<<<<<< + * + * from cpython cimport PyBytes_FromStringAndSize, \ + */ + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":44 + * * # initialize cStringIO * PycString_IMPORT # <<<<<<<<<<<<<< * @@ -3493,13 +3751,34 @@ */ PycString_IMPORT; - /* "/Users/mb312/dev_trees/scipy-work/scipy/io/matlab/streams.pxd":1 - * # -*- python -*- or rather like # <<<<<<<<<<<<<< + /* "/home/pauli/wrk/scipy/scipy/scipy/io/matlab/streams.pyx":1 + * # -*- python -*- or near enough # <<<<<<<<<<<<<< * - * cdef class GenericStream: + * import sys */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__make_stream); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_5), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + + /* "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-i686.egg/Cython/Includes/cpython/type.pxd":2 + * + * cdef extern from "Python.h": # <<<<<<<<<<<<<< + * # The C structure of the objects used to describe built-in types. + * + */ goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { __Pyx_AddTraceback("init scipy.io.matlab.streams"); Py_DECREF(__pyx_m); __pyx_m = 0; @@ -3515,15 +3794,14 @@ #endif } -static const char *__pyx_filenames[] = { - "streams.pyx", - "pyalloc.pxd", -}; - /* Runtime support code */ -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } static void __Pyx_RaiseDoubleKeywordsError( @@ -3668,12 +3946,38 @@ return 0; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; + +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { + PyObject *py_import = 0; + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) + goto bad; + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, NULL); +bad: + Py_XDECREF(empty_list); + Py_XDECREF(py_import); + Py_XDECREF(empty_dict); + return module; } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { @@ -3984,6 +4288,25 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -4213,10 +4536,10 @@ goto bad; } tmp.fp = f; -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); -#else - cobj = PyCapsule_New(tmp.p, sig, 0); #endif if (!cobj) goto bad; @@ -4232,10 +4555,10 @@ } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#else - PyObject *ob = PyCapsule_New(vtable, 0, 0); #endif if (!ob) goto bad; @@ -4285,7 +4608,11 @@ PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -4426,8 +4753,8 @@ /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } From scipy-svn at scipy.org Sat Sep 11 21:03:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:03:23 -0500 (CDT) Subject: [Scipy-svn] r6770 - in trunk: scipy/io tools Message-ID: <20100912010323.AEE9B39CD37@scipy.org> Author: ptvirtan Date: 2010-09-11 20:03:23 -0500 (Sat, 11 Sep 2010) New Revision: 6770 Modified: trunk/scipy/io/setup.py trunk/tools/py3tool.py Log: 3K: io: enable matlab package build Modified: trunk/scipy/io/setup.py =================================================================== --- trunk/scipy/io/setup.py 2010-09-12 01:02:58 UTC (rev 6769) +++ trunk/scipy/io/setup.py 2010-09-12 01:03:23 UTC (rev 6770) @@ -6,7 +6,7 @@ config.add_data_dir('tests') config.add_data_dir('docs') - #config.add_subpackage('matlab') + config.add_subpackage('matlab') config.add_subpackage('arff') return config Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-09-12 01:02:58 UTC (rev 6769) +++ trunk/tools/py3tool.py 2010-09-12 01:03:23 UTC (rev 6770) @@ -153,6 +153,10 @@ os.path.join('interpolate', 'ndgriddata.py'), os.path.join('io', 'array_import.py'), os.path.join('io', '__init__.py'), + os.path.join('io', 'matlab', 'miobase.py'), + os.path.join('io', 'matlab', 'mio4.py'), + os.path.join('io', 'matlab', 'mio5.py'), + os.path.join('io', 'matlab', 'mio5_params.py'), os.path.join('linalg', 'basic.py'), os.path.join('linalg', 'decomp.py'), os.path.join('linalg', 'lapack.py'), @@ -211,7 +215,8 @@ '_nd_image', 'numpyio', '_superlu', '_arpack', '_iterative', '_umfpack', - 'interpnd' + 'interpnd', + 'mio_utils', 'mio5_utils', 'streams' ]: text = re.sub(r'^(\s*)import %s' % mod, r'\1from . import %s' % mod, From scipy-svn at scipy.org Sat Sep 11 21:03:43 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:03:43 -0500 (CDT) Subject: [Scipy-svn] r6771 - in trunk/scipy/io: . tests Message-ID: <20100912010343.472C039CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:03:43 -0500 (Sat, 11 Sep 2010) New Revision: 6771 Added: trunk/scipy/io/tests/test_idl.py Removed: trunk/scipy/io/tests/test_idlsave.py Modified: trunk/scipy/io/idl.py Log: 3K: io: port idl.py and its tests Modified: trunk/scipy/io/idl.py =================================================================== --- trunk/scipy/io/idl.py 2010-09-12 01:03:23 UTC (rev 6770) +++ trunk/scipy/io/idl.py 2010-09-12 01:03:43 UTC (rev 6771) @@ -29,6 +29,7 @@ import struct import numpy as np +from numpy.compat import asbytes, asstr import tempfile import zlib import warnings @@ -91,7 +92,7 @@ def _read_byte(f): '''Read a single byte''' - return np.uint8(struct.unpack('>B', f.read(4)[0])[0]) + return np.uint8(struct.unpack('>B', f.read(4)[:1])[0]) def _read_long(f): @@ -153,9 +154,10 @@ if length > 0: chars = _read_bytes(f, length) _align_32(f) + chars = asstr(chars) else: chars = None - return np.str(chars) + return chars def _read_string_data(f): @@ -167,7 +169,7 @@ _align_32(f) else: string = None - return np.str(string) + return string def _read_data(f, dtype): @@ -623,27 +625,27 @@ variables = AttrDict() # Open the IDL file - f = file(file_name, 'rb') + f = open(file_name, 'rb') # Read the signature, which should be 'SR' signature = _read_bytes(f, 2) - if signature <> 'SR': + if signature <> asbytes('SR'): raise Exception("Invalid SIGNATURE: %s" % signature) # Next, the record format, which is '\x00\x04' for normal .sav # files, and '\x00\x06' for compressed .sav files. recfmt = _read_bytes(f, 2) - if recfmt == '\x00\x04': + if recfmt == asbytes('\x00\x04'): pass - elif recfmt == '\x00\x06': + elif recfmt == asbytes('\x00\x06'): if verbose: print "IDL Save file is compressed" if uncompressed_file_name: - fout = file(uncompressed_file_name, 'w+b') + fout = open(uncompressed_file_name, 'w+b') else: fout = tempfile.NamedTemporaryFile(suffix='.sav') @@ -651,14 +653,14 @@ print " -> expanding to %s" % fout.name # Write header - fout.write('SR\x00\x04') + fout.write(asbytes('SR\x00\x04')) # Cycle through records while True: # Read record type rectype = _read_long(f) - fout.write(struct.pack('>l', rectype)) + fout.write(struct.pack('>l', int(rectype))) # Read position of next record and return as int nextrec = _read_uint32(f) Copied: trunk/scipy/io/tests/test_idl.py (from rev 6770, trunk/scipy/io/tests/test_idlsave.py) =================================================================== --- trunk/scipy/io/tests/test_idl.py (rev 0) +++ trunk/scipy/io/tests/test_idl.py 2010-09-12 01:03:43 UTC (rev 6771) @@ -0,0 +1,224 @@ +from os import path + +DATA_PATH = path.join(path.dirname(__file__), 'data') + +import numpy as np +from numpy.compat import asbytes_nested, asbytes +from numpy.testing import assert_equal, assert_array_equal, run_module_suite +from nose.tools import assert_true + +from scipy.io.idl import readsav + + +def object_array(*args): + '''Constructs a numpy array of objects''' + array = np.empty(len(args), dtype=np.object) + for i in range(len(args)): + array[i] = args[i] + return array + + +def assert_identical(a, b): + '''Assert whether value AND type are the same''' + assert_equal(a, b) + if type(b) is np.str: + assert_equal(type(a), type(b)) + else: + assert_equal(np.asarray(a).dtype.type, np.asarray(b).dtype.type) + + +def assert_array_identical(a, b): + '''Assert whether values AND type are the same''' + assert_array_equal(a, b) + assert_equal(a.dtype.type, b.dtype.type) + + +class TestIdict: + '''Test the idict= argument to read''' + + def test_idict(self): + custom_dict = {'a': np.int16(999)} + original_id = id(custom_dict) + s = readsav(path.join(DATA_PATH, 'scalar_byte.sav'), idict=custom_dict, verbose=False) + assert_equal(original_id, id(s)) + assert_true('a' in s) + assert_identical(s['a'], np.int16(999)) + assert_identical(s['i8u'], np.uint8(234)) + + +class TestScalars: + '''Test that scalar values are read in with the correct value and type''' + + def test_byte(self): + s = readsav(path.join(DATA_PATH, 'scalar_byte.sav'), verbose=False) + assert_identical(s.i8u, np.uint8(234)) + + def test_int16(self): + s = readsav(path.join(DATA_PATH, 'scalar_int16.sav'), verbose=False) + assert_identical(s.i16s, np.int16(-23456)) + + def test_int32(self): + s = readsav(path.join(DATA_PATH, 'scalar_int32.sav'), verbose=False) + assert_identical(s.i32s, np.int32(-1234567890)) + + def test_float32(self): + s = readsav(path.join(DATA_PATH, 'scalar_float32.sav'), verbose=False) + assert_identical(s.f32, np.float32(-3.1234567e+37)) + + def test_float64(self): + s = readsav(path.join(DATA_PATH, 'scalar_float64.sav'), verbose=False) + assert_identical(s.f64, np.float64(-1.1976931348623157e+307)) + + def test_complex32(self): + s = readsav(path.join(DATA_PATH, 'scalar_complex32.sav'), verbose=False) + assert_identical(s.c32, np.complex64(3.124442e13-2.312442e31j)) + + def test_bytes(self): + s = readsav(path.join(DATA_PATH, 'scalar_string.sav'), verbose=False) + assert_identical(s.s, np.bytes_("The quick brown fox jumps over the lazy python")) + + def test_structure(self): + pass + + def test_complex64(self): + s = readsav(path.join(DATA_PATH, 'scalar_complex64.sav'), verbose=False) + assert_identical(s.c64, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) + + def test_heap_pointer(self): + pass + + def test_object_reference(self): + pass + + def test_uint16(self): + s = readsav(path.join(DATA_PATH, 'scalar_uint16.sav'), verbose=False) + assert_identical(s.i16u, np.uint16(65511)) + + def test_uint32(self): + s = readsav(path.join(DATA_PATH, 'scalar_uint32.sav'), verbose=False) + assert_identical(s.i32u, np.uint32(4294967233)) + + def test_int64(self): + s = readsav(path.join(DATA_PATH, 'scalar_int64.sav'), verbose=False) + assert_identical(s.i64s, np.int64(-9223372036854774567)) + + def test_uint64(self): + s = readsav(path.join(DATA_PATH, 'scalar_uint64.sav'), verbose=False) + assert_identical(s.i64u, np.uint64(18446744073709529285)) + + +class TestCompressed(TestScalars): + '''Test that compressed .sav files can be read in''' + + def test_compressed(self): + s = readsav(path.join(DATA_PATH, 'various_compressed.sav'), verbose=False) + assert_identical(s.i8u, np.uint8(234)) + assert_identical(s.f32, np.float32(-3.1234567e+37)) + assert_identical(s.c64, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) + assert_equal(s.array5d.shape, (4, 3, 4, 6, 5)) + assert_identical(s.arrays.a[0], np.array([1, 2, 3], dtype=np.int16)) + assert_identical(s.arrays.b[0], np.array([4., 5., 6., 7.], dtype=np.float32)) + assert_identical(s.arrays.c[0], np.array([np.complex64(1+2j), np.complex64(7+8j)])) + assert_identical(s.arrays.d[0], np.array(asbytes_nested(["cheese", "bacon", "spam"]), dtype=np.object)) + + +class TestArrayDimensions: + '''Test that multi-dimensional arrays are read in with the correct dimensions''' + + def test_1d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_1d.sav'), verbose=False) + assert_equal(s.array1d.shape, (123, )) + + def test_2d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_2d.sav'), verbose=False) + assert_equal(s.array2d.shape, (22, 12)) + + def test_3d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_3d.sav'), verbose=False) + assert_equal(s.array3d.shape, (11, 22, 12)) + + def test_4d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_4d.sav'), verbose=False) + assert_equal(s.array4d.shape, (4, 5, 8, 7)) + + def test_5d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_5d.sav'), verbose=False) + assert_equal(s.array5d.shape, (4, 3, 4, 6, 5)) + + def test_6d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_6d.sav'), verbose=False) + assert_equal(s.array6d.shape, (3, 6, 4, 5, 3, 4)) + + def test_7d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_7d.sav'), verbose=False) + assert_equal(s.array7d.shape, (2, 1, 2, 3, 4, 3, 2)) + + def test_8d(self): + s = readsav(path.join(DATA_PATH, 'array_float32_8d.sav'), verbose=False) + assert_equal(s.array8d.shape, (4, 3, 2, 1, 2, 3, 5, 4)) + + +class TestStructures: + '''Test that structures are correctly read in''' + + def test_scalars(self): + s = readsav(path.join(DATA_PATH, 'struct_scalars.sav'), verbose=False) + assert_identical(s.scalars.a, np.array(np.int16(1))) + assert_identical(s.scalars.b, np.array(np.int32(2))) + assert_identical(s.scalars.c, np.array(np.float32(3.))) + assert_identical(s.scalars.d, np.array(np.float64(4.))) + assert_identical(s.scalars.e, np.array(asbytes_nested(["spam"]), dtype=np.object)) + assert_identical(s.scalars.f, np.array(np.complex64(-1.+3j))) + + def test_scalars_replicated(self): + s = readsav(path.join(DATA_PATH, 'struct_scalars_replicated.sav'), verbose=False) + assert_identical(s.scalars_rep.a, np.repeat(np.int16(1), 5)) + assert_identical(s.scalars_rep.b, np.repeat(np.int32(2), 5)) + assert_identical(s.scalars_rep.c, np.repeat(np.float32(3.), 5)) + assert_identical(s.scalars_rep.d, np.repeat(np.float64(4.), 5)) + assert_identical(s.scalars_rep.e, np.repeat(asbytes("spam"), 5).astype(np.object)) + assert_identical(s.scalars_rep.f, np.repeat(np.complex64(-1.+3j), 5)) + + def test_arrays(self): + s = readsav(path.join(DATA_PATH, 'struct_arrays.sav'), verbose=False) + assert_array_identical(s.arrays.a[0], np.array([1, 2, 3], dtype=np.int16)) + assert_array_identical(s.arrays.b[0], np.array([4., 5., 6., 7.], dtype=np.float32)) + assert_array_identical(s.arrays.c[0], np.array([np.complex64(1+2j), np.complex64(7+8j)])) + assert_array_identical(s.arrays.d[0], np.array(asbytes_nested(["cheese", "bacon", "spam"]), dtype=np.object)) + + def test_arrays_replicated(self): + + s = readsav(path.join(DATA_PATH, 'struct_arrays_replicated.sav'), verbose=False) + + # Check column types + assert_true(s.arrays_rep.a.dtype.type is np.object_) + assert_true(s.arrays_rep.b.dtype.type is np.object_) + assert_true(s.arrays_rep.c.dtype.type is np.object_) + assert_true(s.arrays_rep.d.dtype.type is np.object_) + + # Check column shapes + assert_equal(s.arrays_rep.a.shape, (5, )) + assert_equal(s.arrays_rep.b.shape, (5, )) + assert_equal(s.arrays_rep.c.shape, (5, )) + assert_equal(s.arrays_rep.d.shape, (5, )) + + # Check values + for i in range(5): + assert_array_identical(s.arrays_rep.a[i], np.array([1, 2, 3], dtype=np.int16)) + assert_array_identical(s.arrays_rep.b[i], np.array([4., 5., 6., 7.], dtype=np.float32)) + assert_array_identical(s.arrays_rep.c[i], np.array([np.complex64(1+2j), np.complex64(7+8j)])) + assert_array_identical(s.arrays_rep.d[i], np.array(asbytes_nested(["cheese", "bacon", "spam"]), dtype=np.object)) + + +class TestPointers: + '''Check that pointers in .sav files produce references to the same object in Python''' + + def test_pointers(self): + s = readsav(path.join(DATA_PATH, 'scalar_heap_pointer.sav'), verbose=False) + assert_identical(s.c64_pointer1, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) + assert_identical(s.c64_pointer2, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) + assert_true(s.c64_pointer1 is s.c64_pointer2) + + +if __name__ == "__main__": + run_module_suite() Deleted: trunk/scipy/io/tests/test_idlsave.py =================================================================== --- trunk/scipy/io/tests/test_idlsave.py 2010-09-12 01:03:23 UTC (rev 6770) +++ trunk/scipy/io/tests/test_idlsave.py 2010-09-12 01:03:43 UTC (rev 6771) @@ -1,224 +0,0 @@ -from os import path - -DATA_PATH = path.join(path.dirname(__file__), 'data') - -import numpy as np - -from numpy.testing import assert_equal, assert_array_equal, run_module_suite -from nose.tools import assert_true - -from scipy.io.idl import readsav - - -def object_array(*args): - '''Constructs a numpy array of objects''' - array = np.empty(len(args), dtype=np.object) - for i in range(len(args)): - array[i] = args[i] - return array - - -def assert_identical(a, b): - '''Assert whether value AND type are the same''' - assert_equal(a, b) - if type(b) is np.str: - assert_equal(type(a), type(b)) - else: - assert_equal(a.dtype.type, b.dtype.type) - - -def assert_array_identical(a, b): - '''Assert whether values AND type are the same''' - assert_array_equal(a, b) - assert_equal(a.dtype.type, b.dtype.type) - - -class TestIdict: - '''Test the idict= argument to read''' - - def test_idict(self): - custom_dict = {'a': np.int16(999)} - original_id = id(custom_dict) - s = readsav(path.join(DATA_PATH, 'scalar_byte.sav'), idict=custom_dict, verbose=False) - assert_equal(original_id, id(s)) - assert_true('a' in s) - assert_identical(s['a'], np.int16(999)) - assert_identical(s['i8u'], np.uint8(234)) - - -class TestScalars: - '''Test that scalar values are read in with the correct value and type''' - - def test_byte(self): - s = readsav(path.join(DATA_PATH, 'scalar_byte.sav'), verbose=False) - assert_identical(s.i8u, np.uint8(234)) - - def test_int16(self): - s = readsav(path.join(DATA_PATH, 'scalar_int16.sav'), verbose=False) - assert_identical(s.i16s, np.int16(-23456)) - - def test_int32(self): - s = readsav(path.join(DATA_PATH, 'scalar_int32.sav'), verbose=False) - assert_identical(s.i32s, np.int32(-1234567890)) - - def test_float32(self): - s = readsav(path.join(DATA_PATH, 'scalar_float32.sav'), verbose=False) - assert_identical(s.f32, np.float32(-3.1234567e+37)) - - def test_float64(self): - s = readsav(path.join(DATA_PATH, 'scalar_float64.sav'), verbose=False) - assert_identical(s.f64, np.float64(-1.1976931348623157e+307)) - - def test_complex32(self): - s = readsav(path.join(DATA_PATH, 'scalar_complex32.sav'), verbose=False) - assert_identical(s.c32, np.complex64(3.124442e13-2.312442e31j)) - - def test_string(self): - s = readsav(path.join(DATA_PATH, 'scalar_string.sav'), verbose=False) - assert_identical(s.s, np.str("The quick brown fox jumps over the lazy python")) - - def test_structure(self): - pass - - def test_complex64(self): - s = readsav(path.join(DATA_PATH, 'scalar_complex64.sav'), verbose=False) - assert_identical(s.c64, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) - - def test_heap_pointer(self): - pass - - def test_object_reference(self): - pass - - def test_uint16(self): - s = readsav(path.join(DATA_PATH, 'scalar_uint16.sav'), verbose=False) - assert_identical(s.i16u, np.uint16(65511)) - - def test_uint32(self): - s = readsav(path.join(DATA_PATH, 'scalar_uint32.sav'), verbose=False) - assert_identical(s.i32u, np.uint32(4294967233)) - - def test_int64(self): - s = readsav(path.join(DATA_PATH, 'scalar_int64.sav'), verbose=False) - assert_identical(s.i64s, np.int64(-9223372036854774567)) - - def test_uint64(self): - s = readsav(path.join(DATA_PATH, 'scalar_uint64.sav'), verbose=False) - assert_identical(s.i64u, np.uint64(18446744073709529285)) - - -class TestCompressed(TestScalars): - '''Test that compressed .sav files can be read in''' - - def test_compressed(self): - s = readsav(path.join(DATA_PATH, 'various_compressed.sav'), verbose=False) - assert_identical(s.i8u, np.uint8(234)) - assert_identical(s.f32, np.float32(-3.1234567e+37)) - assert_identical(s.c64, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) - assert_equal(s.array5d.shape, (4, 3, 4, 6, 5)) - assert_identical(s.arrays.a[0], np.array([1, 2, 3], dtype=np.int16)) - assert_identical(s.arrays.b[0], np.array([4., 5., 6., 7.], dtype=np.float32)) - assert_identical(s.arrays.c[0], np.array([np.complex64(1+2j), np.complex64(7+8j)])) - assert_identical(s.arrays.d[0], np.array(["cheese", "bacon", "spam"], dtype=np.object)) - - -class TestArrayDimensions: - '''Test that multi-dimensional arrays are read in with the correct dimensions''' - - def test_1d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_1d.sav'), verbose=False) - assert_equal(s.array1d.shape, (123, )) - - def test_2d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_2d.sav'), verbose=False) - assert_equal(s.array2d.shape, (22, 12)) - - def test_3d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_3d.sav'), verbose=False) - assert_equal(s.array3d.shape, (11, 22, 12)) - - def test_4d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_4d.sav'), verbose=False) - assert_equal(s.array4d.shape, (4, 5, 8, 7)) - - def test_5d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_5d.sav'), verbose=False) - assert_equal(s.array5d.shape, (4, 3, 4, 6, 5)) - - def test_6d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_6d.sav'), verbose=False) - assert_equal(s.array6d.shape, (3, 6, 4, 5, 3, 4)) - - def test_7d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_7d.sav'), verbose=False) - assert_equal(s.array7d.shape, (2, 1, 2, 3, 4, 3, 2)) - - def test_8d(self): - s = readsav(path.join(DATA_PATH, 'array_float32_8d.sav'), verbose=False) - assert_equal(s.array8d.shape, (4, 3, 2, 1, 2, 3, 5, 4)) - - -class TestStructures: - '''Test that structures are correctly read in''' - - def test_scalars(self): - s = readsav(path.join(DATA_PATH, 'struct_scalars.sav'), verbose=False) - assert_identical(s.scalars.a, np.array(np.int16(1))) - assert_identical(s.scalars.b, np.array(np.int32(2))) - assert_identical(s.scalars.c, np.array(np.float32(3.))) - assert_identical(s.scalars.d, np.array(np.float64(4.))) - assert_identical(s.scalars.e, np.array(["spam"], dtype=np.object)) - assert_identical(s.scalars.f, np.array(np.complex64(-1.+3j))) - - def test_scalars_replicated(self): - s = readsav(path.join(DATA_PATH, 'struct_scalars_replicated.sav'), verbose=False) - assert_identical(s.scalars_rep.a, np.repeat(np.int16(1), 5)) - assert_identical(s.scalars_rep.b, np.repeat(np.int32(2), 5)) - assert_identical(s.scalars_rep.c, np.repeat(np.float32(3.), 5)) - assert_identical(s.scalars_rep.d, np.repeat(np.float64(4.), 5)) - assert_identical(s.scalars_rep.e, np.repeat("spam", 5).astype(np.object)) - assert_identical(s.scalars_rep.f, np.repeat(np.complex64(-1.+3j), 5)) - - def test_arrays(self): - s = readsav(path.join(DATA_PATH, 'struct_arrays.sav'), verbose=False) - assert_array_identical(s.arrays.a[0], np.array([1, 2, 3], dtype=np.int16)) - assert_array_identical(s.arrays.b[0], np.array([4., 5., 6., 7.], dtype=np.float32)) - assert_array_identical(s.arrays.c[0], np.array([np.complex64(1+2j), np.complex64(7+8j)])) - assert_array_identical(s.arrays.d[0], np.array(["cheese", "bacon", "spam"], dtype=np.object)) - - def test_arrays_replicated(self): - - s = readsav(path.join(DATA_PATH, 'struct_arrays_replicated.sav'), verbose=False) - - # Check column types - assert_true(s.arrays_rep.a.dtype.type is np.object_) - assert_true(s.arrays_rep.b.dtype.type is np.object_) - assert_true(s.arrays_rep.c.dtype.type is np.object_) - assert_true(s.arrays_rep.d.dtype.type is np.object_) - - # Check column shapes - assert_equal(s.arrays_rep.a.shape, (5, )) - assert_equal(s.arrays_rep.b.shape, (5, )) - assert_equal(s.arrays_rep.c.shape, (5, )) - assert_equal(s.arrays_rep.d.shape, (5, )) - - # Check values - for i in range(5): - assert_array_identical(s.arrays_rep.a[i], np.array([1, 2, 3], dtype=np.int16)) - assert_array_identical(s.arrays_rep.b[i], np.array([4., 5., 6., 7.], dtype=np.float32)) - assert_array_identical(s.arrays_rep.c[i], np.array([np.complex64(1+2j), np.complex64(7+8j)])) - assert_array_identical(s.arrays_rep.d[i], np.array(["cheese", "bacon", "spam"], dtype=np.object)) - - -class TestPointers: - '''Check that pointers in .sav files produce references to the same object in Python''' - - def test_pointers(self): - s = readsav(path.join(DATA_PATH, 'scalar_heap_pointer.sav'), verbose=False) - assert_identical(s.c64_pointer1, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) - assert_identical(s.c64_pointer2, np.complex128(1.1987253647623157e+112-5.1987258887729157e+307j)) - assert_true(s.c64_pointer1 is s.c64_pointer2) - - -if __name__ == "__main__": - run_module_suite() From scipy-svn at scipy.org Sat Sep 11 21:03:58 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:03:58 -0500 (CDT) Subject: [Scipy-svn] r6772 - trunk/scipy/io Message-ID: <20100912010358.6902239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:03:58 -0500 (Sat, 11 Sep 2010) New Revision: 6772 Modified: trunk/scipy/io/wavfile.py Log: 3K: io: port wavfile to Py3 Modified: trunk/scipy/io/wavfile.py =================================================================== --- trunk/scipy/io/wavfile.py 2010-09-12 01:03:43 UTC (rev 6771) +++ trunk/scipy/io/wavfile.py 2010-09-12 01:03:58 UTC (rev 6772) @@ -9,6 +9,7 @@ """ import numpy +from numpy.compat import asbytes import struct import warnings @@ -58,9 +59,9 @@ def _read_riff_chunk(fid): global _big_endian str1 = fid.read(4) - if str1 == 'RIFX': + if str1 == asbytes('RIFX'): _big_endian = True - elif str1 != 'RIFF': + elif str1 != asbytes('RIFF'): raise ValueError("Not a WAV file.") if _big_endian: fmt = '>I' @@ -68,9 +69,9 @@ fmt = '' or (data.dtype.byteorder == '=' and sys.byteorder == 'big'): From scipy-svn at scipy.org Sat Sep 11 21:04:14 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:04:14 -0500 (CDT) Subject: [Scipy-svn] r6773 - in trunk/scipy/io: . tests Message-ID: <20100912010414.8679D39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:04:14 -0500 (Sat, 11 Sep 2010) New Revision: 6773 Modified: trunk/scipy/io/mmio.py trunk/scipy/io/tests/test_mmio.py Log: 3K: io: port mmio to Py3 Modified: trunk/scipy/io/mmio.py =================================================================== --- trunk/scipy/io/mmio.py 2010-09-12 01:03:58 UTC (rev 6772) +++ trunk/scipy/io/mmio.py 2010-09-12 01:04:14 UTC (rev 6773) @@ -12,6 +12,7 @@ import os from numpy import asarray, real, imag, conj, zeros, ndarray, concatenate, \ ones, ascontiguousarray, vstack, savetxt, fromfile, fromstring +from numpy.compat import asbytes, asstr __all__ = ['mminfo','mmread','mmwrite', 'MMFile'] @@ -180,7 +181,7 @@ # read and validate header line line = source.readline() mmid, matrix, format, field, symmetry = \ - [part.strip().lower() for part in line.split()] + [asstr(part.strip().lower()) for part in line.split()] if not mmid.startswith('%%matrixmarket'): raise ValueError,'source is not in Matrix Market format' @@ -192,7 +193,7 @@ elif format == 'sparse': format = self.FORMAT_COORDINATE # skip comments - while line.startswith('%'): line = source.readline() + while line.startswith(asbytes('%')): line = source.readline() line = line.split() if format == self.FORMAT_ARRAY: @@ -210,7 +211,7 @@ #--------------------------------------------------------------------------- @staticmethod - def _open(filespec, mode='r'): + def _open(filespec, mode='rb'): """ Return an open file stream for reading based on source. If source is a file name, open it (after trying to find it with mtx and gzipped mtx @@ -237,7 +238,7 @@ stream = gzip.open(filespec, mode) elif filespec.endswith('.bz2'): import bz2 - stream = bz2.BZ2File(filespec, 'r') + stream = bz2.BZ2File(filespec, 'rb') else: stream = open(filespec, mode) @@ -301,7 +302,7 @@ #--------------------------------------------------------------------------- def write(self, target, a, comment='', field=None, precision=None): - stream, close_it = self._open(target, 'w') + stream, close_it = self._open(target, 'wb') try: self._write(stream, a, comment, field, precision) @@ -358,7 +359,7 @@ i,j = 0,0 while line: line = stream.readline() - if not line or line.startswith('%'): + if not line or line.startswith(asbytes('%')): continue if is_complex: aij = complex(*map(float,line.split())) @@ -389,7 +390,7 @@ k = 0 while line: line = stream.readline() - if not line or line.startswith('%'): + if not line or line.startswith(asbytes('%')): continue l = line.split() i,j = map(int,l[:2]) @@ -528,11 +529,11 @@ self.__class__._validate_symmetry(symm) # write initial header line - stream.write('%%%%MatrixMarket matrix %s %s %s\n' % (rep,field,symm)) + stream.write(asbytes('%%%%MatrixMarket matrix %s %s %s\n' % (rep,field,symm))) # write comments for line in comment.split('\n'): - stream.write('%%%s\n' % (line)) + stream.write(asbytes('%%%s\n' % (line))) template = self._field_template(field, precision) @@ -541,18 +542,18 @@ if rep == self.FORMAT_ARRAY: # write shape spec - stream.write('%i %i\n' % (rows,cols)) + stream.write(asbytes('%i %i\n' % (rows,cols))) if field in (self.FIELD_INTEGER, self.FIELD_REAL): if symm == self.SYMMETRY_GENERAL: for j in range(cols): for i in range(rows): - stream.write(template % a[i,j]) + stream.write(asbytes(template % a[i,j])) else: for j in range(cols): for i in range(j,rows): - stream.write(template % a[i,j]) + stream.write(asbytes(template % a[i,j])) elif field == self.FIELD_COMPLEX: @@ -560,12 +561,12 @@ for j in range(cols): for i in range(rows): aij = a[i,j] - stream.write(template % (real(aij),imag(aij))) + stream.write(asbytes(template % (real(aij),imag(aij)))) else: for j in range(cols): for i in range(j,rows): aij = a[i,j] - stream.write(template % (real(aij),imag(aij))) + stream.write(asbytes(template % (real(aij),imag(aij)))) elif field == self.FIELD_PATTERN: raise ValueError,'pattern type inconsisted with dense format' @@ -582,7 +583,7 @@ coo = a.tocoo() # convert to COOrdinate format # write shape spec - stream.write('%i %i %i\n' % (rows, cols, coo.nnz)) + stream.write(asbytes('%i %i %i\n' % (rows, cols, coo.nnz))) fmt = '%%.%dg' % precision Modified: trunk/scipy/io/tests/test_mmio.py =================================================================== --- trunk/scipy/io/tests/test_mmio.py 2010-09-12 01:03:58 UTC (rev 6772) +++ trunk/scipy/io/tests/test_mmio.py 2010-09-12 01:04:14 UTC (rev 6773) @@ -3,6 +3,7 @@ from tempfile import mktemp from numpy import array,transpose from numpy.testing import * +from numpy.compat import asbytes, asbytes_nested import scipy.sparse from scipy.io.mmio import mminfo,mmread,mmwrite @@ -183,7 +184,7 @@ ''' class TestMMIOCoordinate(TestCase): - def test_read_geneal(self): + def test_read_general(self): """read a general matrix""" fn = mktemp() f = open(fn,'w') From scipy-svn at scipy.org Sat Sep 11 21:04:30 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:04:30 -0500 (CDT) Subject: [Scipy-svn] r6774 - in trunk/scipy/io: . tests Message-ID: <20100912010430.98B9E39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:04:30 -0500 (Sat, 11 Sep 2010) New Revision: 6774 Modified: trunk/scipy/io/netcdf.py trunk/scipy/io/tests/test_netcdf.py Log: 3K: io: port netcdf to Py3 Modified: trunk/scipy/io/netcdf.py =================================================================== --- trunk/scipy/io/netcdf.py 2010-09-12 01:04:14 UTC (rev 6773) +++ trunk/scipy/io/netcdf.py 2010-09-12 01:04:30 UTC (rev 6774) @@ -82,21 +82,22 @@ from mmap import mmap, ACCESS_READ import numpy as np +from numpy.compat import asbytes, asstr from numpy import fromstring, ndarray, dtype, empty, array, asarray from numpy import little_endian as LITTLE_ENDIAN -ABSENT = '\x00\x00\x00\x00\x00\x00\x00\x00' -ZERO = '\x00\x00\x00\x00' -NC_BYTE = '\x00\x00\x00\x01' -NC_CHAR = '\x00\x00\x00\x02' -NC_SHORT = '\x00\x00\x00\x03' -NC_INT = '\x00\x00\x00\x04' -NC_FLOAT = '\x00\x00\x00\x05' -NC_DOUBLE = '\x00\x00\x00\x06' -NC_DIMENSION = '\x00\x00\x00\n' -NC_VARIABLE = '\x00\x00\x00\x0b' -NC_ATTRIBUTE = '\x00\x00\x00\x0c' +ABSENT = asbytes('\x00\x00\x00\x00\x00\x00\x00\x00') +ZERO = asbytes('\x00\x00\x00\x00') +NC_BYTE = asbytes('\x00\x00\x00\x01') +NC_CHAR = asbytes('\x00\x00\x00\x02') +NC_SHORT = asbytes('\x00\x00\x00\x03') +NC_INT = asbytes('\x00\x00\x00\x04') +NC_FLOAT = asbytes('\x00\x00\x00\x05') +NC_DOUBLE = asbytes('\x00\x00\x00\x06') +NC_DIMENSION = asbytes('\x00\x00\x00\n') +NC_VARIABLE = asbytes('\x00\x00\x00\x0b') +NC_ATTRIBUTE = asbytes('\x00\x00\x00\x0c') TYPEMAP = { NC_BYTE: ('b', 1), @@ -221,7 +222,7 @@ sync = flush def _write(self): - self.fp.write('CDF') + self.fp.write(asbytes('CDF')) self.fp.write(array(self.version_byte, '>b').tostring()) # Write headers and data. @@ -298,7 +299,7 @@ self._write_att_array(var._attributes) nc_type = REVERSE[var.typecode()] - self.fp.write(nc_type) + self.fp.write(asbytes(nc_type)) if not var.isrec: vsize = var.data.size * var.data.itemsize @@ -332,7 +333,7 @@ if not var.isrec: self.fp.write(var.data.tostring()) count = var.data.size * var.data.itemsize - self.fp.write('0' * (var._vsize - count)) + self.fp.write(asbytes('0') * (var._vsize - count)) else: # record variable # Handle rec vars with shape[0] < nrecs. if self._recs > len(var.data): @@ -350,7 +351,7 @@ self.fp.write(rec.tostring()) # Padding count = rec.size * rec.itemsize - self.fp.write('0' * (var._vsize - count)) + self.fp.write(asbytes('0') * (var._vsize - count)) pos += self._recsize self.fp.seek(pos) self.fp.seek(pos0 + var._vsize) @@ -381,7 +382,7 @@ values = asarray(values, dtype=dtype_) - self.fp.write(nc_type) + self.fp.write(asbytes(nc_type)) if values.dtype.char == 'S': nelems = values.itemsize @@ -394,12 +395,12 @@ values = values.byteswap() self.fp.write(values.tostring()) count = values.size * values.itemsize - self.fp.write('0' * (-count % 4)) # pad + self.fp.write(asbytes('0') * (-count % 4)) # pad def _read(self): # Check magic bytes and version magic = self.fp.read(3) - if not magic == 'CDF': + if not magic == asbytes('CDF'): raise TypeError("Error: %s is not a valid NetCDF 3 file" % self.filename) self.__dict__['version_byte'] = fromstring(self.fp.read(1), '>b')[0] @@ -419,7 +420,7 @@ count = self._unpack_int() for dim in range(count): - name = self._unpack_string() + name = asstr(self._unpack_string()) length = self._unpack_int() or None # None for record dimension self.dimensions[name] = length self._dims.append(name) # preserve order @@ -435,7 +436,7 @@ attributes = {} for attr in range(count): - name = self._unpack_string() + name = asstr(self._unpack_string()) attributes[name] = self._read_values() return attributes @@ -523,7 +524,7 @@ self.variables[var].__dict__['data'] = rec_array[var] def _read_var(self): - name = self._unpack_string() + name = asstr(self._unpack_string()) dimensions = [] shape = [] dims = self._unpack_int() @@ -558,14 +559,14 @@ typecode, size = TYPEMAP[nc_type] count = n*size - values = self.fp.read(count) + values = self.fp.read(int(count)) self.fp.read(-count % 4) # read padding if typecode is not 'c': values = fromstring(values, dtype='>%s%d' % (typecode, size)) if values.shape == (1,): values = values[0] else: - values = values.rstrip('\x00') + values = values.rstrip(asbytes('\x00')) return values def _pack_begin(self, begin): @@ -579,7 +580,7 @@ _pack_int32 = _pack_int def _unpack_int(self): - return fromstring(self.fp.read(4), '>i')[0] + return int(fromstring(self.fp.read(4), '>i')[0]) _unpack_int32 = _unpack_int def _pack_int64(self, value): @@ -591,12 +592,12 @@ def _pack_string(self, s): count = len(s) self._pack_int(count) - self.fp.write(s) - self.fp.write('0' * (-count % 4)) # pad + self.fp.write(asbytes(s)) + self.fp.write(asbytes('0') * (-count % 4)) # pad def _unpack_string(self): count = self._unpack_int() - s = self.fp.read(count).rstrip('\x00') + s = self.fp.read(count).rstrip(asbytes('\x00')) self.fp.read(-count % 4) # read padding return s Modified: trunk/scipy/io/tests/test_netcdf.py =================================================================== --- trunk/scipy/io/tests/test_netcdf.py 2010-09-12 01:04:14 UTC (rev 6773) +++ trunk/scipy/io/tests/test_netcdf.py 2010-09-12 01:04:30 UTC (rev 6774) @@ -5,10 +5,15 @@ import shutil import tempfile import time -from StringIO import StringIO +import sys +if sys.version_info[0] >= 3: + from io import BytesIO +else: + from StringIO import StringIO as BytesIO from glob import glob import numpy as np +from numpy.compat import asbytes from scipy.io.netcdf import netcdf_file @@ -33,9 +38,9 @@ def gen_for_simple(ncfileobj): ''' Generator for example fileobj tests ''' - yield assert_equal, ncfileobj.history, 'Created for a test' + yield assert_equal, ncfileobj.history, asbytes('Created for a test') time = ncfileobj.variables['time'] - yield assert_equal, str(time.units), 'days since 2008-01-01' + yield assert_equal, time.units, asbytes('days since 2008-01-01') yield assert_equal, time.shape, (N_EG_ELS,) yield assert_equal, time[-1], N_EG_ELS-1 @@ -67,7 +72,7 @@ # raised an error in pupynere 1.0.12 and scipy rev 5893, because # calculated vsize was rounding up in units of 4 - see # http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html - fobj = open('simple.nc', 'r') + fobj = open('simple.nc', 'rb') f = netcdf_file(fobj) # by default, don't use mmap for file-like yield assert_false, f.use_mmap @@ -83,30 +88,30 @@ def test_read_write_sio(): - eg_sio1 = StringIO() + eg_sio1 = BytesIO() f1 = make_simple(eg_sio1, 'w') str_val = eg_sio1.getvalue() f1.close() - eg_sio2 = StringIO(str_val) + eg_sio2 = BytesIO(str_val) f2 = netcdf_file(eg_sio2) for testargs in gen_for_simple(f2): yield testargs f2.close() # Test that error is raised if attempting mmap for sio - eg_sio3 = StringIO(str_val) + eg_sio3 = BytesIO(str_val) yield assert_raises, ValueError, netcdf_file, eg_sio3, 'r', True # Test 64-bit offset write / read - eg_sio_64 = StringIO() + eg_sio_64 = BytesIO() f_64 = make_simple(eg_sio_64, 'w', version=2) str_val = eg_sio_64.getvalue() f_64.close() - eg_sio_64 = StringIO(str_val) + eg_sio_64 = BytesIO(str_val) f_64 = netcdf_file(eg_sio_64) for testargs in gen_for_simple(f_64): yield testargs yield assert_equal, f_64.version_byte, 2 # also when version 2 explicitly specified - eg_sio_64 = StringIO(str_val) + eg_sio_64 = BytesIO(str_val) f_64 = netcdf_file(eg_sio_64, version=2) for testargs in gen_for_simple(f_64): yield testargs From scipy-svn at scipy.org Sat Sep 11 21:04:46 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:04:46 -0500 (CDT) Subject: [Scipy-svn] r6775 - in trunk/scipy/io: . tests Message-ID: <20100912010446.833C239CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:04:46 -0500 (Sat, 11 Sep 2010) New Revision: 6775 Removed: trunk/scipy/io/recaster.py trunk/scipy/io/tests/test_recaster.py Modified: trunk/scipy/io/__init__.py Log: DEP: io: remove deprecated recaster module Modified: trunk/scipy/io/__init__.py =================================================================== --- trunk/scipy/io/__init__.py 2010-09-12 01:04:30 UTC (rev 6774) +++ trunk/scipy/io/__init__.py 2010-09-12 01:04:46 UTC (rev 6775) @@ -13,7 +13,6 @@ # netCDF file support from netcdf import netcdf_file, netcdf_variable -from recaster import sctype_attributes, Recaster from matlab import byteordercodes from data_store import save_as_module from mmio import mminfo, mmread, mmwrite Deleted: trunk/scipy/io/recaster.py =================================================================== --- trunk/scipy/io/recaster.py 2010-09-12 01:04:30 UTC (rev 6774) +++ trunk/scipy/io/recaster.py 2010-09-12 01:04:46 UTC (rev 6775) @@ -1,483 +0,0 @@ -# Author: Matthew Brett - -""" -Recaster class for recasting numeric arrays -""" - -from numpy import * -from numpy.lib.utils import deprecate - -# deprecated in 0.8, will be removed in 0.9. - at deprecate -def sctype_attributes(): - """Return dictionary describing numpy scalar types - - .. deprecated:: sctype_attributes is deprecated in scipy 0.8 and - will be removed in scipy 0.9. - """ - return _sctype_attributes() - - -def _sctype_attributes(): - d_dict = {} - for sc_type in ('complex','float'): - t_list = sctypes[sc_type] - for T in t_list: - F = finfo(T) - dt = dtype(T) - d_dict[T] = { - 'kind': dt.kind, - 'size': dt.itemsize, - 'max': F.max, - 'min': F.min} - for T in sctypes['int']: - dt = dtype(T) - sz = dt.itemsize - bits = sz*8-1 - end = 2**bits - d_dict[T] = { - 'kind': dt.kind, - 'size': sz, - 'min': -end, - 'max': end-1 - } - for T in sctypes['uint']: - dt = dtype(T) - sz = dt.itemsize - bits = sz*8 - end = 2**bits - d_dict[T] = { - 'kind': dt.kind, - 'size': sz, - 'min': 0, - 'max': end - } - return d_dict - -class RecastError(ValueError): - pass - -# deprecated in 0.8, will be removed in 0.9. -class Recaster(object): - ''' Class to recast arrays to one of acceptable scalar types - - .. deprecated:: Recaster is deprecated in scipy 0.8 and will be - removed in scipy 0.9. - - Initialization specifies acceptable types (ATs) - - Implements recast method - returns array that may be of different - storage type to the input array, where the new type is one of the - ATs. Recast method will return a larger type if no smaller type - will contain the data without loss of precision greater than - specified in options at object creation. - ''' - - _sctype_attributes = _sctype_attributes() - _k = 2**10 - _option_defaults = { - 'only_if_none': { - 'fp_to_int': 'if_none', - 'fp_to_fp': 'if_none', - 'int_to_int': 'if_none', - 'int_to_fp': 'if_none', - 'downcast_only': False, - 'downcast_within_fp': False, - 'guarantee_fp_to_fp_precision': False, - 'prefer_input_at_threshold': 0, - 'prefer_int_type': 'i', - }, - 'smallest': { - 'fp_to_int': 'always', - 'fp_to_fp': 'always', - 'int_to_int': 'always', - 'int_to_fp': 'always', - 'downcast_only': False, - 'downcast_within_fp': True, - 'guarantee_fp_to_fp_precision': False, - 'prefer_input_at_threshold': 0, - 'prefer_int_type': 'i', - }, - 'fairly_small': { - 'fp_to_int': 'always', - 'fp_to_fp': 'if_none', - 'int_to_int': 'always', - 'int_to_fp': 'if_none', - 'downcast_only': False, - 'downcast_within_fp': False, - 'guarantee_fp_to_fp_precision': False, - 'prefer_input_at_threshold': 2 * _k, - 'prefer_int_type': 'i', - }, - 'preserve_precision': { - 'fp_to_int': 'never', - 'fp_to_fp': 'if_none', - 'int_to_int': 'if_none', - 'int_to_fp': 'never', - 'downcast_only': False, - 'downcast_within_fp': False, - 'guarantee_fp_to_fp_precision': True, - 'prefer_input_at_threshold': 0, - 'prefer_int_type': 'i', - } - } - - @deprecate - def __init__(self, sctype_list=None, - sctype_tols=None, - recast_options='only_if_none'): - ''' Set types for which we are attempting to downcast - - Input - sctype_list - list of acceptable scalar types - If None defaults to all system types - sctype_tols - dictionary key datatype, values rtol, tol - to specify tolerances for checking near equality in - downcasting. Note that tolerance values for integers - are used for upcasting integers to floats - recast_options - dictionary of options for recasting or string - specifying one of default options dictionaries. - - recast_option strings can be: - only_if_none - only attempts recast if the type is not in - acceptable types - smallest - return array of smallest possible type within tolerance - fairly_small - compromise set of options between speed of downcast and - size of output - preserve_precision - recasts arrays only to types that preserve precision - - Elements in recast_options dictionary: - fp_to_int - "always" or "if_none" or "never" - When to attempt cast of floating point to int - fp_to_fp - "always" or "if_none" or "never" - When to attempt cast of floating point to floating point - int_to_int - "always" or "if_none" or "never" - When to attempt cast of int to int - int_to_fp - "always" or "if_none" or "never" - When to attempt cast of int to floating point - downcast_only - if True, only return datatype of same size or less - downcast_within_fp - if True, tries downcasting within fp types, even - if there is an fp type that already matches - guarantee_fp_to_fp_precision - if True, will only do fp to fp array - casting to type of same or higher precision. Note that - if fp_to_int recasting is allowed this will allow - precision loss of fp values - prefer_input_at_threshold - number of bytes. If input array size - is less than or equal to this number, and in valid - types list, return the array without attempting - recasting - prefer_int_type - if 'i', when recasting to integer type, prefer int - when equal sized uint is also available. Prefer - uint otherwise. - ''' - if sctype_list is None: - sctype_list = self._sctype_attributes.keys() - self.sctype_list = sctype_list - # Tolerances - self.sctype_tols = self.default_sctype_tols() - if sctype_tols is not None: - self.sctype_tols.update(sctype_tols) - # Casting options - if recast_options is None: - recast_options = 'only_if_none' - if isinstance(recast_options, basestring): - try: - self.recast_options = self._option_defaults[recast_options] - except KeyError: - raise ValueError, \ - 'Did not recognize option string %s' % recast_options - else: - self.recast_options = self._option_defaults['only_if_none'] - self.recast_options.update(recast_options) - # Cache sctype sizes, - self.sized_sctypes = {} - for k in ('c', 'f', 'i', 'u'): - self.sized_sctypes[k] = self.sctypes_by_size(k) - # Cache all integer sizes - self.ints_sized_sctypes = [] - for k, v in self.sized_sctypes.items(): - if k in ('u', 'i'): - for e in v: - self.ints_sized_sctypes.append(e) - if self.ints_sized_sctypes: - self.ints_sized_sctypes.sort(lambda x, y: cmp(y[1], x[1])) - # Cache capable types list and sizes - self._capable_sctypes = {} - self._capable_sctype_sizes = {} - self._c2f_capable_sctype_sizes = {} - flts = self.sized_sctypes['f'] - for k in self._sctype_attributes: - sct = self.get_capable_sctype(k) - self._capable_sctypes[k] = sct - if sct is None: - self._capable_sctype_sizes[k] = inf - if dtype(k).type == 'c': - self._c2f_capable_sctype_sizes[k] = inf - continue - dtp = dtype(sct) - self._capable_sctype_sizes[k] = dtp.itemsize - fsz = inf - min_sz = ceil(dtp.itemsize / 2.0) - if dtp.kind == 'c': - for T, sz in flts: - if sz < min_sz: - break - fsz = sz - self._c2f_capable_sctype_sizes[k] = fsz - - def default_sctype_tols(self): - ''' Default allclose tolerance values for all dtypes ''' - t_dict = {} - for sc_type in ('complex','float'): - t_list = sctypes[sc_type] - for T in t_list: - dt = dtype(T) - F = finfo(dt) - t_dict[T] = { - 'rtol': F.eps, - 'atol': F.tiny} - F = finfo(float64) - for sc_type in ('int', 'uint'): - t_list = sctypes[sc_type] - for T in t_list: - dt = dtype(T) - t_dict[T] = { - 'rtol': F.eps, - 'atol': F.tiny} - return t_dict - - def sctypes_by_size(self, kind): - ''' Returns storage size ordered list of entries of scalar type sctype - - Input - kind - one of "c", "f", "i" or "u" - (for complex, float, integer, unsigned integer) - ''' - D = [] - for t in self.sctype_list: - dt = dtype(t) - if dt.kind == kind: - D.append([t, dt.itemsize]) - D.sort(lambda x, y: cmp(y[1], x[1])) - return D - - def get_capable_sctype(self, sct): - ''' Return smallest scalar type containing sct type without precision loss - - Input - sct - scalar type - - ID = input type. AT = acceptable type. Return ID if ID is - in ATs. Otherwise return smallest AT that is larger than or - same size as ID. - - If the desired sctype is an integer, returns the smallest - integer (int or uint) that can contain the range of the input - integer type - - If there is no type that can contain sct without loss of - precision, return None - ''' - if sct in self.sctype_list: - return sct - out_t = None - # Unsigned and signed integers - # Precision loss defined by max min outside datatype range - D = self._sctype_attributes[sct] - if D['kind'] in ('u', 'i'): - out_t = self.smallest_int_sctype(D['max'], D['min']) - else: - # Complex and float types - # Precision loss defined by data size < sct - sctypes = self.sized_sctypes[D['kind']] - if not sctypes: - return None - dti = D['size'] - out_t = None - for i, t in enumerate(sctypes): - if t[1] >= dti: - out_t = t[0] - else: - break - return out_t - - def cast_to_fp(self, arr, kind, - max_size=inf, - continue_down=False): - ''' Return fp arr maybe recast to specified kind, different sctype - - Inputs - arr - array to possibly recast - kind - kind of array to recast within - (one of "c", "f", "u", "i") - max_size - maximum size of sctype to return (in bytes) - continue_down - if False, return array of largest sctype - within tolerance and >= max_size - if True, continue downcasting within kind - to find smallest possible within tolerance - - If arr cannot be recast within given tolerances, and size, - return None - ''' - tols = self.sctype_tols[arr.dtype.type] - rtol, atol = tols['rtol'], tols['atol'] - ret_arr = None - for T, sz in self.sized_sctypes[kind]: - if sz > max_size: - continue - test_arr = arr.astype(T) - if allclose(test_arr, arr, rtol, atol): - ret_arr = test_arr - if not continue_down: - break - else: - break - return ret_arr - - def smallest_int_sctype(self, mx, mn, prefer='i'): - ''' Return integer type with smallest storage containing mx and mn - - Inputs - mx - maximum value - mn - minumum value - prefer - if == 'i' prefer int for range also compatible - uint, else prefer uint in same situation - - Returns None if no integer can contain this range - ''' - sct = None - sz = inf - for T, tsz in self.ints_sized_sctypes: - t_dict = self._sctype_attributes[T] - if t_dict['max'] >= mx and t_dict['min'] <= mn: - if tsz < sz: - sct = T - sz = tsz - elif tsz == sz: - if t_dict['kind'] == prefer: - sct = T - return sct - - def cast_to_integer(self, arr, prefer='i'): - ''' Casts arr to smallest integer containing range - - Returns None if range of arr cannot be contained in acceptable - integer types - - prefer - if == 'i' prefer int for range also compatible - uint, else prefer uint in same situation - - ''' - mx = amax(arr) - mn = amin(arr) - idt = self.smallest_int_sctype(mx, mn, prefer) - if idt is not None: - return arr.astype(idt) - return None - - def recast(self, arr): - ''' Recast array to type in type list - - If cannot recast to an array within tolerance, - raise error - ''' - dtp = arr.dtype - dtk = dtp.kind - dti = dtp.itemsize - dtt = dtp.type - opts = self.recast_options - curr_size = inf - ret_arr = None - valid_input_arr = dtt in self.sctype_list - if valid_input_arr: - if opts['prefer_input_at_threshold'] > arr.nbytes: - return arr - ret_arr = arr - if opts['downcast_only'] or valid_input_arr: - curr_size = dti - tols = self.sctype_tols[dtt] - rtol, atol = tols['rtol'], tols['atol'] - if dtk in ('c', 'f'): - if opts['fp_to_int'] == 'always' or \ - (opts['fp_to_int'] == 'if_none' and - ret_arr is None): - test_arr = self.cast_to_integer(arr, - opts['prefer_int_type']) - if test_arr is not None and \ - test_arr.dtype.itemsize < curr_size: - if allclose(arr, test_arr, rtol, atol): - ret_arr = test_arr - curr_size = ret_arr.dtype.itemsize - if opts['fp_to_fp'] == 'always' or \ - (opts['fp_to_fp'] == 'if_none' and - ret_arr is None): - if dtk == 'c' and not opts['guarantee_fp_to_fp_precision']: - # Try casting to float - max_size = min([self._c2f_capable_sctype_sizes[dtt], - curr_size - 1]) - test_arr = self.cast_to_fp(arr, - 'f', - max_size, - opts['downcast_within_fp']) - if test_arr is not None: - ret_arr = test_arr - curr_size = ret_arr.dtype.itemsize - if opts['fp_to_fp'] == 'always' or \ - (opts['fp_to_fp'] == 'if_none' and - ret_arr is None): - # Cast float or complex to another of same type - if opts['guarantee_fp_to_fp_precision']: - sct = self._capable_sctypes[dtt] - sz = self._capable_sctype_sizes[dtt] - if sz < curr_size and sct is not None: - ret_arr = arr.astype(sct) - curr_size = sz - else: - max_size = min([self._capable_sctype_sizes[dtt], - curr_size - 1]) - test_arr = self.cast_to_fp(arr, - dtk, - max_size, - opts['downcast_within_fp']) - if test_arr is not None: - ret_arr = test_arr - curr_size = ret_arr.dtype.itemsize - elif dtk in ('u', 'i'): - if opts['int_to_int'] == 'always' or \ - (opts['int_to_int'] == 'if_none' and - ret_arr is None): - test_arr = self.cast_to_integer(arr, - opts['prefer_int_type']) - if test_arr is not None and \ - test_arr.dtype.itemsize < curr_size: - ret_arr = test_arr - curr_size = ret_arr.dtype.itemsize - if opts['int_to_fp'] == 'always' or \ - (opts['int_to_fp'] == 'if_none' and - ret_arr is None): - test_arr = self.cast_to_fp(arr, - 'f', - curr_size-1, - opts['downcast_within_fp']) - if test_arr is not None: - ret_arr = test_arr - else: - raise TypeError, 'Do not recognize array kind %s' % dtk - - if ret_arr is not None: - return ret_arr - raise RecastError, 'Cannot recast array within tolerance' - - def recast_best_sctype(self, arr): - ''' Recast array, return closest sctype to original - - Returns tuple of recast array and best sctype to contain - original data before recasting - ''' - sct = arr.dtype.type - arr = self.recast(arr) - if sct not in self.sctype_list: - sct = self._capable_sctypes[sct] - if sct is None: - sct = arr.dtype.type - return arr, sct Deleted: trunk/scipy/io/tests/test_recaster.py =================================================================== --- trunk/scipy/io/tests/test_recaster.py 2010-09-12 01:04:30 UTC (rev 6774) +++ trunk/scipy/io/tests/test_recaster.py 2010-09-12 01:04:46 UTC (rev 6775) @@ -1,175 +0,0 @@ -import warnings - -import numpy as np -from numpy.testing import * - -from scipy.io.recaster import sctype_attributes, Recaster, RecastError - -class TestRecaster(TestCase): - - def test_init(self): - # Setting sctype_list - R = Recaster() - assert set(R.sctype_list) == set(sctype_attributes().keys()), \ - 'Default recaster should include all system types' - T = np.float32 - R = Recaster([T]) - assert R.sctype_list == [T], 'Scalar type list not correctly set' - # Setting tolerances - R = Recaster() - tols = R.default_sctype_tols() - assert tols == R.sctype_tols, 'Unexpected tols dictionary' - F = np.finfo(T) - R = Recaster(sctype_tols={T: { - 'rtol': F.eps*2, - 'atol': F.tiny*2, - 'silly': 'silly text'}}) - assert R.sctype_tols[T]['rtol'] == F.eps*2, \ - 'Rtol not correctly set' - assert R.sctype_tols[T]['atol'] == F.tiny*2, \ - 'Atol not correctly set' - T = np.complex128 - F = np.finfo(T) - assert R.sctype_tols[T]['rtol'] == F.eps, \ - 'Rtol defaults not correctly set' - assert R.sctype_tols[T]['atol'] == F.tiny, \ - 'Atol defaults not correctly set' - # Options - # Sctype size lists - # Integer sizes - # Cabable types - - def test_cast_to_fp(self): - R = Recaster() - # Define expected type output from fp recast of value - sta = sctype_attributes() - inp_outp = ( - (1, np.complex128, 'c', sta[np.complex128]['size'], 0, np.complex128), - (1, np.complex128, 'c', sta[np.complex128]['size'], 1, np.complex64), - (1, np.complex128, 'c', sta[np.complex64]['size'], 0, np.complex64), - (1, np.complex128, 'f', sta[np.float64]['size'], 0, np.float64), - (1.0+1j, np.complex128, 'f', sta[np.complex128]['size'], 0, None), - (1, np.float64, 'f', sta[np.float64]['size'], 0, np.float64), - (1, np.float64, 'f', sta[np.float64]['size'], 1, np.float32), - (1, np.float64, 'f', sta[np.float32]['size'], 0, np.float32), - (1, np.float64, 'c', sta[np.complex128]['size'], 0, np.complex128), - (1, np.float64, 'c', sta[np.complex128]['size'], 1, np.complex64), - (1, np.int32, 'f', sta[np.float64]['size'], 0, np.float64), - (1, np.int32, 'f', sta[np.float64]['size'], 1, np.float32), - (1, np.float64, 'f', 0, 0, None), - ) - for value, inp, kind, max_size, continue_down, outp in inp_outp: - arr = np.array(value, dtype=inp) - arr = R.cast_to_fp(arr, kind, max_size, continue_down) - if outp is None: - assert arr is None, \ - 'Expected None from type %s, got %s' \ - % (inp, arr.dtype.type) - continue - assert arr is not None, \ - 'Expected %s from %s, got None' % (outp, inp) - dtt = arr.dtype.type - assert dtt is outp, \ - 'Expected %s from %s, got %s' % (outp, inp, dtt) - - def test_smallest_int_sctype(self): - # Smallest int sctype with full recaster - params = sctype_attributes() - RF = Recaster() - test_triples = [(np.uint8, 0, 255), - (np.int8, -128, 0), - (np.uint16, 0, params[np.uint16]['max']), - (np.int16, params[np.int16]['min'], 0), - (np.uint32, 0, params[np.uint32]['max']), - (np.int32, params[np.int32]['min'], 0), - (np.uint64, 0, params[np.uint64]['max']), - (np.int64, params[np.int64]['min'], 0)] - for T, mn, mx in test_triples: - rt = RF.smallest_int_sctype(mx, mn) - assert np.dtype(rt) == np.dtype(T), \ - 'Expected %s, got %s type' % (T, rt) - # Smallest int sctype with restricted recaster - mmax = params[np.int32]['max'] - mmin = params[np.int32]['min'] - RR = Recaster([np.int32]) - for kind in ('int', 'uint'): - for T in np.sctypes[kind]: - mx = params[T]['max'] - mn = params[T]['min'] - rt = RR.smallest_int_sctype(mx, mn) - if mx <= mmax and mn >= mmin: - assert rt == np.int32, \ - 'Expected int32 type, got %s' % rt - else: - assert rt is None, \ - 'Expected None, got %s for %s' % (T, rt) - # Test preferred int flag - mx = 1000 - mn = 0 - rt = RF.smallest_int_sctype(mx, mn) - assert rt == np.int16, 'Expected int16, got %s' % rt - rt = RF.smallest_int_sctype(mx, mn, 'i') - assert rt == np.int16, 'Expected int16, got %s' % rt - rt = RF.smallest_int_sctype(mx, mn, prefer='u') - assert rt == np.uint16, 'Expected uint16, got %s' % rt - - def test_recasts(self): - valid_types = [np.int32, np.complex128, np.float64] - # Test smallest - R = Recaster(valid_types, recast_options='smallest') - inp_outp = ( - (1, np.complex128, np.int32), - (1, np.complex64, np.int32), - (1.0+1j, np.complex128, np.complex128), - (1.0+1j, np.complex64, np.complex128), - (1, np.float64, np.int32), - (1, np.float32, np.int32), - (1.1, np.float64, np.float64), - (-1e12, np.int64, np.float64), - ) - self.run_io_recasts(R, inp_outp) - # Test only_if_none - R = Recaster(valid_types, recast_options='only_if_none') - inp_outp = ( - (1, np.complex128, np.complex128), - (1, np.complex64, np.int32), - (1.0+1j, np.complex128, np.complex128), - (1.0+1j, np.complex64, np.complex128), - (1, np.float64, np.float64), - (1, np.float32, np.int32), - (1.1, np.float64, np.float64), - (-1e12, np.int64, np.float64), - ) - self.run_io_recasts(R, inp_outp) - # Test preserve_precision - R = Recaster(valid_types, recast_options='preserve_precision') - inp_outp = ( - (1, np.complex128, np.complex128), - (1, np.complex64, np.complex128), - (1.0+1j, np.complex128, np.complex128), - (1.0+1j, np.complex64, np.complex128), - (1, np.float64, np.float64), - (1, np.float32, np.float64), - (1.1, np.float64, np.float64), - (-1e12, np.int64, None), - ) - self.run_io_recasts(R, inp_outp) - - def run_io_recasts(self, R, inp_outp): - ''' Runs sets of value, input, output tests ''' - for value, inp, outp in inp_outp: - arr = np.array(value, inp) - if outp is None: - self.assertRaises(RecastError, R.recast, arr) - continue - arr = R.recast(np.array(value, inp)) - assert arr is not None, \ - 'Expected %s from %s, got None' % (outp, inp) - dtt = arr.dtype.type - assert dtt is outp, \ - 'Expected %s from %s, got %s' % (outp, inp, dtt) - -warnings.simplefilter('ignore', category=DeprecationWarning) - -if __name__ == "__main__": - run_module_suite() From scipy-svn at scipy.org Sat Sep 11 21:04:59 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:04:59 -0500 (CDT) Subject: [Scipy-svn] r6776 - trunk/scipy/weave Message-ID: <20100912010459.D124C39CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:04:59 -0500 (Sat, 11 Sep 2010) New Revision: 6776 Modified: trunk/scipy/weave/build_tools.py Log: 3K: weave: 'exceptions' module is no more Modified: trunk/scipy/weave/build_tools.py =================================================================== --- trunk/scipy/weave/build_tools.py 2010-09-12 01:04:46 UTC (rev 6775) +++ trunk/scipy/weave/build_tools.py 2010-09-12 01:04:59 UTC (rev 6776) @@ -21,7 +21,6 @@ import os import time import tempfile -import exceptions import commands import subprocess import warnings @@ -73,7 +72,7 @@ # end force g++ -class CompileError(exceptions.Exception): +class CompileError(Exception): pass From scipy-svn at scipy.org Sat Sep 11 21:05:11 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:05:11 -0500 (CDT) Subject: [Scipy-svn] r6777 - trunk/doc Message-ID: <20100912010511.E1CD339CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:05:11 -0500 (Sat, 11 Sep 2010) New Revision: 6777 Modified: trunk/doc/Py3K.txt Log: 3K: doc: update status Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-09-12 01:04:59 UTC (rev 6776) +++ trunk/doc/Py3K.txt 2010-09-12 01:05:11 UTC (rev 6777) @@ -10,6 +10,7 @@ * fftpack OK * integrate OK * interpolate OK +* io OK * lib OK * linalg OK * maxentropy OK @@ -18,11 +19,9 @@ * odr OK * optimize OK * signal OK +* sparse OK * spatial OK * special OK +* stats OK - -* io ERROR (matlab stuff) -* sparse ERROR -* stats ERROR * weave ERROR From scipy-svn at scipy.org Sat Sep 11 21:05:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:05:23 -0500 (CDT) Subject: [Scipy-svn] r6778 - trunk Message-ID: <20100912010523.643A839CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:05:23 -0500 (Sat, 11 Sep 2010) New Revision: 6778 Modified: trunk/MANIFEST.in Log: 3K: add py3tool.py to sdist Modified: trunk/MANIFEST.in =================================================================== --- trunk/MANIFEST.in 2010-09-12 01:05:11 UTC (rev 6777) +++ trunk/MANIFEST.in 2010-09-12 01:05:23 UTC (rev 6778) @@ -10,6 +10,8 @@ include scipy/*.py # Adding scons build relateed files not found by distutils recursive-include scipy SConstruct SConscript +# Add py3tool +include tools/py3tool.py # Add documentation: we don't use add_data_dir since we do not want to include # this at installation, only for sdist-generated tarballs include doc/Makefile doc/postprocess.py From scipy-svn at scipy.org Sat Sep 11 21:05:37 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 20:05:37 -0500 (CDT) Subject: [Scipy-svn] r6779 - trunk/scipy/fftpack/tests Message-ID: <20100912010537.ED3F739CC7C@scipy.org> Author: ptvirtan Date: 2010-09-11 20:05:37 -0500 (Sat, 11 Sep 2010) New Revision: 6779 Modified: trunk/scipy/fftpack/tests/test_basic.py Log: TST: fftpack: initialize random seed to make tests deterministic Modified: trunk/scipy/fftpack/tests/test_basic.py =================================================================== --- trunk/scipy/fftpack/tests/test_basic.py 2010-09-12 01:05:23 UTC (rev 6778) +++ trunk/scipy/fftpack/tests/test_basic.py 2010-09-12 01:05:37 UTC (rev 6779) @@ -93,6 +93,7 @@ def setUp(self): self.cdt = None self.rdt = None + np.random.seed(1234) def test_definition(self): x = np.array([1,2,3,4+1j,1,2,3,4+2j], dtype = self.cdt) @@ -146,6 +147,9 @@ self.rdt = np.float32 class _TestIFFTBase(TestCase): + def setUp(self): + np.random.seed(1234) + def test_definition(self): x = np.array([1,2,3,4+1j,1,2,3,4+2j], self.cdt) y = ifft(x) @@ -216,6 +220,8 @@ self.rdt = np.float32 class _TestRFFTBase(TestCase): + def setUp(self): + np.random.seed(1234) def test_definition(self): for t in [[1, 2, 3, 4, 1, 2, 3, 4], [1, 2, 3, 4, 1, 2, 3, 4, 5]]: @@ -252,6 +258,8 @@ self.rdt = np.float32 class _TestIRFFTBase(TestCase): + def setUp(self): + np.random.seed(1234) def test_definition(self): x1 = [1,2,3,4,1,2,3,4] @@ -312,6 +320,9 @@ self.ndec = 5 class Testfft2(TestCase): + def setUp(self): + np.random.seed(1234) + def test_regression_244(self): """fft returns wrong result with axes parameter.""" # fftn (and hence fft2) used to break when both axes and shape were @@ -322,6 +333,9 @@ assert_array_almost_equal(y, y_r) class TestFftnSingle(TestCase): + def setUp(self): + np.random.seed(1234) + def test_definition(self): x = [[1,2,3],[4,5,6],[7,8,9]] y = fftn(np.array(x, np.float32)) @@ -332,6 +346,8 @@ assert_array_almost_equal_nulp(y, y_r) class TestFftn(TestCase): + def setUp(self): + np.random.seed(1234) def test_definition(self): x = [[1,2,3],[4,5,6],[7,8,9]] @@ -489,6 +505,10 @@ class _TestIfftn(TestCase): dtype = None cdtype = None + + def setUp(self): + np.random.seed(1234) + def test_definition(self): x = np.array([[1,2,3],[4,5,6],[7,8,9]], dtype=self.dtype) y = ifftn(x) @@ -516,6 +536,8 @@ maxnlp = 2000 class TestLongDoubleFailure(TestCase): + def setUp(self): + np.random.seed(1234) def test_complex(self): if np.dtype(np.longcomplex).itemsize == np.dtype(np.complex).itemsize: From scipy-svn at scipy.org Sat Sep 11 23:14:32 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 22:14:32 -0500 (CDT) Subject: [Scipy-svn] r6780 - in trunk/scipy/sparse/linalg/isolve: . tests Message-ID: <20100912031432.2C94E39CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-11 22:14:32 -0500 (Sat, 11 Sep 2010) New Revision: 6780 Added: trunk/scipy/sparse/linalg/isolve/tests/test_utils.py Modified: trunk/scipy/sparse/linalg/isolve/utils.py Log: BUG: sparse.linalg.isolve.utils: should be , not (fixes #1257). Added: trunk/scipy/sparse/linalg/isolve/tests/test_utils.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/tests/test_utils.py (rev 0) +++ trunk/scipy/sparse/linalg/isolve/tests/test_utils.py 2010-09-12 03:14:32 UTC (rev 6780) @@ -0,0 +1,9 @@ + +import numpy as np +from numpy.testing import assert_raises + +from scipy.sparse.linalg import utils + + +def test_make_system_bad_shape(): + assert_raises(ValueError, utils.make_system, np.zeros((5,3)), None, np.zeros(4), np.zeros(4)) Modified: trunk/scipy/sparse/linalg/isolve/utils.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/utils.py 2010-09-12 01:05:37 UTC (rev 6779) +++ trunk/scipy/sparse/linalg/isolve/utils.py 2010-09-12 03:14:32 UTC (rev 6780) @@ -62,7 +62,7 @@ A = aslinearoperator(A) if A.shape[0] != A.shape[1]: - raise ValueError('expected square matrix (shape=%s)' % shape) + raise ValueError('expected square matrix, but got shape=%s' % (A.shape,)) N = A.shape[0] From scipy-svn at scipy.org Sun Sep 12 00:28:18 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 11 Sep 2010 23:28:18 -0500 (CDT) Subject: [Scipy-svn] r6781 - in trunk/scipy/io/arff: . tests Message-ID: <20100912042818.D746739CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-11 23:28:18 -0500 (Sat, 11 Sep 2010) New Revision: 6781 Modified: trunk/scipy/io/arff/arffread.py trunk/scipy/io/arff/tests/test_data.py Log: BUG: io.arff: Ensure that the order of the types returned by MetaData.types() matches the order of the names returned by MetaData.names(). Fixes #966. Modified: trunk/scipy/io/arff/arffread.py =================================================================== --- trunk/scipy/io/arff/arffread.py 2010-09-12 03:14:32 UTC (rev 6780) +++ trunk/scipy/io/arff/arffread.py 2010-09-12 04:28:18 UTC (rev 6781) @@ -450,7 +450,8 @@ def types(self): """Return the list of attribute types.""" - return [v[0] for v in self._attributes.values()] + attr_types = [self._attributes[name][0] for name in self._attrnames] + return attr_types def loadarff(filename): Modified: trunk/scipy/io/arff/tests/test_data.py =================================================================== --- trunk/scipy/io/arff/tests/test_data.py 2010-09-12 03:14:32 UTC (rev 6780) +++ trunk/scipy/io/arff/tests/test_data.py 2010-09-12 04:28:18 UTC (rev 6781) @@ -1,14 +1,16 @@ #!/usr/bin/env python """Tests for parsing full arff files.""" + import os from os.path import join as pjoin import numpy as np -from numpy.testing import TestCase, assert_array_almost_equal +from numpy.testing import TestCase, assert_array_almost_equal, assert_equal from scipy.io.arff.arffread import loadarff + data_path = pjoin(os.path.dirname(__file__), 'data') test4 = pjoin(data_path, 'test4.arff') @@ -16,6 +18,7 @@ expect4_data = [(0.1, 0.2, 0.3, 0.4, 'class1'), (-0.1, -0.2, -0.3, -0.4, 'class2'), (1, 2, 3, 4, 'class3')] +expected_types = ['numeric', 'numeric', 'numeric', 'numeric', 'nominal'] missing = pjoin(data_path, 'missing.arff') expect_missing_raw = np.array([[1, 5], [2, 4], [np.nan, np.nan]]) @@ -23,6 +26,7 @@ expect_missing['yop'] = expect_missing_raw[:, 0] expect_missing['yap'] = expect_missing_raw[:, 1] + class DataTest(TestCase): def test1(self): """Parsing trivial file with nothing.""" @@ -37,12 +41,11 @@ for i in range(len(data)): for j in range(4): assert_array_almost_equal(expect4_data[i][j], data[i][j]) + assert_equal(meta.types(), expected_types) + class MissingDataTest(TestCase): def test_missing(self): data, meta = loadarff(missing) for i in ['yop', 'yap']: assert_array_almost_equal(data[i], expect_missing[i]) - - - From scipy-svn at scipy.org Sun Sep 12 13:20:55 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 12:20:55 -0500 (CDT) Subject: [Scipy-svn] r6782 - trunk/scipy/io/arff Message-ID: <20100912172055.0AA4D39CC9C@scipy.org> Author: ptvirtan Date: 2010-09-12 12:20:54 -0500 (Sun, 12 Sep 2010) New Revision: 6782 Modified: trunk/scipy/io/arff/__init__.py trunk/scipy/io/arff/setup.py Log: TST: io/arff: add test() method to subpackage, and install the tests Modified: trunk/scipy/io/arff/__init__.py =================================================================== --- trunk/scipy/io/arff/__init__.py 2010-09-12 04:28:18 UTC (rev 6781) +++ trunk/scipy/io/arff/__init__.py 2010-09-12 17:20:54 UTC (rev 6782) @@ -10,3 +10,6 @@ import arffread __all__ = arffread.__all__ + +from numpy.testing import Tester +test = Tester().test Modified: trunk/scipy/io/arff/setup.py =================================================================== --- trunk/scipy/io/arff/setup.py 2010-09-12 04:28:18 UTC (rev 6781) +++ trunk/scipy/io/arff/setup.py 2010-09-12 17:20:54 UTC (rev 6782) @@ -3,7 +3,7 @@ def configuration(parent_package='io',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('arff', parent_package, top_path) - #config.add_data_dir('tests') + config.add_data_dir('tests') return config if __name__ == '__main__': From scipy-svn at scipy.org Sun Sep 12 13:21:12 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 12:21:12 -0500 (CDT) Subject: [Scipy-svn] r6783 - trunk/scipy/io/arff/tests Message-ID: <20100912172112.28F1139CC9C@scipy.org> Author: ptvirtan Date: 2010-09-12 12:21:12 -0500 (Sun, 12 Sep 2010) New Revision: 6783 Added: trunk/scipy/io/arff/tests/test_arffread.py Removed: trunk/scipy/io/arff/tests/test_data.py trunk/scipy/io/arff/tests/test_header.py Log: TST: io/arff: reorganize arff tests Added: trunk/scipy/io/arff/tests/test_arffread.py =================================================================== --- trunk/scipy/io/arff/tests/test_arffread.py (rev 0) +++ trunk/scipy/io/arff/tests/test_arffread.py 2010-09-12 17:21:12 UTC (rev 6783) @@ -0,0 +1,99 @@ +#!/usr/bin/env python +import os +from os.path import join as pjoin + +import numpy as np + +from numpy.testing import TestCase, assert_array_almost_equal, assert_equal + +from scipy.io.arff.arffread import loadarff +from scipy.io.arff.arffread import read_header, parse_type, ParseArffError + +data_path = pjoin(os.path.dirname(__file__), 'data') + +test1 = os.path.join(data_path, 'test1.arff') +test2 = os.path.join(data_path, 'test2.arff') +test3 = os.path.join(data_path, 'test3.arff') + +test4 = pjoin(data_path, 'test4.arff') +test5 = pjoin(data_path, 'test5.arff') +expect4_data = [(0.1, 0.2, 0.3, 0.4, 'class1'), + (-0.1, -0.2, -0.3, -0.4, 'class2'), + (1, 2, 3, 4, 'class3')] +expected_types = ['numeric', 'numeric', 'numeric', 'numeric', 'nominal'] + +missing = pjoin(data_path, 'missing.arff') +expect_missing_raw = np.array([[1, 5], [2, 4], [np.nan, np.nan]]) +expect_missing = np.empty(3, [('yop', np.float), ('yap', np.float)]) +expect_missing['yop'] = expect_missing_raw[:, 0] +expect_missing['yap'] = expect_missing_raw[:, 1] + +class DataTest(TestCase): + def test1(self): + """Parsing trivial file with nothing.""" + self._test(test4) + + def test2(self): + """Parsing trivial file with some comments in the data section.""" + self._test(test5) + + def _test(self, test_file): + data, meta = loadarff(test_file) + for i in range(len(data)): + for j in range(4): + assert_array_almost_equal(expect4_data[i][j], data[i][j]) + assert_equal(meta.types(), expected_types) + + +class MissingDataTest(TestCase): + def test_missing(self): + data, meta = loadarff(missing) + for i in ['yop', 'yap']: + assert_array_almost_equal(data[i], expect_missing[i]) + +class HeaderTest(TestCase): + def test_type_parsing(self): + """Test parsing type of attribute from their value.""" + ofile = open(test2) + rel, attrs = read_header(ofile) + + expected = ['numeric', 'numeric', 'numeric', 'numeric', 'numeric', + 'numeric', 'string', 'string', 'nominal', 'nominal'] + + for i in range(len(attrs)): + assert parse_type(attrs[i][1]) == expected[i] + + def test_badtype_parsing(self): + """Test parsing wrong type of attribute from their value.""" + ofile = open(test3) + rel, attrs = read_header(ofile) + + for name, value in attrs: + try: + parse_type(value) + raise Error("Could parse type of crap, should not happen.") + except ParseArffError: + pass + + def test_fullheader1(self): + """Parsing trivial header with nothing.""" + ofile = open(test1) + rel, attrs = read_header(ofile) + + # Test relation + assert rel == 'test1' + + # Test numerical attributes + assert len(attrs) == 5 + for i in range(4): + assert attrs[i][0] == 'attr%d' % i + assert attrs[i][1] == 'REAL' + classes = attrs[4][1] + + # Test nominal attribute + assert attrs[4][0] == 'class' + assert attrs[4][1] == '{class0, class1, class2, class3}' + +if __name__ == "__main__": + import nose + nose.run(argv=['', __file__]) Deleted: trunk/scipy/io/arff/tests/test_data.py =================================================================== --- trunk/scipy/io/arff/tests/test_data.py 2010-09-12 17:20:54 UTC (rev 6782) +++ trunk/scipy/io/arff/tests/test_data.py 2010-09-12 17:21:12 UTC (rev 6783) @@ -1,51 +0,0 @@ -#!/usr/bin/env python -"""Tests for parsing full arff files.""" - -import os -from os.path import join as pjoin - -import numpy as np - -from numpy.testing import TestCase, assert_array_almost_equal, assert_equal - -from scipy.io.arff.arffread import loadarff - - -data_path = pjoin(os.path.dirname(__file__), 'data') - -test4 = pjoin(data_path, 'test4.arff') -test5 = pjoin(data_path, 'test5.arff') -expect4_data = [(0.1, 0.2, 0.3, 0.4, 'class1'), - (-0.1, -0.2, -0.3, -0.4, 'class2'), - (1, 2, 3, 4, 'class3')] -expected_types = ['numeric', 'numeric', 'numeric', 'numeric', 'nominal'] - -missing = pjoin(data_path, 'missing.arff') -expect_missing_raw = np.array([[1, 5], [2, 4], [np.nan, np.nan]]) -expect_missing = np.empty(3, [('yop', np.float), ('yap', np.float)]) -expect_missing['yop'] = expect_missing_raw[:, 0] -expect_missing['yap'] = expect_missing_raw[:, 1] - - -class DataTest(TestCase): - def test1(self): - """Parsing trivial file with nothing.""" - self._test(test4) - - def test2(self): - """Parsing trivial file with some comments in the data section.""" - self._test(test5) - - def _test(self, test_file): - data, meta = loadarff(test_file) - for i in range(len(data)): - for j in range(4): - assert_array_almost_equal(expect4_data[i][j], data[i][j]) - assert_equal(meta.types(), expected_types) - - -class MissingDataTest(TestCase): - def test_missing(self): - data, meta = loadarff(missing) - for i in ['yop', 'yap']: - assert_array_almost_equal(data[i], expect_missing[i]) Deleted: trunk/scipy/io/arff/tests/test_header.py =================================================================== --- trunk/scipy/io/arff/tests/test_header.py 2010-09-12 17:20:54 UTC (rev 6782) +++ trunk/scipy/io/arff/tests/test_header.py 2010-09-12 17:21:12 UTC (rev 6783) @@ -1,59 +0,0 @@ -#!/usr/bin/env python -"""Test for parsing arff headers only.""" -import os - -from numpy.testing import * - -from scipy.io.arff.arffread import read_header, parse_type, ParseArffError - -data_path = os.path.join(os.path.dirname(__file__), 'data') - -test1 = os.path.join(data_path, 'test1.arff') -test2 = os.path.join(data_path, 'test2.arff') -test3 = os.path.join(data_path, 'test3.arff') - -class HeaderTest(TestCase): - def test_type_parsing(self): - """Test parsing type of attribute from their value.""" - ofile = open(test2) - rel, attrs = read_header(ofile) - - expected = ['numeric', 'numeric', 'numeric', 'numeric', 'numeric', - 'numeric', 'string', 'string', 'nominal', 'nominal'] - - for i in range(len(attrs)): - assert parse_type(attrs[i][1]) == expected[i] - - def test_badtype_parsing(self): - """Test parsing wrong type of attribute from their value.""" - ofile = open(test3) - rel, attrs = read_header(ofile) - - for name, value in attrs: - try: - parse_type(value) - raise Error("Could parse type of crap, should not happen.") - except ParseArffError: - pass - - def test_fullheader1(self): - """Parsing trivial header with nothing.""" - ofile = open(test1) - rel, attrs = read_header(ofile) - - # Test relation - assert rel == 'test1' - - # Test numerical attributes - assert len(attrs) == 5 - for i in range(4): - assert attrs[i][0] == 'attr%d' % i - assert attrs[i][1] == 'REAL' - classes = attrs[4][1] - - # Test nominal attribute - assert attrs[4][0] == 'class' - assert attrs[4][1] == '{class0, class1, class2, class3}' - -if __name__ == "__main__": - nose.run(argv=['', __file__]) From scipy-svn at scipy.org Sun Sep 12 13:21:25 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 12:21:25 -0500 (CDT) Subject: [Scipy-svn] r6784 - trunk/scipy/io/arff Message-ID: <20100912172125.EE6D339CC9C@scipy.org> Author: ptvirtan Date: 2010-09-12 12:21:25 -0500 (Sun, 12 Sep 2010) New Revision: 6784 Modified: trunk/scipy/io/arff/arffread.py Log: 3K: io/arff: port arff to Py3 Modified: trunk/scipy/io/arff/arffread.py =================================================================== --- trunk/scipy/io/arff/arffread.py 2010-09-12 17:21:12 UTC (rev 6783) +++ trunk/scipy/io/arff/arffread.py 2010-09-12 17:21:25 UTC (rev 6784) @@ -219,21 +219,21 @@ atrv = mattr.group(1) if r_comattrval.match(atrv): name, type = tokenize_single_comma(atrv) - next = iterable.next() + next_item = iterable.next() elif r_wcomattrval.match(atrv): name, type = tokenize_single_wcomma(atrv) - next = iterable.next() + next_item = iterable.next() else: # Not sure we should support this, as it does not seem supported by # weka. raise ValueError("multi line not supported yet") - #name, type, next = tokenize_multilines(iterable, atrv) + #name, type, next_item = tokenize_multilines(iterable, atrv) else: raise ValueError("First line unparsable: %s" % sattr) if type == 'relational': raise ValueError("relational attributes not supported yet") - return name, type, next + return name, type, next_item def tokenize_multilines(iterable, val): From scipy-svn at scipy.org Sun Sep 12 13:21:38 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 12:21:38 -0500 (CDT) Subject: [Scipy-svn] r6785 - trunk/scipy/io/docs Message-ID: <20100912172138.4356239CC9C@scipy.org> Author: ptvirtan Date: 2010-09-12 12:21:38 -0500 (Sun, 12 Sep 2010) New Revision: 6785 Removed: trunk/scipy/io/docs/numpyio.README Log: DEP: remove unused numpyio doc file Deleted: trunk/scipy/io/docs/numpyio.README =================================================================== --- trunk/scipy/io/docs/numpyio.README 2010-09-12 17:21:25 UTC (rev 6784) +++ trunk/scipy/io/docs/numpyio.README 2010-09-12 17:21:38 UTC (rev 6785) @@ -1,174 +0,0 @@ - -This source file and makefile are intended to be used with python with -Numerical extensions. - -To install: - -1) copy Makefile.pre.in from your python configuration directory -(e.g. /usr/lib/python1.5/config/Makefile.pre.in) to this directory. -2) make -f Makefile.pre.in boot -3) make - -4) install in a directory on your Python path. - -executing make once compiles both sigtools and numpyio. - -There is a module called mIO.py that defines MATLAB-like binary file -interface using numpyio. It is a recommended front-end for numpyio and -imported into signaltools.py - -Usage: - -import mIO - -fid = mIO.fopen('somefile','r','ieee-le') # little-endian -somedata = fid.fread(number_of_els,type) # type can be all kinds of things - # like int32, float, complex, etc. - # check mIO.py for details - -# somedata is 1-D array of number_of_els (set the shape to whatever you want - -There are useful methods called fort_write and fort_read to this object -that allow you to use the struct module syntax to read in FORTRAN records into -a list and write FORTRAN records. - - -Any Questions or problems or bug-reports send to -Oliphant.Travis at altavista.net - - -Background: - - Once compiled, numpyio is a loadable module that can be used in -python for reading and writing arbitrary binary data to and from -Numerical Python arrays. I work in Medical Imaging and often have -large data sets to manipulate. I came from a background of using -MATLAB but only having doubles to work with really puts a crimp on the -sizes of the data sets I could manipulate. The fact that Numerical -Python has more data types defined than doubles encouraged me to try -it out. I have been very impressed with its speed and utility, but I -needed some way to read large data sets from an arbitrary binary file -into Numerical Python arrays. I didn't see any obvious way to do this -so I wrote an extension module. Although there is not much -documentation, having the sources available is ultimately better than -documentation. - - -Description: - -The module defines 5 methods for reading and writing NumPy arrays: - -******************************************************************** - -g = numpyio.fread( fid, Num, read_type { mem_type, byteswap}) - - fid = open file pointer object (i.e. from fid = open("filename") ) - Num = number of elements to read of type read_type - read_type = a character in 'cb1silfdFD' (PyArray types) - describing how to interpret bytes on disk. -OPTIONAL - mem_type = a character (PyArray type) describing what kind of - PyArray to return in g. Default = read_type - byteswap = 0 for no byteswapping or a 1 to byteswap (to handle - different endianness). Default = 0 - -************************************************************************ - -numpyio.fwrite( fid, Num, myarray { write_type, byteswap} ) - - fid = open file stream - Num = number of elements to write - myarray = NumPy array holding the data to write (will be - written as if ravel(myarray) was passed) -OPTIONAL - write_type = character ('cb1silfdFD') describing how to write the - data (what datatype to use) Default = type of - myarray. - byteswap = 0 or 1 to determine if byteswapping occurs on write. - Default = 0. - - -These are the main routines, note that mem_type or write_type is -specified then a blind typecast is done with no checking to see if it -makes sense to do so. I'm trusting the user knows what she wants to -do. - -Three support routines are also included. - -************************************ - -numpyio.bswap(myarray) - - myarray = an array whose elements you want to byteswap. - - This does an inplace byte-swap so that myarray is changed in - memory. - -********************************************************* - -out = numpyio.packbits(myarray) - - myarray = an array whose (assumed binary) elements you want to - pack into bits (must be of integer type, 'cb1sl') - - This routine packs the elements of a binary-valued dataset into a - 1-D NumPy array of type PyArray_UBYTE ('b') whose bits correspond to - the logical (0 or nonzero) value of the input elements. - - If myarray has more dimensions than 2 it packs each slice (rows*columns) - separately. The number of elements per slice (rows*columns) is - important to know to be able to unpack the data later. - - Example: - >>> a = array([[[1,0,1], - ... [0,1,0]], - ... [[1,1,0], - ... [0,0,1]]]) - >>> b = numpyio.packbits(a) - >>> b - array([168, 196], 'b') - - Note that 168 = 128 + 32 + 8 - 196 = 128 + 64 + 4 - - -***************************************************************** - -out = numpyio.unpackbits(myarray, elements_per_slice {, out_type} ) - - myarray = Array of integer type ('cb1sl') whose least - significant byte is a bit-field for the - resulting output array. - - elements_per_slice = Necessary for interpretation of myarray. - This is how many elements in the - rows*columns of original packed structure. - -OPTIONAL - out_type = The type of output array to populate with 1's - and 0's. Must be an integer type. - - -The output array will be a 1-D array of 1's and zero's - -Example: (See above) (It prints out a nice message saying how your - machine interprets multibyte numbers.) - - >>> c = numpyio.unpackbits(b,6) - This is a little-endian machine - >>> c - array([1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1],'b') - -******************************************************************** - - -Enjoy, - -Travis - - - - - - - From scipy-svn at scipy.org Sun Sep 12 17:13:55 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:13:55 -0500 (CDT) Subject: [Scipy-svn] r6786 - trunk/scipy/cluster/tests Message-ID: <20100912211355.E033439CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:13:55 -0500 (Sun, 12 Sep 2010) New Revision: 6786 Modified: trunk/scipy/cluster/tests/test_vq.py Log: TST: cluster: Don't use 'import *'. Modified: trunk/scipy/cluster/tests/test_vq.py =================================================================== --- trunk/scipy/cluster/tests/test_vq.py 2010-09-12 17:21:38 UTC (rev 6785) +++ trunk/scipy/cluster/tests/test_vq.py 2010-09-12 21:13:55 UTC (rev 6786) @@ -7,7 +7,8 @@ import warnings import numpy as np -from numpy.testing import * +from numpy.testing import assert_array_equal, assert_array_almost_equal, \ + TestCase, run_module_suite from scipy.cluster.vq import kmeans, kmeans2, py_vq, py_vq2, vq, ClusterError try: From scipy-svn at scipy.org Sun Sep 12 17:14:36 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:14:36 -0500 (CDT) Subject: [Scipy-svn] r6787 - trunk/scipy/constants/tests Message-ID: <20100912211436.D3DD339CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:14:36 -0500 (Sun, 12 Sep 2010) New Revision: 6787 Modified: trunk/scipy/constants/tests/test_codata.py Log: TST: constants: Don't use plain 'assert'. Modified: trunk/scipy/constants/tests/test_codata.py =================================================================== --- trunk/scipy/constants/tests/test_codata.py 2010-09-12 21:13:55 UTC (rev 6786) +++ trunk/scipy/constants/tests/test_codata.py 2010-09-12 21:14:36 UTC (rev 6787) @@ -1,7 +1,7 @@ import warnings from scipy.constants import constants, codata, find -from numpy.testing import assert_equal, run_module_suite +from numpy.testing import assert_equal, assert_, run_module_suite def test_find(): @@ -36,7 +36,7 @@ '299792458 m s^-1') def test_find_all(): - assert len(codata.find(disp=False)) > 300 + assert_(len(codata.find(disp=False)) > 300) def test_find_single(): assert_equal(codata.find('Wien freq', disp=False)[0], From scipy-svn at scipy.org Sun Sep 12 17:16:34 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:16:34 -0500 (CDT) Subject: [Scipy-svn] r6788 - trunk/scipy/fftpack/tests Message-ID: <20100912211634.AEA5139CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:16:34 -0500 (Sun, 12 Sep 2010) New Revision: 6788 Modified: trunk/scipy/fftpack/tests/test_basic.py Log: TST: fftpack: Don't use 'import *'. Don't use plain 'assert'. Simplify a test by using 'assert_raises'. Modified: trunk/scipy/fftpack/tests/test_basic.py =================================================================== --- trunk/scipy/fftpack/tests/test_basic.py 2010-09-12 21:14:36 UTC (rev 6787) +++ trunk/scipy/fftpack/tests/test_basic.py 2010-09-12 21:16:34 UTC (rev 6788) @@ -11,7 +11,8 @@ python tests/test_basic.py """ -from numpy.testing import * +from numpy.testing import assert_, assert_equal, assert_array_almost_equal, \ + assert_array_almost_equal_nulp, assert_raises, run_module_suite, TestCase from scipy.fftpack import ifft,fft,fftn,ifftn,rfft,irfft, fft2 from scipy.fftpack import _fftpack as fftpack @@ -492,16 +493,11 @@ assert_array_almost_equal(y, numpy.fft.fftn(x, axes=(-3, -2), s=(8, 8))) def test_shape_argument_more(self): - # Test that fftn raise a value error exception when s.shape is longer - # than x.shape + """Test that fftn raises ValueError when s.shape is longer than x.shape""" x = zeros((4, 4, 2)) - try: - fx = fftn(x, shape = (8, 8, 2, 1)) - raise AssertionError("s.shape longer than x.shape succeded, "\ - "but should not have.") - except ValueError: - pass + assert_raises(ValueError, fftn, x, shape=(8, 8, 2, 1)) + class _TestIfftn(TestCase): dtype = None cdtype = None @@ -512,7 +508,7 @@ def test_definition(self): x = np.array([[1,2,3],[4,5,6],[7,8,9]], dtype=self.dtype) y = ifftn(x) - assert y.dtype == self.cdtype + assert_(y.dtype == self.cdtype) assert_array_almost_equal_nulp(y,direct_idftn(x),self.maxnlp) x = random((20,26)) assert_array_almost_equal_nulp(ifftn(x),direct_idftn(x),self.maxnlp) From scipy-svn at scipy.org Sun Sep 12 17:17:28 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:17:28 -0500 (CDT) Subject: [Scipy-svn] r6789 - trunk/scipy/integrate/tests Message-ID: <20100912211728.CFEAC39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:17:28 -0500 (Sun, 12 Sep 2010) New Revision: 6789 Modified: trunk/scipy/integrate/tests/test_integrate.py trunk/scipy/integrate/tests/test_quadpack.py Log: TST: integrate: Don't use plain 'assert'. Modified: trunk/scipy/integrate/tests/test_integrate.py =================================================================== --- trunk/scipy/integrate/tests/test_integrate.py 2010-09-12 21:16:34 UTC (rev 6788) +++ trunk/scipy/integrate/tests/test_integrate.py 2010-09-12 21:17:28 UTC (rev 6789) @@ -7,7 +7,7 @@ from numpy import arange, zeros, array, dot, sqrt, cos, sin, eye, pi, exp, \ allclose -from numpy.testing import TestCase, run_module_suite +from numpy.testing import assert_, TestCase, run_module_suite from scipy.integrate import odeint, ode, complex_ode #------------------------------------------------------------------------------ @@ -21,7 +21,7 @@ def _do_problem(self, problem): t = arange(0.0, problem.stop_t, 0.05) z, infodict = odeint(problem.f, problem.z0, t, full_output=True) - assert problem.verify(z, t) + assert_(problem.verify(z, t)) def test_odeint(self): for problem_cls in PROBLEMS: @@ -49,8 +49,8 @@ ig.set_initial_value(problem.z0, t=0.0) z = ig.integrate(problem.stop_t) - assert ig.successful(), (problem, method) - assert problem.verify(array([z]), problem.stop_t), (problem, method) + assert_(ig.successful(), (problem, method)) + assert_(problem.verify(array([z]), problem.stop_t), (problem, method)) def test_vode(self): """Check the vode solver""" @@ -106,8 +106,8 @@ ig.set_initial_value(problem.z0, t=0.0) z = ig.integrate(problem.stop_t) - assert ig.successful(), (problem, method) - assert problem.verify(array([z]), problem.stop_t), (problem, method) + assert_(ig.successful(), (problem, method)) + assert_(problem.verify(array([z]), problem.stop_t), (problem, method)) def test_vode(self): """Check the vode solver""" Modified: trunk/scipy/integrate/tests/test_quadpack.py =================================================================== --- trunk/scipy/integrate/tests/test_quadpack.py 2010-09-12 21:16:34 UTC (rev 6788) +++ trunk/scipy/integrate/tests/test_quadpack.py 2010-09-12 21:17:28 UTC (rev 6789) @@ -1,11 +1,11 @@ from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf -from numpy.testing import TestCase, run_module_suite +from numpy.testing import assert_, TestCase, run_module_suite from scipy.integrate import quad, dblquad, tplquad def assert_quad((value, err), tabledValue, errTol=1.5e-8): - assert abs(value-tabledValue) < err, (value, tabledValue, err) + assert_(abs(value-tabledValue) < err, (value, tabledValue, err)) if errTol is not None: - assert err < errTol, (err, errTol) + assert_(err < errTol, (err, errTol)) class TestQuad(TestCase): def test_typical(self): From scipy-svn at scipy.org Sun Sep 12 17:18:42 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:18:42 -0500 (CDT) Subject: [Scipy-svn] r6790 - trunk/scipy/interpolate/tests Message-ID: <20100912211842.7D94B39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:18:42 -0500 (Sun, 12 Sep 2010) New Revision: 6790 Modified: trunk/scipy/interpolate/tests/test_fitpack.py trunk/scipy/interpolate/tests/test_interpnd.py trunk/scipy/interpolate/tests/test_interpolate.py trunk/scipy/interpolate/tests/test_ndgriddata.py trunk/scipy/interpolate/tests/test_polyint.py trunk/scipy/interpolate/tests/test_rbf.py trunk/scipy/interpolate/tests/test_regression.py Log: TST: interpolate: Don't use 'import *'. Don't use plain 'assert'. Modified: trunk/scipy/interpolate/tests/test_fitpack.py =================================================================== --- trunk/scipy/interpolate/tests/test_fitpack.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_fitpack.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -12,7 +12,8 @@ """ #import libwadpy -from numpy.testing import * +from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal, \ + assert_array_almost_equal, TestCase, run_module_suite from numpy import array, diff, shape from scipy.interpolate.fitpack2 import UnivariateSpline, LSQBivariateSpline, \ SmoothBivariateSpline, RectBivariateSpline Modified: trunk/scipy/interpolate/tests/test_interpnd.py =================================================================== --- trunk/scipy/interpolate/tests/test_interpnd.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_interpnd.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -1,5 +1,6 @@ import numpy as np -from numpy.testing import * +from numpy.testing import assert_equal, assert_allclose, assert_almost_equal, \ + run_module_suite import scipy.interpolate.interpnd as interpnd import scipy.spatial.qhull as qhull Modified: trunk/scipy/interpolate/tests/test_interpolate.py =================================================================== --- trunk/scipy/interpolate/tests/test_interpolate.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_interpolate.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -1,4 +1,6 @@ -from numpy.testing import * +from numpy.testing import assert_, assert_equal, assert_almost_equal, \ + assert_array_almost_equal, assert_raises, assert_array_equal, \ + dec, TestCase, run_module_suite from numpy import mgrid, pi, sin, ogrid, poly1d, linspace import numpy as np @@ -80,11 +82,11 @@ constructor. """ - assert interp1d(self.x10, self.y10).copy - assert not interp1d(self.x10, self.y10, copy=False).copy - assert interp1d(self.x10, self.y10).bounds_error - assert not interp1d(self.x10, self.y10, bounds_error=False).bounds_error - assert np.isnan(interp1d(self.x10, self.y10).fill_value) + assert_(interp1d(self.x10, self.y10).copy) + assert_(not interp1d(self.x10, self.y10, copy=False).copy) + assert_(interp1d(self.x10, self.y10).bounds_error) + assert_(not interp1d(self.x10, self.y10, bounds_error=False).bounds_error) + assert_(np.isnan(interp1d(self.x10, self.y10).fill_value)) assert_equal( interp1d(self.x10, self.y10, fill_value=3.0).fill_value, 3.0, @@ -213,7 +215,7 @@ y = np.arange(10).astype(np.int_) c = interp1d(x, y, kind=kind, fill_value=np.nan, bounds_error=False) yi = c(x - 1) - assert np.isnan(yi[0]) + assert_(np.isnan(yi[0])) assert_array_almost_equal(yi, np.r_[np.nan, y[:-1]]) def test_bounds(self): @@ -234,7 +236,7 @@ ) # Scalar input -> 0-dim scalar array output - assert isinstance(interp10(1.2), np.ndarray) + assert_(isinstance(interp10(1.2), np.ndarray)) assert_equal(interp10(1.2).shape, ()) # Multidimensional outputs. Modified: trunk/scipy/interpolate/tests/test_ndgriddata.py =================================================================== --- trunk/scipy/interpolate/tests/test_ndgriddata.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_ndgriddata.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -1,5 +1,6 @@ import numpy as np -from numpy.testing import * +from numpy.testing import assert_equal, assert_array_equal, assert_allclose, \ + run_module_suite from scipy.interpolate import griddata Modified: trunk/scipy/interpolate/tests/test_polyint.py =================================================================== --- trunk/scipy/interpolate/tests/test_polyint.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_polyint.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -1,5 +1,6 @@ -from numpy.testing import * +from numpy.testing import assert_almost_equal, assert_array_equal, \ + TestCase, run_module_suite from scipy.interpolate import KroghInterpolator, krogh_interpolate, \ BarycentricInterpolator, barycentric_interpolate, \ PiecewisePolynomial, piecewise_polynomial_interpolate, \ Modified: trunk/scipy/interpolate/tests/test_rbf.py =================================================================== --- trunk/scipy/interpolate/tests/test_rbf.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_rbf.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -2,9 +2,8 @@ # Created by John Travers, Robert Hetland, 2007 """ Test functions for rbf module """ -import numpy as np -from numpy.testing import assert_array_almost_equal, assert_almost_equal -from numpy import linspace, sin, random, exp, log10, allclose +from numpy.testing import assert_, assert_array_almost_equal, assert_almost_equal +from numpy import linspace, sin, random, exp, allclose from scipy.interpolate.rbf import Rbf FUNCTIONS = ('multiquadric', 'inverse multiquadric', 'gaussian', @@ -60,7 +59,7 @@ #plt.title(function) #plt.show() msg = "abs-diff: %f" % abs(yi - sin(xi)).max() - assert allclose(yi, sin(xi), atol=atol), msg + assert_(allclose(yi, sin(xi), atol=atol), msg) def test_rbf_regularity(): tolerances = { Modified: trunk/scipy/interpolate/tests/test_regression.py =================================================================== --- trunk/scipy/interpolate/tests/test_regression.py 2010-09-12 21:17:28 UTC (rev 6789) +++ trunk/scipy/interpolate/tests/test_regression.py 2010-09-12 21:18:42 UTC (rev 6790) @@ -1,6 +1,6 @@ import numpy as np import scipy.interpolate as interp -from numpy.testing import * +from numpy.testing import assert_almost_equal, TestCase class TestRegression(TestCase): def test_spalde_scalar_input(self): From scipy-svn at scipy.org Sun Sep 12 17:19:54 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:19:54 -0500 (CDT) Subject: [Scipy-svn] r6791 - trunk/scipy/lib/blas/tests Message-ID: <20100912211954.57DEC39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:19:54 -0500 (Sun, 12 Sep 2010) New Revision: 6791 Modified: trunk/scipy/lib/blas/tests/test_blas.py trunk/scipy/lib/blas/tests/test_fblas.py Log: TST: lib: Don't use 'import *'. Don't use plain 'assert'. Modified: trunk/scipy/lib/blas/tests/test_blas.py =================================================================== --- trunk/scipy/lib/blas/tests/test_blas.py 2010-09-12 21:18:42 UTC (rev 6790) +++ trunk/scipy/lib/blas/tests/test_blas.py 2010-09-12 21:19:54 UTC (rev 6791) @@ -13,7 +13,8 @@ import math from numpy import array -from numpy.testing import * +from numpy.testing import assert_equal, assert_almost_equal, \ + assert_array_almost_equal, TestCase, run_module_suite from scipy.lib.blas import fblas from scipy.lib.blas import cblas from scipy.lib.blas import get_blas_funcs Modified: trunk/scipy/lib/blas/tests/test_fblas.py =================================================================== --- trunk/scipy/lib/blas/tests/test_fblas.py 2010-09-12 21:18:42 UTC (rev 6790) +++ trunk/scipy/lib/blas/tests/test_fblas.py 2010-09-12 21:19:54 UTC (rev 6791) @@ -8,7 +8,8 @@ from numpy import zeros, transpose, newaxis, shape, float32, float64, \ complex64, complex128, arange, array, common_type, conjugate -from numpy.testing import * +from numpy.testing import assert_equal, assert_array_almost_equal, \ + run_module_suite, TestCase from scipy.lib.blas import fblas #decimal accuracy to require between Python and LAPACK/BLAS calculations @@ -22,7 +23,7 @@ b = b[:,newaxis] else: b_is_vector = False - assert a.shape[1] == b.shape[0] + assert_equal(a.shape[1], b.shape[0]) c = zeros((a.shape[0], b.shape[1]), common_type(a, b)) for i in xrange(a.shape[0]): for j in xrange(b.shape[1]): @@ -38,19 +39,23 @@ ### Test blas ?axpy class BaseAxpy(object): + # Mixin class to test dtypes + def test_default_a(self): x = arange(3.,dtype=self.dtype) y = arange(3.,dtype=x.dtype) real_y = x*1.+y self.blas_func(x,y) assert_array_almost_equal(real_y,y) + def test_simple(self): x = arange(3.,dtype=self.dtype) y = arange(3.,dtype=x.dtype) real_y = x*3.+y self.blas_func(x,y,a=3.) assert_array_almost_equal(real_y,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) @@ -58,18 +63,21 @@ real_y = x[::2]*3.+y self.blas_func(x,y,a=3.,n=3,incx=2) assert_array_almost_equal(real_y,y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) real_y = x*3.+y[::2] self.blas_func(x,y,a=3.,n=3,incy=2) assert_array_almost_equal(real_y,y[::2]) + def test_x_and_y_stride(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) real_y = x[::4]*3.+y[::2] self.blas_func(x,y,a=3.,n=3,incx=4,incy=2) assert_array_almost_equal(real_y,y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -79,6 +87,7 @@ return # should catch error and never get here assert(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -95,15 +104,18 @@ dtype = float32 except AttributeError: class TestSaxpy: pass + class TestDaxpy(TestCase, BaseAxpy): blas_func = fblas.daxpy dtype = float64 + try: class TestCaxpy(TestCase, BaseAxpy): blas_func = fblas.caxpy dtype = complex64 except AttributeError: class TestCaxpy: pass + class TestZaxpy(TestCase, BaseAxpy): blas_func = fblas.zaxpy dtype = complex128 @@ -113,18 +125,22 @@ ### Test blas ?scal class BaseScal(object): + # Mixin class for testing particular dtypes + def test_simple(self): x = arange(3.,dtype=self.dtype) real_x = x*3. self.blas_func(3.,x) assert_array_almost_equal(real_x,x) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) real_x = x.copy() real_x[::2] = x[::2]*array(3.,self.dtype) self.blas_func(3.,x,n=3,incx=2) assert_array_almost_equal(real_x,x) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) try: @@ -133,21 +149,25 @@ return # should catch error and never get here assert(0) + try: class TestSscal(TestCase, BaseScal): blas_func = fblas.sscal dtype = float32 except AttributeError: class TestSscal: pass + class TestDscal(TestCase, BaseScal): blas_func = fblas.dscal dtype = float64 + try: class TestCscal(TestCase, BaseScal): blas_func = fblas.cscal dtype = complex64 except AttributeError: class TestCscal: pass + class TestZscal(TestCase, BaseScal): blas_func = fblas.zscal dtype = complex128 @@ -159,27 +179,33 @@ ### Test blas ?copy class BaseCopy(object): + # Mixin class for testing dtypes + def test_simple(self): x = arange(3.,dtype=self.dtype) y = zeros(shape(x),x.dtype) self.blas_func(x,y) assert_array_almost_equal(x,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) self.blas_func(x,y,n=3,incx=2) assert_array_almost_equal(x[::2],y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) self.blas_func(x,y,n=3,incy=2) assert_array_almost_equal(x,y[::2]) + def test_x_and_y_stride(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) self.blas_func(x,y,n=3,incx=4,incy=2) assert_array_almost_equal(x[::4],y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -189,6 +215,7 @@ return # should catch error and never get here assert(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -211,15 +238,18 @@ dtype = float32 except AttributeError: class TestScopy: pass + class TestDcopy(TestCase, BaseCopy): blas_func = fblas.dcopy dtype = float64 + try: class TestCcopy(TestCase, BaseCopy): blas_func = fblas.ccopy dtype = complex64 except AttributeError: class TestCcopy: pass + class TestZcopy(TestCase, BaseCopy): blas_func = fblas.zcopy dtype = complex128 @@ -229,7 +259,9 @@ ### Test blas ?swap class BaseSwap(object): + # Mixin class to implement test objects + def test_simple(self): x = arange(3.,dtype=self.dtype) y = zeros(shape(x),x.dtype) @@ -238,6 +270,7 @@ self.blas_func(x,y) assert_array_almost_equal(desired_x,x) assert_array_almost_equal(desired_y,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) @@ -246,6 +279,7 @@ self.blas_func(x,y,n=3,incx=2) assert_array_almost_equal(desired_x,x[::2]) assert_array_almost_equal(desired_y,y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -263,6 +297,7 @@ self.blas_func(x,y,n=3,incx=4,incy=2) assert_array_almost_equal(desired_x,x[::4]) assert_array_almost_equal(desired_y,y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -272,6 +307,7 @@ return # should catch error and never get here assert(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -288,15 +324,18 @@ dtype = float32 except AttributeError: class TestSswap: pass + class TestDswap(TestCase, BaseSwap): blas_func = fblas.dswap dtype = float64 + try: class TestCswap(TestCase, BaseSwap): blas_func = fblas.cswap dtype = complex64 except AttributeError: class TestCswap: pass + class TestZswap(TestCase, BaseSwap): blas_func = fblas.zswap dtype = complex128 @@ -306,7 +345,9 @@ ### This will be a mess to test all cases. class BaseGemv(object): + # Mixin class to test dtypes + def get_data(self,x_stride=1,y_stride=1): mult = array(1, dtype = self.dtype) if self.dtype in [complex64, complex128]: @@ -318,36 +359,43 @@ x = arange(shape(a)[0]*x_stride,dtype=self.dtype) * mult y = arange(shape(a)[1]*y_stride,dtype=self.dtype) * mult return alpha,beta,a,x,y + def test_simple(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(a,x)+beta*y y = self.blas_func(alpha,a,x,beta,y) assert_array_almost_equal(desired_y,y) + def test_default_beta_y(self): alpha,beta,a,x,y = self.get_data() desired_y = matrixmultiply(a,x) y = self.blas_func(1,a,x) assert_array_almost_equal(desired_y,y) + def test_simple_transpose(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(transpose(a),x)+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=1) assert_array_almost_equal(desired_y,y) + def test_simple_transpose_conj(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(transpose(conjugate(a)),x)+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=2) assert_array_almost_equal(desired_y,y) + def test_x_stride(self): alpha,beta,a,x,y = self.get_data(x_stride=2) desired_y = alpha*matrixmultiply(a,x[::2])+beta*y y = self.blas_func(alpha,a,x,beta,y,incx=2) assert_array_almost_equal(desired_y,y) + def test_x_stride_transpose(self): alpha,beta,a,x,y = self.get_data(x_stride=2) desired_y = alpha*matrixmultiply(transpose(a),x[::2])+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=1,incx=2) assert_array_almost_equal(desired_y,y) + def test_x_stride_assert(self): # What is the use of this test? alpha,beta,a,x,y = self.get_data(x_stride=2) @@ -361,18 +409,21 @@ assert(0) except: pass + def test_y_stride(self): alpha,beta,a,x,y = self.get_data(y_stride=2) desired_y = y.copy() desired_y[::2] = alpha*matrixmultiply(a,x)+beta*y[::2] y = self.blas_func(alpha,a,x,beta,y,incy=2) assert_array_almost_equal(desired_y,y) + def test_y_stride_transpose(self): alpha,beta,a,x,y = self.get_data(y_stride=2) desired_y = y.copy() desired_y[::2] = alpha*matrixmultiply(transpose(a),x)+beta*y[::2] y = self.blas_func(alpha,a,x,beta,y,trans=1,incy=2) assert_array_almost_equal(desired_y,y) + def test_y_stride_assert(self): # What is the use of this test? alpha,beta,a,x,y = self.get_data(y_stride=2) @@ -393,15 +444,18 @@ dtype = float32 except AttributeError: class TestSgemv: pass + class TestDgemv(TestCase, BaseGemv): blas_func = fblas.dgemv dtype = float64 + try: class TestCgemv(TestCase, BaseGemv): blas_func = fblas.cgemv dtype = complex64 except AttributeError: class TestCgemv: pass + class TestZgemv(TestCase, BaseGemv): blas_func = fblas.zgemv dtype = complex128 @@ -412,6 +466,7 @@ ### This will be a mess to test all cases. class BaseGer(TestCase): + def get_data(self,x_stride=1,y_stride=1): from numpy.random import normal alpha = array(1., dtype = self.dtype) @@ -419,17 +474,20 @@ x = arange(shape(a)[0]*x_stride,dtype=self.dtype) y = arange(shape(a)[1]*y_stride,dtype=self.dtype) return alpha,a,x,y + def test_simple(self): alpha,a,x,y = self.get_data() # tranpose takes care of Fortran vs. C(and Python) memory layout desired_a = alpha*transpose(x[:,newaxis]*y) + a self.blas_func(x,y,a) assert_array_almost_equal(desired_a,a) + def test_x_stride(self): alpha,a,x,y = self.get_data(x_stride=2) desired_a = alpha*transpose(x[::2,newaxis]*y) + a self.blas_func(x,y,a,incx=2) assert_array_almost_equal(desired_a,a) + def test_x_stride_assert(self): alpha,a,x,y = self.get_data(x_stride=2) try: @@ -437,6 +495,7 @@ assert(0) except: pass + def test_y_stride(self): alpha,a,x,y = self.get_data(y_stride=2) desired_a = alpha*transpose(x[:,newaxis]*y[::2]) + a @@ -454,6 +513,7 @@ class TestSger(BaseGer): blas_func = fblas.sger dtype = float32 + class TestDger(BaseGer): blas_func = fblas.dger dtype = float64 @@ -464,6 +524,7 @@ """ class BaseGerComplex(BaseGer): + def get_data(self,x_stride=1,y_stride=1): from numpy.random import normal alpha = array(1+1j, dtype = self.dtype) @@ -474,6 +535,7 @@ y = normal(0.,1.,shape(a)[1]*y_stride).astype(self.dtype) y = y + y * array(1j, dtype = self.dtype) return alpha,a,x,y + def test_simple(self): alpha,a,x,y = self.get_data() # tranpose takes care of Fortran vs. C(and Python) memory layout @@ -496,25 +558,34 @@ # assert_array_almost_equal(desired_a,a) class TestCgeru(BaseGerComplex): + blas_func = fblas.cgeru dtype = complex64 + def transform(self,x): return x + class TestZgeru(BaseGerComplex): + blas_func = fblas.zgeru dtype = complex128 + def transform(self,x): return x class TestCgerc(BaseGerComplex): + blas_func = fblas.cgerc dtype = complex64 + def transform(self,x): return conjugate(x) class TestZgerc(BaseGerComplex): + blas_func = fblas.zgerc dtype = complex128 + def transform(self,x): return conjugate(x) """ From scipy-svn at scipy.org Sun Sep 12 17:20:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:20:23 -0500 (CDT) Subject: [Scipy-svn] r6792 - trunk/scipy/linalg/tests Message-ID: <20100912212023.8941539CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:20:23 -0500 (Sun, 12 Sep 2010) New Revision: 6792 Modified: trunk/scipy/linalg/tests/test_basic.py trunk/scipy/linalg/tests/test_build.py trunk/scipy/linalg/tests/test_decomp.py trunk/scipy/linalg/tests/test_fblas.py trunk/scipy/linalg/tests/test_lapack.py trunk/scipy/linalg/tests/test_special_matrices.py Log: TST: linalg: Don't use plain 'assert'. Modified: trunk/scipy/linalg/tests/test_basic.py =================================================================== --- trunk/scipy/linalg/tests/test_basic.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_basic.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -26,7 +26,7 @@ import numpy.linalg as linalg from numpy.testing import TestCase, rand, run_module_suite, assert_raises, \ - assert_equal, assert_almost_equal, assert_array_almost_equal + assert_equal, assert_almost_equal, assert_array_almost_equal, assert_ from scipy.linalg import solve, inv, det, lstsq, pinv, pinv2, norm,\ solve_banded, solveh_banded @@ -498,7 +498,7 @@ for i in range(4): b = random([n,3]) x,res,r,s = lstsq(a,b) - assert r==m,'unexpected efficient rank' + assert_(r == m, 'unexpected efficient rank') #XXX: check definition of res assert_array_almost_equal(x,direct_lstsq(a,b)) @@ -511,7 +511,7 @@ for i in range(2): b = random([n,3]) x,res,r,s = lstsq(a,b) - assert r==m,'unexpected efficient rank' + assert_(r == m, 'unexpected efficient rank') #XXX: check definition of res assert_array_almost_equal(x,direct_lstsq(a,b,1)) Modified: trunk/scipy/linalg/tests/test_build.py =================================================================== --- trunk/scipy/linalg/tests/test_build.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_build.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -2,7 +2,6 @@ import sys import re -import numpy as np from numpy.testing import TestCase, dec from numpy.compat import asbytes Modified: trunk/scipy/linalg/tests/test_decomp.py =================================================================== --- trunk/scipy/linalg/tests/test_decomp.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_decomp.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -16,7 +16,7 @@ import numpy as np from numpy.testing import TestCase, assert_equal, assert_array_almost_equal, \ - assert_array_equal, assert_raises, run_module_suite, dec + assert_array_equal, assert_raises, assert_, run_module_suite, dec from scipy.linalg import eig, eigvals, lu, svd, svdvals, cholesky, qr, \ schur, rsf2csf, lu_solve, lu_factor, solve, diagsvd, hessenberg, rq, \ @@ -47,7 +47,7 @@ else: des = dtype(des) - assert act == des, 'dtype mismatch: "%s" (should be "%s") '%(act, des) + assert_(act == des, 'dtype mismatch: "%s" (should be "%s") ' % (act, des)) # XXX: This function should not be defined here, but somewhere in # scipy.linalg namespace @@ -753,38 +753,38 @@ def test_simple(self): a = [[1,2,3],[1,2,3],[2,5,6]] s = svdvals(a) - assert len(s)==3 - assert s[0]>=s[1]>=s[2] + assert_(len(s) == 3) + assert_(s[0] >= s[1] >= s[2]) def test_simple_underdet(self): a = [[1,2,3],[4,5,6]] s = svdvals(a) - assert len(s)==2 - assert s[0]>=s[1] + assert_(len(s) == 2) + assert_(s[0] >= s[1]) def test_simple_overdet(self): a = [[1,2],[4,5],[3,4]] s = svdvals(a) - assert len(s)==2 - assert s[0]>=s[1] + assert_(len(s) == 2) + assert_(s[0] >= s[1]) def test_simple_complex(self): a = [[1,2,3],[1,20,3j],[2,5,6]] s = svdvals(a) - assert len(s)==3 - assert s[0]>=s[1]>=s[2] + assert_(len(s) == 3) + assert_(s[0] >= s[1] >= s[2]) def test_simple_underdet_complex(self): a = [[1,2,3],[4,5j,6]] s = svdvals(a) - assert len(s)==2 - assert s[0]>=s[1] + assert_(len(s) == 2) + assert_(s[0] >= s[1]) def test_simple_overdet_complex(self): a = [[1,2],[4,5],[3j,4]] s = svdvals(a) - assert len(s)==2 - assert s[0]>=s[1] + assert_(len(s) == 2) + assert_(s[0] >= s[1]) class TestDiagSVD(TestCase): @@ -947,7 +947,7 @@ t,z = schur(a) assert_array_almost_equal(dot(dot(z,t),transp(conj(z))),a) tc,zc = schur(a,'complex') - assert(any(ravel(iscomplex(zc))) and any(ravel(iscomplex(tc)))) + assert_(any(ravel(iscomplex(zc))) and any(ravel(iscomplex(tc)))) assert_array_almost_equal(dot(dot(zc,tc),transp(conj(zc))),a) tc2,zc2 = rsf2csf(tc,zc) assert_array_almost_equal(dot(dot(zc2,tc2),transp(conj(zc2))),a) Modified: trunk/scipy/linalg/tests/test_fblas.py =================================================================== --- trunk/scipy/linalg/tests/test_fblas.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_fblas.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -11,7 +11,7 @@ from scipy.linalg import fblas from numpy.testing import TestCase, run_module_suite, assert_array_equal, \ - assert_array_almost_equal + assert_array_almost_equal, assert_ #decimal accuracy to require between Python and LAPACK/BLAS calculations @@ -25,7 +25,7 @@ b = b[:,newaxis] else: b_is_vector = False - assert a.shape[1] == b.shape[0] + assert_(a.shape[1] == b.shape[0]) c = zeros((a.shape[0], b.shape[1]), common_type(a, b)) for i in xrange(a.shape[0]): for j in xrange(b.shape[1]): Modified: trunk/scipy/linalg/tests/test_lapack.py =================================================================== --- trunk/scipy/linalg/tests/test_lapack.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_lapack.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -4,7 +4,7 @@ # from numpy.testing import TestCase, run_module_suite, assert_equal, \ - assert_array_almost_equal + assert_array_almost_equal, assert_ from numpy import ones from scipy.linalg import flapack, clapack @@ -22,13 +22,13 @@ f = getattr(flapack,p+'gebal',None) if f is None: continue ba,lo,hi,pivscale,info = f(a) - assert not info,`info` + assert_(not info,`info`) assert_array_almost_equal(ba,a) assert_equal((lo,hi),(0,len(a[0])-1)) assert_array_almost_equal(pivscale,ones(len(a))) ba,lo,hi,pivscale,info = f(a1,permute=1,scale=1) - assert not info,`info` + assert_(not info,`info`) #print a1 #print ba,lo,hi,pivscale @@ -40,7 +40,7 @@ f = getattr(flapack,p+'gehrd',None) if f is None: continue ht,tau,info = f(a) - assert not info,`info` + assert_(not info,`info`) class TestLapack(TestCase): Modified: trunk/scipy/linalg/tests/test_special_matrices.py =================================================================== --- trunk/scipy/linalg/tests/test_special_matrices.py 2010-09-12 21:19:54 UTC (rev 6791) +++ trunk/scipy/linalg/tests/test_special_matrices.py 2010-09-12 21:20:23 UTC (rev 6792) @@ -1,6 +1,6 @@ """Tests for functions in special_matrices.py.""" -from numpy import arange, add, array, eye, all, copy +from numpy import arange, add, array, eye, copy from numpy.testing import TestCase, run_module_suite, assert_raises, \ assert_equal, assert_array_equal @@ -216,12 +216,12 @@ class TestBlockDiag: def test_basic(self): x = block_diag(eye(2), [[1,2], [3,4], [5,6]], [[1, 2, 3]]) - assert all(x == [[1, 0, 0, 0, 0, 0, 0], - [0, 1, 0, 0, 0, 0, 0], - [0, 0, 1, 2, 0, 0, 0], - [0, 0, 3, 4, 0, 0, 0], - [0, 0, 5, 6, 0, 0, 0], - [0, 0, 0, 0, 1, 2, 3]]) + assert_array_equal(x, [[1, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0], + [0, 0, 1, 2, 0, 0, 0], + [0, 0, 3, 4, 0, 0, 0], + [0, 0, 5, 6, 0, 0, 0], + [0, 0, 0, 0, 1, 2, 3]]) def test_dtype(self): x = block_diag([[1.5]]) From scipy-svn at scipy.org Sun Sep 12 17:21:43 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:21:43 -0500 (CDT) Subject: [Scipy-svn] r6793 - trunk/scipy/maxentropy/tests Message-ID: <20100912212143.A23D239CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:21:43 -0500 (Sun, 12 Sep 2010) New Revision: 6793 Modified: trunk/scipy/maxentropy/tests/test_maxentropy.py Log: TST: maxentropy: Don't use 'import *'. Modified: trunk/scipy/maxentropy/tests/test_maxentropy.py =================================================================== --- trunk/scipy/maxentropy/tests/test_maxentropy.py 2010-09-12 21:20:23 UTC (rev 6792) +++ trunk/scipy/maxentropy/tests/test_maxentropy.py 2010-09-12 21:21:43 UTC (rev 6793) @@ -6,9 +6,9 @@ Copyright: Ed Schofield, 2003-2005 """ -from numpy.testing import * +from numpy.testing import assert_almost_equal, TestCase, run_module_suite from numpy import arange, log, exp, ones -from scipy.maxentropy.maxentropy import * +from scipy.maxentropy.maxentropy import logsumexp class TestMaxentropy(TestCase): """Test whether logsumexp() function correctly handles large @@ -29,10 +29,6 @@ desired = 10000.0 + log(n) assert_almost_equal(logsumexp(b), desired) - def test_simple(self): - # Write me! - pass - if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Sun Sep 12 17:22:23 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:22:23 -0500 (CDT) Subject: [Scipy-svn] r6794 - trunk/scipy/misc/tests Message-ID: <20100912212223.D20DD39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:22:23 -0500 (Sun, 12 Sep 2010) New Revision: 6794 Modified: trunk/scipy/misc/tests/test_pilutil.py Log: TST: misc: Don't use 'import *'. Don't use plain 'assert'. Modified: trunk/scipy/misc/tests/test_pilutil.py =================================================================== --- trunk/scipy/misc/tests/test_pilutil.py 2010-09-12 21:21:43 UTC (rev 6793) +++ trunk/scipy/misc/tests/test_pilutil.py 2010-09-12 21:22:23 UTC (rev 6794) @@ -1,7 +1,8 @@ import os.path import numpy as np -from numpy.testing import * +from numpy.testing import assert_, assert_equal, \ + dec, decorate_methods, TestCase, run_module_suite try: import PIL.Image @@ -42,8 +43,8 @@ def tst_fromimage(filename, irange): img = pilutil.fromimage(PIL.Image.open(filename)) imin,imax = irange - assert img.min() >= imin - assert img.max() <= imax + assert_(img.min() >= imin) + assert_(img.max() <= imax) @_pilskip def test_fromimage(): From scipy-svn at scipy.org Sun Sep 12 17:24:55 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:24:55 -0500 (CDT) Subject: [Scipy-svn] r6795 - trunk/scipy/ndimage/tests Message-ID: <20100912212455.6777F39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:24:55 -0500 (Sun, 12 Sep 2010) New Revision: 6795 Modified: trunk/scipy/ndimage/tests/test_filters.py trunk/scipy/ndimage/tests/test_io.py trunk/scipy/ndimage/tests/test_ndimage.py trunk/scipy/ndimage/tests/test_regression.py Log: TST: ndimage: Don't use 'import *'. Don't use plain 'assert'. Modified: trunk/scipy/ndimage/tests/test_filters.py =================================================================== --- trunk/scipy/ndimage/tests/test_filters.py 2010-09-12 21:22:23 UTC (rev 6794) +++ trunk/scipy/ndimage/tests/test_filters.py 2010-09-12 21:24:55 UTC (rev 6795) @@ -4,8 +4,6 @@ from numpy.testing import assert_equal, assert_raises -from nose.tools import assert_true - import scipy.ndimage as sndi Modified: trunk/scipy/ndimage/tests/test_io.py =================================================================== --- trunk/scipy/ndimage/tests/test_io.py 2010-09-12 21:22:23 UTC (rev 6794) +++ trunk/scipy/ndimage/tests/test_io.py 2010-09-12 21:24:55 UTC (rev 6795) @@ -1,4 +1,4 @@ -from numpy.testing import * +from numpy.testing import assert_array_equal, dec, run_module_suite import scipy.ndimage as ndi import os Modified: trunk/scipy/ndimage/tests/test_ndimage.py =================================================================== --- trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 21:22:23 UTC (rev 6794) +++ trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-12 21:24:55 UTC (rev 6795) @@ -32,7 +32,8 @@ import numpy import numpy as np from numpy import fft -from numpy.testing import * +from numpy.testing import assert_, assert_equal, assert_array_equal, \ + TestCase, run_module_suite import scipy.ndimage as ndimage eps = 1e-12 @@ -2118,11 +2119,11 @@ arr = numpy.array(range(25)).reshape((5,5)).astype(float) arr = ndimage.zoom(arr, z, order=order) assert_equal(arr.shape,(10,10)) - assert numpy.all(arr[-1,:] != 0) - assert numpy.all(arr[-1,:] >= (20 - eps)) - assert numpy.all(arr[0,:] <= (5 + eps)) - assert numpy.all(arr >= (0 - eps)) - assert numpy.all(arr <= (24 + eps)) + assert_(numpy.all(arr[-1,:] != 0)) + assert_(numpy.all(arr[-1,:] >= (20 - eps))) + assert_(numpy.all(arr[0,:] <= (5 + eps))) + assert_(numpy.all(arr >= (0 - eps))) + assert_(numpy.all(arr <= (24 + eps))) def test_zoom2(self): "zoom 2" Modified: trunk/scipy/ndimage/tests/test_regression.py =================================================================== --- trunk/scipy/ndimage/tests/test_regression.py 2010-09-12 21:22:23 UTC (rev 6794) +++ trunk/scipy/ndimage/tests/test_regression.py 2010-09-12 21:24:55 UTC (rev 6795) @@ -1,5 +1,5 @@ import numpy as np -from numpy.testing import * +from numpy.testing import assert_array_almost_equal, run_module_suite import scipy.ndimage as ndimage From scipy-svn at scipy.org Sun Sep 12 17:25:13 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:25:13 -0500 (CDT) Subject: [Scipy-svn] r6796 - trunk/scipy/odr/tests Message-ID: <20100912212513.56CD139CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:25:13 -0500 (Sun, 12 Sep 2010) New Revision: 6796 Modified: trunk/scipy/odr/tests/test_odr.py Log: TST: odr: Don't use 'import *'. Modified: trunk/scipy/odr/tests/test_odr.py =================================================================== --- trunk/scipy/odr/tests/test_odr.py 2010-09-12 21:24:55 UTC (rev 6795) +++ trunk/scipy/odr/tests/test_odr.py 2010-09-12 21:25:13 UTC (rev 6796) @@ -1,7 +1,7 @@ # Scipy imports. import numpy as np from numpy import pi -from numpy.testing import * +from numpy.testing import assert_array_almost_equal, TestCase, run_module_suite from scipy.odr import Data, Model, ODR, RealData, odr_stop From scipy-svn at scipy.org Sun Sep 12 17:26:17 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:26:17 -0500 (CDT) Subject: [Scipy-svn] r6797 - trunk/scipy/optimize/tests Message-ID: <20100912212617.3941639CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:26:17 -0500 (Sun, 12 Sep 2010) New Revision: 6797 Modified: trunk/scipy/optimize/tests/test_cobyla.py trunk/scipy/optimize/tests/test_linesearch.py trunk/scipy/optimize/tests/test_minpack.py trunk/scipy/optimize/tests/test_nnls.py trunk/scipy/optimize/tests/test_nonlin.py trunk/scipy/optimize/tests/test_optimize.py trunk/scipy/optimize/tests/test_slsqp.py trunk/scipy/optimize/tests/test_zeros.py Log: TST: optimize: Don't use 'import *'. Don't use plain 'assert'. Modified: trunk/scipy/optimize/tests/test_cobyla.py =================================================================== --- trunk/scipy/optimize/tests/test_cobyla.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_cobyla.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -1,6 +1,6 @@ import math -from numpy.testing import * +from numpy.testing import assert_almost_equal, TestCase, run_module_suite from scipy.optimize import cobyla as co Modified: trunk/scipy/optimize/tests/test_linesearch.py =================================================================== --- trunk/scipy/optimize/tests/test_linesearch.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_linesearch.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -2,7 +2,7 @@ Tests for line search routines """ -from numpy.testing import * +from numpy.testing import assert_, assert_equal import scipy.optimize.linesearch as ls import numpy as np @@ -127,7 +127,7 @@ assert_equal(phi1, phi(s), name) assert_wolfe(s, phi, derphi, err_msg=name) - assert c > 3 # check that the iterator really works... + assert_(c > 3) # check that the iterator really works... def test_scalar_search_wolfe2(self): for name, phi, derphi, old_phi0 in self.scalar_iter(): @@ -167,7 +167,7 @@ c += 1 assert_line_wolfe(x, p, s, f, fprime, err_msg=name) - assert c > 3 # check that the iterator really works... + assert_(c > 3) # check that the iterator really works... def test_line_search_wolfe2(self): c = 0 @@ -187,7 +187,7 @@ if s < smax: c += 1 assert_line_wolfe(x, p, s, f, fprime, err_msg=name) - assert c > 3 # check that the iterator really works... + assert_(c > 3) # check that the iterator really works... def test_line_search_armijo(self): c = 0 @@ -200,7 +200,7 @@ assert_equal(self.fcount, fc) assert_equal(fv, f(x + s*p)) assert_line_armijo(x, p, s, f, err_msg=name) - assert c >= 9 + assert_(c >= 9) # -- More specific tests @@ -231,6 +231,6 @@ for func in [ls.scalar_search_wolfe1, ls.scalar_search_wolfe2]: count = [0] r = func(phi, derphi, phi(0), None, derphi(0)) - assert r[0] is not None, (r, func) - assert count[0] <= 2 + 2, (count, func) + assert_(r[0] is not None, (r, func)) + assert_(count[0] <= 2 + 2, (count, func)) assert_wolfe(r[0], phi, derphi, err_msg=str(func)) Modified: trunk/scipy/optimize/tests/test_minpack.py =================================================================== --- trunk/scipy/optimize/tests/test_minpack.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_minpack.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -2,12 +2,13 @@ Unit tests for optimization routines from minpack.py. """ -from numpy.testing import * +from numpy.testing import assert_, assert_almost_equal, assert_array_equal, \ + assert_array_almost_equal, TestCase, run_module_suite import numpy as np from numpy import array, float64 from scipy import optimize -from scipy.optimize.minpack import fsolve, leastsq, curve_fit +from scipy.optimize.minpack import leastsq, curve_fit class TestFSolve(object): def pressure_network(self, flow_rates, Qtot, k): @@ -131,8 +132,8 @@ def func(x,a): return x**a popt, pcov = curve_fit(func, self.x, self.y) - assert len(popt)==1 - assert pcov.shape==(1,1) + assert_(len(popt) == 1) + assert_(pcov.shape == (1,1)) assert_almost_equal(popt[0], 1.9149, decimal=4) assert_almost_equal(pcov[0,0], 0.0016, decimal=4) @@ -140,8 +141,8 @@ def func(x, a, b): return b*x**a popt, pcov = curve_fit(func, self.x, self.y) - assert len(popt)==2 - assert pcov.shape==(2,2) + assert_(len(popt) == 2) + assert_(pcov.shape == (2,2)) assert_array_almost_equal(popt, [1.7989, 1.1642], decimal=4) assert_array_almost_equal(pcov, [[0.0852, -0.1260],[-0.1260, 0.1912]], decimal=4) Modified: trunk/scipy/optimize/tests/test_nnls.py =================================================================== --- trunk/scipy/optimize/tests/test_nnls.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_nnls.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -3,7 +3,7 @@ Sep 2008 """ -from numpy.testing import * +from numpy.testing import assert_, TestCase, run_module_suite from scipy.optimize import nnls from numpy import arange, dot @@ -13,12 +13,12 @@ class TestNNLS(TestCase): def test_nnls(self): - a=arange(25.0).reshape(-1,5) - x=arange(5.0) - y=dot(a,x) - x, res= nnls(a,y) - assert res<1e-7 - assert norm(dot(a,x)-y)<1e-7 + a = arange(25.0).reshape(-1,5) + x = arange(5.0) + y = dot(a,x) + x, res = nnls(a,y) + assert_(res < 1e-7) + assert_(norm(dot(a,x)-y) < 1e-7) if __name__ == "__main__": run_module_suite() Modified: trunk/scipy/optimize/tests/test_nonlin.py =================================================================== --- trunk/scipy/optimize/tests/test_nonlin.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_nonlin.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -3,7 +3,7 @@ May 2007 """ -from numpy.testing import * +from numpy.testing import assert_, dec, TestCase, run_module_suite from scipy.optimize import nonlin from numpy import matrix, diag, dot @@ -80,7 +80,7 @@ def _check_func(self, f, func, f_tol=1e-2): x = func(f, f.xin, f_tol=f_tol, maxiter=200, verbose=0) - assert np.absolute(f(x)).max() < f_tol + assert_(np.absolute(f(x)).max() < f_tol) @dec.knownfailureif(True) def _check_func_fail(self, *a, **kw): @@ -122,13 +122,13 @@ for k in xrange(min(npoints, j+1)): dx = self.xs[j-k+1] - self.xs[j-k] df = self.fs[j-k+1] - self.fs[j-k] - assert np.allclose(dx, jac.solve(df)) + assert_(np.allclose(dx, jac.solve(df))) # Check that the `npoints` secant bound is strict if j >= npoints: dx = self.xs[j-npoints+1] - self.xs[j-npoints] df = self.fs[j-npoints+1] - self.fs[j-npoints] - assert not np.allclose(dx, jac.solve(df)) + assert_(not np.allclose(dx, jac.solve(df))) def test_broyden1(self): self._check_secant(nonlin.BroydenFirst) @@ -148,7 +148,7 @@ dx = x - self.xs[last_j] B += (df - dot(B, dx))[:,None] * dx[None,:] / dot(dx, dx) jac.update(x, f) - assert np.allclose(jac.todense(), B, rtol=1e-10, atol=1e-13) + assert_(np.allclose(jac.todense(), B, rtol=1e-10, atol=1e-13)) def test_broyden2_update(self): # Check that BroydenSecond update works as for a dense matrix @@ -162,7 +162,7 @@ dx = x - self.xs[last_j] H += (dx - dot(H, df))[:,None] * df[None,:] / dot(df, df) jac.update(x, f) - assert np.allclose(jac.todense(), inv(H), rtol=1e-10, atol=1e-13) + assert_(np.allclose(jac.todense(), inv(H), rtol=1e-10, atol=1e-13)) def test_anderson(self): # Anderson mixing (with w0=0) satisfies secant conditions @@ -190,7 +190,7 @@ sol = nonlin.nonlin_solve(func, b*0, jac, maxiter=maxiter, f_tol=1e-6, line_search=None, verbose=0) - assert np.allclose(dot(A, sol), b, atol=1e-6) + assert_(np.allclose(dot(A, sol), b, atol=1e-6)) def test_broyden1(self): # Broyden methods solve linear systems exactly in 2*N steps @@ -314,32 +314,32 @@ def test_broyden1(self): x= nonlin.broyden1(F,F.xin,iter=12,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 + assert_(nonlin.norm(x) < 1e-9) + assert_(nonlin.norm(F(x)) < 1e-9) def test_broyden2(self): x= nonlin.broyden2(F,F.xin,iter=12,alpha=1) - assert nonlin.norm(x)<1e-9 - assert nonlin.norm(F(x))<1e-9 + assert_(nonlin.norm(x) < 1e-9) + assert_(nonlin.norm(F(x)) < 1e-9) def test_anderson(self): x= nonlin.anderson(F,F.xin,iter=12,alpha=0.03,M=5) - assert nonlin.norm(x)<0.33 + assert_(nonlin.norm(x) < 0.33) def test_linearmixing(self): x = nonlin.linearmixing(F,F.xin,iter=60,alpha=0.5) - assert nonlin.norm(x)<1e-7 - assert nonlin.norm(F(x))<1e-7 + assert_(nonlin.norm(x) < 1e-7) + assert_(nonlin.norm(F(x)) < 1e-7) def test_exciting(self): x= nonlin.excitingmixing(F,F.xin,iter=20,alpha=0.5) - assert nonlin.norm(x)<1e-5 - assert nonlin.norm(F(x))<1e-5 + assert_(nonlin.norm(x) < 1e-5) + assert_(nonlin.norm(F(x)) < 1e-5) def test_diagbroyden(self): x= nonlin.diagbroyden(F,F.xin,iter=11,alpha=1) - assert nonlin.norm(x)<1e-8 - assert nonlin.norm(F(x))<1e-8 + assert_(nonlin.norm(x) < 1e-8) + assert_(nonlin.norm(F(x)) < 1e-8) if __name__ == "__main__": run_module_suite() Modified: trunk/scipy/optimize/tests/test_optimize.py =================================================================== --- trunk/scipy/optimize/tests/test_optimize.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_optimize.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -10,10 +10,10 @@ """ -from numpy.testing import * +from numpy.testing import assert_raises, assert_almost_equal, \ + assert_, TestCase, run_module_suite from scipy import optimize -from scipy.optimize import leastsq from numpy import array, zeros, float64, dot, log, exp, inf, sin, cos import numpy as np from scipy.optimize.tnc import RCSTRINGS, MSG_NONE @@ -66,19 +66,19 @@ err = abs(self.func(params) - self.func(self.solution)) #print "CG: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) print self.funccalls, self.gradcalls # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 9, self.funccalls - assert self.gradcalls == 7, self.gradcalls + assert_(self.funccalls == 9, self.funccalls) + assert_(self.gradcalls == 7, self.gradcalls) # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[2:4], + assert_(np.allclose(self.trace[2:4], [[0, -0.5, 0.5], [0, -5.05700028e-01, 4.95985862e-01]], - atol=1e-14, rtol=1e-7), self.trace[2:4] + atol=1e-14, rtol=1e-7), self.trace[2:4]) def test_bfgs(self): @@ -92,18 +92,18 @@ err = abs(self.func(params) - self.func(self.solution)) #print "BFGS: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 10, self.funccalls - assert self.gradcalls == 8, self.gradcalls + assert_(self.funccalls == 10, self.funccalls) + assert_(self.gradcalls == 8, self.gradcalls) # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[6:8], + assert_(np.allclose(self.trace[6:8], [[0, -5.25060743e-01, 4.87748473e-01], [0, -5.24885582e-01, 4.87530347e-01]], - atol=1e-14, rtol=1e-7), self.trace[6:8] + atol=1e-14, rtol=1e-7), self.trace[6:8]) def test_powell(self): @@ -117,21 +117,21 @@ err = abs(self.func(params) - self.func(self.solution)) #print "Powell: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 116, self.funccalls - assert self.gradcalls == 0, self.gradcalls + assert_(self.funccalls == 116, self.funccalls) + assert_(self.gradcalls == 0, self.gradcalls) # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[34:39], + assert_(np.allclose(self.trace[34:39], [[ 0.72949016, -0.44156936, 0.47100962], [ 0.72949016, -0.44156936, 0.48052496], [ 1.45898031, -0.88313872, 0.95153458], [ 0.72949016, -0.44156936, 0.47576729], [ 1.72949016, -0.44156936, 0.47576729]], - atol=1e-14, rtol=1e-7), self.trace[34:39] + atol=1e-14, rtol=1e-7), self.trace[34:39]) def test_neldermead(self): """ Nelder-Mead simplex algorithm @@ -144,18 +144,18 @@ err = abs(self.func(params) - self.func(self.solution)) #print "Nelder-Mead: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 167, self.funccalls - assert self.gradcalls == 0, self.gradcalls + assert_(self.funccalls == 167, self.funccalls) + assert_(self.gradcalls == 0, self.gradcalls) # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[76:78], + assert_(np.allclose(self.trace[76:78], [[0.1928968 , -0.62780447, 0.35166118], [0.19572515, -0.63648426, 0.35838135]], - atol=1e-14, rtol=1e-7), self.trace[76:78] + atol=1e-14, rtol=1e-7), self.trace[76:78]) def test_ncg(self): """ line-search Newton conjugate gradient optimization routine @@ -169,19 +169,19 @@ err = abs(self.func(params) - self.func(self.solution)) #print "NCG: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 7, self.funccalls - assert self.gradcalls == 18, self.gradcalls # 0.8.0 - #assert self.gradcalls == 22, self.gradcalls # 0.7.0 + assert_(self.funccalls == 7, self.funccalls) + assert_(self.gradcalls == 18, self.gradcalls) # 0.8.0 + #assert_(self.gradcalls == 22, self.gradcalls) # 0.7.0 # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[3:5], + assert_(np.allclose(self.trace[3:5], [[-4.35700753e-07, -5.24869435e-01, 4.87527480e-01], [-4.35700753e-07, -5.24869401e-01, 4.87527774e-01]], - atol=1e-6, rtol=1e-7), self.trace[:5] + atol=1e-6, rtol=1e-7), self.trace[:5]) def test_l_bfgs_b(self): @@ -195,18 +195,18 @@ err = abs(self.func(params) - self.func(self.solution)) #print "LBFGSB: Difference is: " + str(err) - assert err < 1e-6 + assert_(err < 1e-6) # Ensure that function call counts are 'known good'; these are from # Scipy 0.7.0. Don't allow them to increase. - assert self.funccalls == 7, self.funccalls - assert self.gradcalls == 5, self.gradcalls + assert_(self.funccalls == 7, self.funccalls) + assert_(self.gradcalls == 5, self.gradcalls) # Ensure that the function behaves the same; this is from Scipy 0.7.0 - assert np.allclose(self.trace[3:5], + assert_(np.allclose(self.trace[3:5], [[0. , -0.52489628, 0.48753042], [0. , -0.52489628, 0.48753042]], - atol=1e-14, rtol=1e-7), self.trace[3:5] + atol=1e-14, rtol=1e-7), self.trace[3:5]) def test_brent(self): """ brent algorithm @@ -220,19 +220,19 @@ x = optimize.brent(lambda x: (x-1.5)**2-0.8, brack = (-15,-1,15)) err4 = abs(x - 1.5) - assert max((err1,err2,err3,err4)) < 1e-6 + assert_(max((err1,err2,err3,err4)) < 1e-6) def test_fminbound(self): """Test fminbound """ x = optimize.fminbound(lambda x: (x - 1.5)**2 - 0.8, 0, 1) - assert abs(x - 1) < 1e-5 + assert_(abs(x - 1) < 1e-5) x = optimize.fminbound(lambda x: (x - 1.5)**2 - 0.8, 1, 5) - assert abs(x - 1.5) < 1e-6 + assert_(abs(x - 1.5) < 1e-6) x = optimize.fminbound(lambda x: (x - 1.5)**2 - 0.8, numpy.array([1]), numpy.array([5])) - assert abs(x - 1.5) < 1e-6 + assert_(abs(x - 1.5) < 1e-6) assert_raises(ValueError, optimize.fminbound, lambda x: (x - 1.5)**2 - 0.8, 5, 1) Modified: trunk/scipy/optimize/tests/test_slsqp.py =================================================================== --- trunk/scipy/optimize/tests/test_slsqp.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_slsqp.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -1,4 +1,4 @@ -from numpy.testing import * +from numpy.testing import assert_array_almost_equal, TestCase, run_module_suite import numpy as np from scipy.optimize import fmin_slsqp Modified: trunk/scipy/optimize/tests/test_zeros.py =================================================================== --- trunk/scipy/optimize/tests/test_zeros.py 2010-09-12 21:25:13 UTC (rev 6796) +++ trunk/scipy/optimize/tests/test_zeros.py 2010-09-12 21:26:17 UTC (rev 6797) @@ -3,7 +3,7 @@ from math import sqrt from numpy.testing import TestCase, assert_almost_equal, assert_warns, \ - run_module_suite + assert_, run_module_suite from scipy.optimize import zeros as cc @@ -16,7 +16,7 @@ b = sqrt(3) for function, fname in zip(functions, fstrings): zero, r = method(function, a, b, xtol=0.1e-12, full_output=True) - assert r.converged + assert_(r.converged) assert_almost_equal(zero, 1.0, decimal=12, err_msg='method %s, function %s' % (name, fname)) From scipy-svn at scipy.org Sun Sep 12 17:27:22 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:27:22 -0500 (CDT) Subject: [Scipy-svn] r6798 - trunk/scipy/signal/tests Message-ID: <20100912212722.1ACD339CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:27:21 -0500 (Sun, 12 Sep 2010) New Revision: 6798 Modified: trunk/scipy/signal/tests/test_signaltools.py trunk/scipy/signal/tests/test_wavelets.py Log: TST: signal: Don't use plain 'assert'. Modified: trunk/scipy/signal/tests/test_signaltools.py =================================================================== --- trunk/scipy/signal/tests/test_signaltools.py 2010-09-12 21:26:17 UTC (rev 6797) +++ trunk/scipy/signal/tests/test_signaltools.py 2010-09-12 21:27:21 UTC (rev 6798) @@ -1,10 +1,9 @@ #this program corresponds to special.py from decimal import Decimal -import types from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_almost_equal, assert_array_equal, assert_array_almost_equal, \ - dec + assert_, dec import scipy.signal as signal from scipy.signal import lfilter, correlate, convolve, convolve2d, hilbert @@ -255,7 +254,7 @@ b = np.random.rand(1321) + 1j*np.random.rand(1321) c = signal.fftconvolve(a, b, 'full') d = np.convolve(a, b, 'full') - assert np.allclose(c, d, rtol=1e-10) + assert_(np.allclose(c, d, rtol=1e-10)) class TestMedFilt(TestCase): def test_basic(self): Modified: trunk/scipy/signal/tests/test_wavelets.py =================================================================== --- trunk/scipy/signal/tests/test_wavelets.py 2010-09-12 21:26:17 UTC (rev 6797) +++ trunk/scipy/signal/tests/test_wavelets.py 2010-09-12 21:27:21 UTC (rev 6798) @@ -1,6 +1,6 @@ import numpy as np from numpy.testing import TestCase, run_module_suite, assert_equal, \ - assert_array_equal, assert_array_almost_equal, assert_array_less + assert_array_equal, assert_array_almost_equal, assert_array_less, assert_ from scipy.signal import wavelets @@ -19,7 +19,7 @@ lpcoef = wavelets.daub(i) k = len(lpcoef) x,phi,psi = wavelets.cascade(lpcoef,J) - assert len(x) == len(phi) == len(psi) + assert_(len(x) == len(phi) == len(psi)) assert_equal(len(x),(k-1)*2**J) def test_morlet(self): From scipy-svn at scipy.org Sun Sep 12 17:29:13 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:29:13 -0500 (CDT) Subject: [Scipy-svn] r6799 - trunk/scipy/spatial/tests Message-ID: <20100912212913.736DF39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:29:13 -0500 (Sun, 12 Sep 2010) New Revision: 6799 Modified: trunk/scipy/spatial/tests/test_distance.py trunk/scipy/spatial/tests/test_kdtree.py trunk/scipy/spatial/tests/test_qhull.py Log: TST: spatial: Don't use 'import *'. Don't use plain 'assert'. Remove duplicated tests. Rename tests that were different but had the same name. Modified: trunk/scipy/spatial/tests/test_distance.py =================================================================== --- trunk/scipy/spatial/tests/test_distance.py 2010-09-12 21:27:21 UTC (rev 6798) +++ trunk/scipy/spatial/tests/test_distance.py 2010-09-12 21:29:13 UTC (rev 6799) @@ -37,7 +37,7 @@ import os.path import numpy as np -from numpy.testing import * +from numpy.testing import verbose, TestCase, run_module_suite from scipy.spatial.distance import squareform, pdist, cdist, matching, \ jaccard, dice, sokalsneath, rogerstanimoto, \ russellrao, yule, num_obs_y, num_obs_dm, \ @@ -301,17 +301,6 @@ print (Y1-Y2).max() self.failUnless(within_tol(Y1, Y2, eps)) - def test_cdist_sqeuclidean_random(self): - "Tests cdist(X, 'sqeuclidean') on random data." - eps = 1e-07 - # Get the data: the input matrix and the right output. - X1 = eo['cdist-X1'] - X2 = eo['cdist-X2'] - Y1 = cdist(X1, X2, 'sqeuclidean') - Y2 = cdist(X1, X2, 'test_sqeuclidean') - if verbose > 2: - print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) def test_cdist_cosine_random(self): "Tests cdist(X, 'cosine') on random data." @@ -486,7 +475,7 @@ Y_test1 = pdist(X, 'euclidean') self.failUnless(within_tol(Y_test1, Y_right, eps)) - def test_pdist_euclidean_random(self): + def test_pdist_euclidean_random_u(self): "Tests pdist(X, 'euclidean') with unicode metric string" eps = 1e-07 # Get the data: the input matrix and the right output. @@ -827,7 +816,7 @@ Y_test2 = pdist(X, 'test_minkowski', 3.2) self.failUnless(within_tol(Y_test2, Y_right, eps)) - def test_pdist_minkowski_iris(self): + def test_pdist_minkowski_3_2_iris(self): "Tests pdist(X, 'minkowski') on iris data." eps = 1e-07 # Get the data: the input matrix and the right output. @@ -837,7 +826,7 @@ #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max() self.failUnless(within_tol(Y_test1, Y_right, eps)) - def test_pdist_minkowski_iris_float32(self): + def test_pdist_minkowski_3_2_iris_float32(self): "Tests pdist(X, 'minkowski') on iris data. (float32)" eps = 1e-07 # Get the data: the input matrix and the right output. @@ -847,7 +836,7 @@ #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max() self.failUnless(within_tol(Y_test1, Y_right, eps)) - def test_pdist_minkowski_iris_nonC(self): + def test_pdist_minkowski_3_2_iris_nonC(self): "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data." eps = 1e-07 # Get the data: the input matrix and the right output. @@ -856,7 +845,7 @@ Y_test2 = pdist(X, 'test_minkowski', 3.2) self.failUnless(within_tol(Y_test2, Y_right, eps)) - def test_pdist_minkowski_iris(self): + def test_pdist_minkowski_5_8_iris(self): "Tests pdist(X, 'minkowski') on iris data." eps = 1e-07 # Get the data: the input matrix and the right output. @@ -866,7 +855,7 @@ #print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max() self.failUnless(within_tol(Y_test1, Y_right, eps)) - def test_pdist_minkowski_iris_float32(self): + def test_pdist_minkowski_5_8_iris_float32(self): "Tests pdist(X, 'minkowski') on iris data. (float32)" eps = 1e-06 # Get the data: the input matrix and the right output. @@ -878,7 +867,7 @@ print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max() self.failUnless(within_tol(Y_test1, Y_right, eps)) - def test_pdist_minkowski_iris_nonC(self): + def test_pdist_minkowski_5_8_iris_nonC(self): "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data." eps = 1e-07 # Get the data: the input matrix and the right output. Modified: trunk/scipy/spatial/tests/test_kdtree.py =================================================================== --- trunk/scipy/spatial/tests/test_kdtree.py 2010-09-12 21:27:21 UTC (rev 6798) +++ trunk/scipy/spatial/tests/test_kdtree.py 2010-09-12 21:29:13 UTC (rev 6799) @@ -1,7 +1,9 @@ # Copyright Anne M. Archibald 2008 # Released under the scipy license -from numpy.testing import * +from numpy.testing import assert_equal, assert_array_equal, assert_almost_equal, \ + assert_, run_module_suite + import numpy as np from scipy.spatial import KDTree, Rectangle, distance_matrix, cKDTree from scipy.spatial import minkowski_distance as distance @@ -12,7 +14,7 @@ d, i = self.kdtree.query(x, 1) assert_almost_equal(d**2,np.sum((x-self.data[i])**2)) eps = 1e-8 - assert np.all(np.sum((self.data-x[np.newaxis,:])**2,axis=1)>d**2-eps) + assert_(np.all(np.sum((self.data-x[np.newaxis,:])**2,axis=1)>d**2-eps)) def test_m_nearest(self): x = self.x @@ -35,7 +37,7 @@ continue hits += 1 assert_almost_equal(near_d**2,np.sum((x-self.data[near_i])**2)) - assert near_d=self.d/(1.+self.eps)) + assert_(np.all(distance(self.data[c],self.x,self.p)>=self.d/(1.+self.eps))) class test_random_ball(ball_consistency): @@ -289,7 +295,7 @@ r = T.query_ball_point(np.random.randn(2,3,m),1) assert_equal(r.shape,(2,3)) - assert isinstance(r[0,0],list) + assert_(isinstance(r[0,0],list)) class two_trees_consistency: @@ -297,13 +303,13 @@ r = self.T1.query_ball_tree(self.T2, self.d, p=self.p, eps=self.eps) for i, l in enumerate(r): for j in l: - assert distance(self.data1[i],self.data2[j],self.p)<=self.d*(1.+self.eps) + assert_(distance(self.data1[i],self.data2[j],self.p)<=self.d*(1.+self.eps)) def test_found_all(self): r = self.T1.query_ball_tree(self.T2, self.d, p=self.p, eps=self.eps) for i, l in enumerate(r): c = np.ones(self.T2.n,dtype=np.bool) c[l] = False - assert np.all(distance(self.data2[c],self.data1[i],self.p)>=self.d/(1.+self.eps)) + assert_(np.all(distance(self.data2[c],self.data1[i],self.p)>=self.d/(1.+self.eps))) class test_two_random_trees(two_trees_consistency): @@ -389,7 +395,7 @@ def test_multiple_radius(self): rs = np.exp(np.linspace(np.log(0.01),np.log(10),3)) results = self.T1.count_neighbors(self.T2, rs) - assert np.all(np.diff(results)>=0) + assert_(np.all(np.diff(results)>=0)) for r,result in zip(rs, results): assert_equal(self.T1.count_neighbors(self.T2, r), result) @@ -408,7 +414,7 @@ for j in l: assert_equal(M[i,j],distance(self.T1.data[i],self.T2.data[j])) for ((i,j),d) in M.items(): - assert j in r[i] + assert_(j in r[i]) def test_zero_distance(self): M = self.T1.sparse_distance_matrix(self.T1, self.r) # raises an exception for bug 870 @@ -442,7 +448,7 @@ if i Author: warren.weckesser Date: 2010-09-12 16:30:28 -0500 (Sun, 12 Sep 2010) New Revision: 6800 Modified: trunk/scipy/special/tests/test_basic.py trunk/scipy/special/tests/test_data.py trunk/scipy/special/tests/test_lambertw.py trunk/scipy/special/tests/test_mpmath.py trunk/scipy/special/tests/test_orthogonal.py trunk/scipy/special/tests/test_orthogonal_eval.py trunk/scipy/special/tests/test_spfun_stats.py trunk/scipy/special/tests/testutils.py Log: TST: special: Don't use 'import *'. Don't use plain 'assert'. Rename tests that were different but had the same name. Modified: trunk/scipy/special/tests/test_basic.py =================================================================== --- trunk/scipy/special/tests/test_basic.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_basic.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -20,15 +20,18 @@ # test_sph_in # test_sph_jn # test_sph_kn + import numpy as np -from numpy import array +from numpy import array, isnan, r_, arange, finfo, pi, sin, cos, tan, exp, log, zeros, \ + sqrt, asarray, inf, nan_to_num, real, arctan, float_ -from numpy.testing import * -from scipy.special import * +from numpy.testing import assert_equal, assert_almost_equal, assert_array_equal, \ + assert_array_almost_equal, assert_approx_equal, assert_, \ + rand, dec, TestCase, run_module_suite +from scipy import special import scipy.special._cephes as cephes -import numpy as np -from testutils import * +from testutils import assert_tol_equal, with_special_errors class TestCephes(TestCase): def test_airy(self): @@ -467,16 +470,16 @@ def test_airy(self): #This tests the airy function to ensure 8 place accuracy in computation - x = airy(.99) + x = special.airy(.99) assert_array_almost_equal(x,array([0.13689066,-0.16050153,1.19815925,0.92046818]),8) - x = airy(.41) + x = special.airy(.41) assert_array_almost_equal(x,array([0.25238916,-.23480512,0.80686202,0.51053919]),8) - x = airy(-.36) + x = special.airy(-.36) assert_array_almost_equal(x,array([0.44508477,-0.23186773,0.44939534,0.48105354]),8) def test_airye(self): - a = airye(0.01) - b = airy(0.01) + a = special.airye(0.01) + b = special.airy(0.01) b1 = [None]*4 for n in range(2): b1[n] = b[n]*exp(2.0/3.0*0.01*sqrt(0.01)) @@ -485,7 +488,7 @@ assert_array_almost_equal(a,b1,6) def test_bi_zeros(self): - bi = bi_zeros(2) + bi = special.bi_zeros(2) bia = (array([-1.17371322, -3.2710930]), array([-2.29443968, -4.07315509]), array([-0.45494438, 0.39652284]), @@ -493,7 +496,7 @@ assert_array_almost_equal(bi,bia,4) def test_ai_zeros(self): - ai = ai_zeros(1) + ai = special.ai_zeros(1) assert_array_almost_equal(ai,(array([-2.33810741]), array([-1.01879297]), array([ 0.5357]), @@ -501,10 +504,10 @@ class TestAssocLaguerre(TestCase): def test_assoc_laguerre(self): - a1 = genlaguerre(11,1) - a2 = assoc_laguerre(.2,11,1) + a1 = special.genlaguerre(11,1) + a2 = special.assoc_laguerre(.2,11,1) assert_array_almost_equal(a2,a1(.2),8) - a2 = assoc_laguerre(1,11,1) + a2 = special.assoc_laguerre(1,11,1) assert_array_almost_equal(a2,a1(1),8) class TestBesselpoly(TestCase): @@ -513,23 +516,23 @@ class TestKelvin(TestCase): def test_bei(self): - mbei = bei(2) + mbei = special.bei(2) assert_almost_equal(mbei, 0.9722916273066613,5)#this may not be exact def test_beip(self): - mbeip = beip(2) + mbeip = special.beip(2) assert_almost_equal(mbeip,0.91701361338403631,5)#this may not be exact def test_ber(self): - mber = ber(2) + mber = special.ber(2) assert_almost_equal(mber,0.75173418271380821,5)#this may not be exact def test_berp(self): - mberp = berp(2) + mberp = special.berp(2) assert_almost_equal(mberp,-0.49306712470943909,5)#this may not be exact def test_bei_zeros(self): - bi = bi_zeros(5) + bi = special.bi_zeros(5) assert_array_almost_equal(bi[0],array([-1.173713222709127, -3.271093302836352, -4.830737841662016, @@ -556,7 +559,7 @@ def test_beip_zeros(self): - bip = beip_zeros(5) + bip = special.beip_zeros(5) assert_array_almost_equal(bip,array([ 3.772673304934953, 8.280987849760042, 12.742147523633703, @@ -564,7 +567,7 @@ 21.641143941167325]),4) def test_ber_zeros(self): - ber = ber_zeros(5) + ber = special.ber_zeros(5) assert_array_almost_equal(ber,array([2.84892, 7.23883, 11.67396, @@ -572,7 +575,7 @@ 20.55463]),4) def test_berp_zeros(self): - brp = berp_zeros(5) + brp = special.berp_zeros(5) assert_array_almost_equal(brp,array([6.03871, 10.51364, 14.96844, @@ -580,30 +583,30 @@ 23.86430]),4) def test_kelvin(self): - mkelv = kelvin(2) - assert_array_almost_equal(mkelv,(ber(2)+bei(2)*1j, - ker(2)+kei(2)*1j, - berp(2)+beip(2)*1j, - kerp(2)+keip(2)*1j),8) + mkelv = special.kelvin(2) + assert_array_almost_equal(mkelv,(special.ber(2) + special.bei(2)*1j, + special.ker(2) + special.kei(2)*1j, + special.berp(2) + special.beip(2)*1j, + special.kerp(2) + special.keip(2)*1j),8) def test_kei(self): - mkei = kei(2) + mkei = special.kei(2) assert_almost_equal(mkei,-0.20240006776470432,5) def test_keip(self): - mkeip = keip(2) + mkeip = special.keip(2) assert_almost_equal(mkeip,0.21980790991960536,5) def test_ker(self): - mker = ker(2) + mker = special.ker(2) assert_almost_equal(mker,-0.041664513991509472,5) def test_kerp(self): - mkerp = kerp(2) + mkerp = special.kerp(2) assert_almost_equal(mkerp,-0.10660096588105264,5) def test_kei_zeros(self): - kei = kei_zeros(5) + kei = special.kei_zeros(5) assert_array_almost_equal(kei,array([ 3.91467, 8.34422, 12.78256, @@ -611,7 +614,7 @@ 21.66464]),4) def test_keip_zeros(self): - keip = keip_zeros(5) + keip = special.keip_zeros(5) assert_array_almost_equal(keip,array([ 4.93181, 9.40405, 13.85827, @@ -622,7 +625,7 @@ # numbers come from 9.9 of A&S pg. 381 def test_kelvin_zeros(self): - tmp = kelvin_zeros(5) + tmp = special.kelvin_zeros(5) berz,beiz,kerz,keiz,berpz,beipz,kerpz,keipz = tmp assert_array_almost_equal(berz,array([ 2.84892, 7.23883, @@ -668,7 +671,7 @@ 22.75379]),4) def test_ker_zeros(self): - ker = ker_zeros(5) + ker = special.ker_zeros(5) assert_array_almost_equal(ker,array([ 1.71854, 6.12728, 10.56294, @@ -676,7 +679,7 @@ 19.44381]),4) def test_kerp_zeros(self): - kerp = kerp_zeros(5) + kerp = special.kerp_zeros(5) assert_array_almost_equal(kerp,array([ 2.66584, 7.17212, 11.63218, @@ -685,7 +688,7 @@ class TestBernoulli(TestCase): def test_bernoulli(self): - brn = bernoulli(5) + brn = special.bernoulli(5) assert_array_almost_equal(brn,array([1.0000, -0.5000, 0.1667, @@ -695,173 +698,174 @@ class TestBeta(TestCase): def test_beta(self): - bet = beta(2,4) - betg = (gamma(2)*gamma(4))/gamma(6) + bet = special.beta(2,4) + betg = (special.gamma(2)*special.gamma(4))/special.gamma(6) assert_almost_equal(bet,betg,8) def test_betaln(self): - betln = betaln(2,4) - bet = log(abs(beta(2,4))) + betln = special.betaln(2,4) + bet = log(abs(special.beta(2,4))) assert_almost_equal(betln,bet,8) def test_betainc(self): - btinc = betainc(1,1,.2) + btinc = special.betainc(1,1,.2) assert_almost_equal(btinc,0.2,8) def test_betaincinv(self): - y = betaincinv(2,4,.5) - comp = betainc(2,4,y) + y = special.betaincinv(2,4,.5) + comp = special.betainc(2,4,y) assert_almost_equal(comp,.5,5) class TestTrigonometric(TestCase): def test_cbrt(self): - cb = cbrt(27) + cb = special.cbrt(27) cbrl = 27**(1.0/3.0) assert_approx_equal(cb,cbrl) def test_cbrtmore(self): - cb1 = cbrt(27.9) + cb1 = special.cbrt(27.9) cbrl1 = 27.9**(1.0/3.0) assert_almost_equal(cb1,cbrl1,8) def test_cosdg(self): - cdg = cosdg(90) + cdg = special.cosdg(90) cdgrl = cos(pi/2.0) assert_almost_equal(cdg,cdgrl,8) def test_cosdgmore(self): - cdgm = cosdg(30) + cdgm = special.cosdg(30) cdgmrl = cos(pi/6.0) assert_almost_equal(cdgm,cdgmrl,8) def test_cosm1(self): - cs = (cosm1(0),cosm1(.3),cosm1(pi/10)) + cs = (special.cosm1(0),special.cosm1(.3),special.cosm1(pi/10)) csrl = (cos(0)-1,cos(.3)-1,cos(pi/10)-1) assert_array_almost_equal(cs,csrl,8) def test_cotdg(self): - ct = cotdg(30) + ct = special.cotdg(30) ctrl = tan(pi/6.0)**(-1) assert_almost_equal(ct,ctrl,8) def test_cotdgmore(self): - ct1 = cotdg(45) + ct1 = special.cotdg(45) ctrl1 = tan(pi/4.0)**(-1) assert_almost_equal(ct1,ctrl1,8) def test_specialpoints(self): - assert_almost_equal(cotdg(45), 1.0, 14) - assert_almost_equal(cotdg(-45), -1.0, 14) - assert_almost_equal(cotdg(90), 0.0, 14) - assert_almost_equal(cotdg(-90), 0.0, 14) - assert_almost_equal(cotdg(135), -1.0, 14) - assert_almost_equal(cotdg(-135), 1.0, 14) - assert_almost_equal(cotdg(225), 1.0, 14) - assert_almost_equal(cotdg(-225), -1.0, 14) - assert_almost_equal(cotdg(270), 0.0, 14) - assert_almost_equal(cotdg(-270), 0.0, 14) - assert_almost_equal(cotdg(315), -1.0, 14) - assert_almost_equal(cotdg(-315), 1.0, 14) - assert_almost_equal(cotdg(765), 1.0, 14) + assert_almost_equal(special.cotdg(45), 1.0, 14) + assert_almost_equal(special.cotdg(-45), -1.0, 14) + assert_almost_equal(special.cotdg(90), 0.0, 14) + assert_almost_equal(special.cotdg(-90), 0.0, 14) + assert_almost_equal(special.cotdg(135), -1.0, 14) + assert_almost_equal(special.cotdg(-135), 1.0, 14) + assert_almost_equal(special.cotdg(225), 1.0, 14) + assert_almost_equal(special.cotdg(-225), -1.0, 14) + assert_almost_equal(special.cotdg(270), 0.0, 14) + assert_almost_equal(special.cotdg(-270), 0.0, 14) + assert_almost_equal(special.cotdg(315), -1.0, 14) + assert_almost_equal(special.cotdg(-315), 1.0, 14) + assert_almost_equal(special.cotdg(765), 1.0, 14) def test_sinc(self): c = arange(-2,2,.1) - y = sinc(c) + y = special.sinc(c) yre = sin(pi*c)/(pi*c) yre[20] = 1.0 assert_array_almost_equal(y, yre, 4) + def test_0(self): x = 0.0 - assert_equal(sinc(x),1.0) + assert_equal(special.sinc(x),1.0) def test_sindg(self): - sn = sindg(90) + sn = special.sindg(90) assert_equal(sn,1.0) def test_sindgmore(self): - snm = sindg(30) + snm = special.sindg(30) snmrl = sin(pi/6.0) assert_almost_equal(snm,snmrl,8) - snm1 = sindg(45) + snm1 = special.sindg(45) snmrl1 = sin(pi/4.0) assert_almost_equal(snm1,snmrl1,8) class TestTandg(TestCase): def test_tandg(self): - tn = tandg(30) + tn = special.tandg(30) tnrl = tan(pi/6.0) assert_almost_equal(tn,tnrl,8) def test_tandgmore(self): - tnm = tandg(45) + tnm = special.tandg(45) tnmrl = tan(pi/4.0) assert_almost_equal(tnm,tnmrl,8) - tnm1 = tandg(60) + tnm1 = special.tandg(60) tnmrl1 = tan(pi/3.0) assert_almost_equal(tnm1,tnmrl1,8) def test_specialpoints(self): - assert_almost_equal(tandg(0), 0.0, 14) - assert_almost_equal(tandg(45), 1.0, 14) - assert_almost_equal(tandg(-45), -1.0, 14) - assert_almost_equal(tandg(135), -1.0, 14) - assert_almost_equal(tandg(-135), 1.0, 14) - assert_almost_equal(tandg(180), 0.0, 14) - assert_almost_equal(tandg(-180), 0.0, 14) - assert_almost_equal(tandg(225), 1.0, 14) - assert_almost_equal(tandg(-225), -1.0, 14) - assert_almost_equal(tandg(315), -1.0, 14) - assert_almost_equal(tandg(-315), 1.0, 14) + assert_almost_equal(special.tandg(0), 0.0, 14) + assert_almost_equal(special.tandg(45), 1.0, 14) + assert_almost_equal(special.tandg(-45), -1.0, 14) + assert_almost_equal(special.tandg(135), -1.0, 14) + assert_almost_equal(special.tandg(-135), 1.0, 14) + assert_almost_equal(special.tandg(180), 0.0, 14) + assert_almost_equal(special.tandg(-180), 0.0, 14) + assert_almost_equal(special.tandg(225), 1.0, 14) + assert_almost_equal(special.tandg(-225), -1.0, 14) + assert_almost_equal(special.tandg(315), -1.0, 14) + assert_almost_equal(special.tandg(-315), 1.0, 14) class TestEllip(TestCase): def test_ellipj_nan(self): """Regression test for #912.""" - ellipj(0.5, np.nan) + special.ellipj(0.5, np.nan) def test_ellipj(self): - el = ellipj(0.2,0) + el = special.ellipj(0.2,0) rel = [sin(0.2),cos(0.2),1.0,0.20] assert_array_almost_equal(el,rel,13) def test_ellipk(self): - elk = ellipk(.2) + elk = special.ellipk(.2) assert_almost_equal(elk,1.659623598610528,11) def test_ellipkinc(self): - elkinc = ellipkinc(pi/2,.2) - elk = ellipk(0.2) + elkinc = special.ellipkinc(pi/2,.2) + elk = special.ellipk(0.2) assert_almost_equal(elkinc,elk,15) alpha = 20*pi/180 phi = 45*pi/180 m = sin(alpha)**2 - elkinc = ellipkinc(phi,m) + elkinc = special.ellipkinc(phi,m) assert_almost_equal(elkinc,0.79398143,8) # From pg. 614 of A & S def test_ellipe(self): - ele = ellipe(.2) + ele = special.ellipe(.2) assert_almost_equal(ele,1.4890350580958529,8) def test_ellipeinc(self): - eleinc = ellipeinc(pi/2,.2) - ele = ellipe(0.2) + eleinc = special.ellipeinc(pi/2,.2) + ele = special.ellipe(0.2) assert_almost_equal(eleinc,ele,14) # pg 617 of A & S alpha, phi = 52*pi/180,35*pi/180 m = sin(alpha)**2 - eleinc = ellipeinc(phi,m) + eleinc = special.ellipeinc(phi,m) assert_almost_equal(eleinc, 0.58823065, 8) class TestErf(TestCase): def test_erf(self): - er = erf(.25) + er = special.erf(.25) assert_almost_equal(er,0.2763263902,8) def test_erf_zeros(self): - erz = erf_zeros(5) + erz = special.erf_zeros(5) erzr= array([1.45061616+1.88094300j, 2.24465928+2.61657514j, 2.83974105+3.17562810j, @@ -870,30 +874,30 @@ assert_array_almost_equal(erz,erzr,4) def test_erfcinv(self): - i = erfcinv(1) + i = special.erfcinv(1) assert_equal(i,0) def test_erfinv(self): - i = erfinv(0) + i = special.erfinv(0) assert_equal(i,0) def test_errprint(self): - a = errprint() + a = special.errprint() b = 1-a #a is the state 1-a inverts state - c = errprint(b) #returns last state 'a' + c = special.errprint(b) #returns last state 'a' assert_equal(a,c) - d = errprint(a) #returns to original state + d = special.errprint(a) #returns to original state assert_equal(d,b) #makes sure state was returned #assert_equal(d,1-a) class TestEuler(TestCase): def test_euler(self): - eu0 = euler(0) - eu1 = euler(1) - eu2 = euler(2) # just checking segfaults + eu0 = special.euler(0) + eu1 = special.euler(1) + eu2 = special.euler(2) # just checking segfaults assert_almost_equal(eu0[0],1,8) assert_almost_equal(eu2[2],-1,8) - eu24 = euler(24) + eu24 = special.euler(24) mathworld = [1,1,5,61,1385,50521,2702765,199360981, 19391512145l,2404879675441l, 370371188237525l,69348874393137901l, @@ -910,44 +914,44 @@ class TestExp(TestCase): def test_exp2(self): - ex = exp2(2) + ex = special.exp2(2) exrl = 2**2 assert_equal(ex,exrl) def test_exp2more(self): - exm = exp2(2.5) + exm = special.exp2(2.5) exmrl = 2**(2.5) assert_almost_equal(exm,exmrl,8) def test_exp10(self): - ex = exp10(2) + ex = special.exp10(2) exrl = 10**2 assert_approx_equal(ex,exrl) def test_exp10more(self): - exm = exp10(2.5) + exm = special.exp10(2.5) exmrl = 10**(2.5) assert_almost_equal(exm,exmrl,8) def test_expm1(self): - ex = (expm1(2),expm1(3),expm1(4)) + ex = (special.expm1(2),special.expm1(3),special.expm1(4)) exrl = (exp(2)-1,exp(3)-1,exp(4)-1) assert_array_almost_equal(ex,exrl,8) def test_expm1more(self): - ex1 = (expm1(2),expm1(2.1),expm1(2.2)) + ex1 = (special.expm1(2),special.expm1(2.1),special.expm1(2.2)) exrl1 = (exp(2)-1,exp(2.1)-1,exp(2.2)-1) assert_array_almost_equal(ex1,exrl1,8) class TestFresnel(TestCase): def test_fresnel(self): - frs = array(fresnel(.5)) + frs = array(special.fresnel(.5)) assert_array_almost_equal(frs,array([0.064732432859999287, 0.49234422587144644]),8) # values from pg 329 Table 7.11 of A & S # slightly corrected in 4th decimal place def test_fresnel_zeros(self): - szo, czo = fresnel_zeros(5) + szo, czo = special.fresnel_zeros(5) assert_array_almost_equal(szo, array([ 2.0093+0.2885j, 2.8335+0.2443j, @@ -960,56 +964,56 @@ 3.3204+0.2240j, 3.8757+0.2047j, 4.3611+0.1907j]),3) - vals1 = fresnel(szo)[0] - vals2 = fresnel(czo)[1] + vals1 = special.fresnel(szo)[0] + vals2 = special.fresnel(czo)[1] assert_array_almost_equal(vals1,0,14) assert_array_almost_equal(vals2,0,14) def test_fresnelc_zeros(self): - szo, czo = fresnel_zeros(6) - frc = fresnelc_zeros(6) + szo, czo = special.fresnel_zeros(6) + frc = special.fresnelc_zeros(6) assert_array_almost_equal(frc,czo,12) def test_fresnels_zeros(self): - szo, czo = fresnel_zeros(5) - frs = fresnels_zeros(5) + szo, czo = special.fresnel_zeros(5) + frs = special.fresnels_zeros(5) assert_array_almost_equal(frs,szo,12) class TestGamma(TestCase): def test_gamma(self): - gam = gamma(5) + gam = special.gamma(5) assert_equal(gam,24.0) def test_gammaln(self): - gamln = gammaln(3) - lngam = log(gamma(3)) + gamln = special.gammaln(3) + lngam = log(special.gamma(3)) assert_almost_equal(gamln,lngam,8) def test_gammainc(self): - gama = gammainc(.5,.5) + gama = special.gammainc(.5,.5) assert_almost_equal(gama,.7,1) def test_gammaincc(self): - gicc = gammaincc(.5,.5) - greal = 1 - gammainc(.5,.5) + gicc = special.gammaincc(.5,.5) + greal = 1 - special.gammainc(.5,.5) assert_almost_equal(gicc,greal,8) def test_gammainccinv(self): - gccinv = gammainccinv(.5,.5) - gcinv = gammaincinv(.5,.5) + gccinv = special.gammainccinv(.5,.5) + gcinv = special.gammaincinv(.5,.5) assert_almost_equal(gccinv,gcinv,8) @with_special_errors def test_gammaincinv(self): - y = gammaincinv(.4,.4) - x = gammainc(.4,y) + y = special.gammaincinv(.4,.4) + x = special.gammainc(.4,y) assert_almost_equal(x,0.4,1) - y = gammainc(10, 0.05) - x = gammaincinv(10, 2.5715803516000736e-20) + y = special.gammainc(10, 0.05) + x = special.gammaincinv(10, 2.5715803516000736e-20) assert_almost_equal(0.05, x, decimal=10) assert_almost_equal(y, 2.5715803516000736e-20, decimal=10) - x = gammaincinv(50, 8.20754777388471303050299243573393e-18) + x = special.gammaincinv(50, 8.20754777388471303050299243573393e-18) assert_almost_equal(11.0, x, decimal=10) @with_special_errors @@ -1021,64 +1025,65 @@ np.nextafter(0.25, 0), 0.25 - 1e-12, np.nextafter(0.25, 1), 0.25 + 1e-12] for xp in pts: - y = gammaincinv(.4, xp) - x = gammainc(0.4, y) + y = special.gammaincinv(.4, xp) + x = special.gammainc(0.4, y) assert_tol_equal(x, xp, rtol=1e-12) def test_rgamma(self): - rgam = rgamma(8) - rlgam = 1/gamma(8) + rgam = special.rgamma(8) + rlgam = 1/special.gamma(8) assert_almost_equal(rgam,rlgam,8) class TestHankel(TestCase): - def test_negv(self): - assert_almost_equal(hankel1(-3,2), -hankel1(3,2), 14) + + def test_negv1(self): + assert_almost_equal(special.hankel1(-3,2), -special.hankel1(3,2), 14) def test_hankel1(self): - hank1 = hankel1(1,.1) - hankrl = (jv(1,.1)+yv(1,.1)*1j) + hank1 = special.hankel1(1,.1) + hankrl = (special.jv(1,.1) + special.yv(1,.1)*1j) assert_almost_equal(hank1,hankrl,8) - def test_negv(self): - assert_almost_equal(hankel1e(-3,2), -hankel1e(3,2), 14) + def test_negv1e(self): + assert_almost_equal(special.hankel1e(-3,2), -special.hankel1e(3,2), 14) def test_hankel1e(self): - hank1e = hankel1e(1,.1) - hankrle = hankel1(1,.1)*exp(-.1j) + hank1e = special.hankel1e(1,.1) + hankrle = special.hankel1(1,.1)*exp(-.1j) assert_almost_equal(hank1e,hankrle,8) - def test_negv(self): - assert_almost_equal(hankel2(-3,2), -hankel2(3,2), 14) + def test_negv2(self): + assert_almost_equal(special.hankel2(-3,2), -special.hankel2(3,2), 14) def test_hankel2(self): - hank2 = hankel2(1,.1) - hankrl2 = (jv(1,.1)-yv(1,.1)*1j) + hank2 = special.hankel2(1,.1) + hankrl2 = (special.jv(1,.1) - special.yv(1,.1)*1j) assert_almost_equal(hank2,hankrl2,8) - def test_negv(self): - assert_almost_equal(hankel2e(-3,2), -hankel2e(3,2), 14) + def test_neg2e(self): + assert_almost_equal(special.hankel2e(-3,2), -special.hankel2e(3,2), 14) def test_hankl2e(self): - hank2e = hankel2e(1,.1) - hankrl2e = hankel2e(1,.1) + hank2e = special.hankel2e(1,.1) + hankrl2e = special.hankel2e(1,.1) assert_almost_equal(hank2e,hankrl2e,8) class TestHyper(TestCase): def test_h1vp(self): - h1 = h1vp(1,.1) - h1real = (jvp(1,.1)+yvp(1,.1)*1j) + h1 = special.h1vp(1,.1) + h1real = (special.jvp(1,.1) + special.yvp(1,.1)*1j) assert_almost_equal(h1,h1real,8) def test_h2vp(self): - h2 = h2vp(1,.1) - h2real = (jvp(1,.1)-yvp(1,.1)*1j) + h2 = special.h2vp(1,.1) + h2real = (special.jvp(1,.1) - special.yvp(1,.1)*1j) assert_almost_equal(h2,h2real,8) def test_hyp0f1(self): pass def test_hyp1f1(self): - hyp1 = hyp1f1(.1,.1,.3) + hyp1 = special.hyp1f1(.1,.1,.3) assert_almost_equal(hyp1, 1.3498588075760032,7) # test contributed by Moritz Deger (2008-05-29) @@ -1188,8 +1193,8 @@ [ -5.30592244e+00, -2.42752190e+01, 1.29734035e+00, 1.31985534e+00]]) for a,b,c,expected in ref_data: - result = hyp1f1(a,b,c) - assert(abs(expected - result)/expected < 1e-4) + result = special.hyp1f1(a,b,c) + assert_(abs(expected - result)/expected < 1e-4) def test_hyp1f2(self): pass @@ -1205,13 +1210,13 @@ [3, 3.5, 1.5, 0.2**2, 0.5/0.2/(-5)*((1+0.2)**(-5)-(1-0.2)**(-5))], [-3, 3, 0.5, sin(0.2)**2, cos(2*3*0.2)], - [3, 4, 8, 1, gamma(8)*gamma(8-4-3)/gamma(8-3)/gamma(8-4)], + [3, 4, 8, 1, special.gamma(8)*special.gamma(8-4-3)/special.gamma(8-3)/special.gamma(8-4)], [3, 2, 3-2+1, -1, 1./2**3*sqrt(pi)* - gamma(1+3-2)/gamma(1+0.5*3-2)/gamma(0.5+0.5*3)], + special.gamma(1+3-2)/special.gamma(1+0.5*3-2)/special.gamma(0.5+0.5*3)], [5, 2, 5-2+1, -1, 1./2**5*sqrt(pi)* - gamma(1+5-2)/gamma(1+0.5*5-2)/gamma(0.5+0.5*5)], - [4, 0.5+4, 1.5-2*4, -1./3, (8./9)**(-2*4)*gamma(4./3)* - gamma(1.5-2*4)/gamma(3./2)/gamma(4./3-2*4)], + special.gamma(1+5-2)/special.gamma(1+0.5*5-2)/special.gamma(0.5+0.5*5)], + [4, 0.5+4, 1.5-2*4, -1./3, (8./9)**(-2*4)*special.gamma(4./3)* + special.gamma(1.5-2*4)/special.gamma(3./2)/special.gamma(4./3-2*4)], # and some others # ticket #424 [1.5, -0.5, 1.0, -10.0, 4.1300097765277476484], @@ -1225,53 +1230,53 @@ (10, -900, -10.5, 0.99, 3.54279200040355710199058559155e-18), ] for i, (a, b, c, x, v) in enumerate(values): - cv = hyp2f1(a, b, c, x) + cv = special.hyp2f1(a, b, c, x) assert_almost_equal(cv, v, 8, err_msg='test #%d' % i) def test_hyp3f0(self): pass def test_hyperu(self): - val1 = hyperu(1,0.1,100) + val1 = special.hyperu(1,0.1,100) assert_almost_equal(val1,0.0098153,7) a,b = [0.3,0.6,1.2,-2.7],[1.5,3.2,-0.4,-3.2] a,b = asarray(a), asarray(b) z = 0.5 - hypu = hyperu(a,b,z) - hprl = (pi/sin(pi*b))*(hyp1f1(a,b,z)/ \ - (gamma(1+a-b)*gamma(b))- \ - z**(1-b)*hyp1f1(1+a-b,2-b,z) \ - /(gamma(a)*gamma(2-b))) + hypu = special.hyperu(a,b,z) + hprl = (pi/sin(pi*b))*(special.hyp1f1(a,b,z)/ \ + (special.gamma(1+a-b)*special.gamma(b))- \ + z**(1-b)*special.hyp1f1(1+a-b,2-b,z) \ + /(special.gamma(a)*special.gamma(2-b))) assert_array_almost_equal(hypu,hprl,12) class TestBessel(TestCase): def test_itj0y0(self): - it0 = array(itj0y0(.2)) + it0 = array(special.itj0y0(.2)) assert_array_almost_equal(it0,array([0.19933433254006822, -0.34570883800412566]),8) def test_it2j0y0(self): - it2 = array(it2j0y0(.2)) + it2 = array(special.it2j0y0(.2)) assert_array_almost_equal(it2,array([0.0049937546274601858, -0.43423067011231614]),8) - def test_negv(self): - assert_equal(iv(3,2), iv(-3,2)) + def test_negv_iv(self): + assert_equal(special.iv(3,2), special.iv(-3,2)) def test_j0(self): - oz = j0(.1) - ozr = jn(0,.1) + oz = special.j0(.1) + ozr = special.jn(0,.1) assert_almost_equal(oz,ozr,8) def test_j1(self): - o1 = j1(.1) - o1r = jn(1,.1) + o1 = special.j1(.1) + o1r = special.jn(1,.1) assert_almost_equal(o1,o1r,8) def test_jn(self): - jnnr = jn(1,.2) + jnnr = special.jn(1,.2) assert_almost_equal(jnnr,0.099500832639235995,8) - def test_negv(self): - assert_almost_equal(jv(-3,2), -jv(3,2), 14) + def test_negv_jv(self): + assert_almost_equal(special.jv(-3,2), -special.jv(3,2), 14) def test_jv(self): values = [[0, 0.1, 0.99750156206604002], @@ -1281,23 +1286,23 @@ [2./3, 4.0, -0.2325440850267039], ] for i, (v, x, y) in enumerate(values): - yc = jv(v, x) + yc = special.jv(v, x) assert_almost_equal(yc, y, 8, err_msg='test #%d' % i) - def test_negv(self): - assert_almost_equal(jve(-3,2), -jve(3,2), 14) + def test_negv_jve(self): + assert_almost_equal(special.jve(-3,2), -special.jve(3,2), 14) def test_jve(self): - jvexp = jve(1,.2) + jvexp = special.jve(1,.2) assert_almost_equal(jvexp,0.099500832639235995,8) - jvexp1 = jve(1,.2+1j) + jvexp1 = special.jve(1,.2+1j) z = .2+1j - jvexpr = jv(1,z)*exp(-abs(z.imag)) + jvexpr = special.jv(1,z)*exp(-abs(z.imag)) assert_almost_equal(jvexp1,jvexpr,8) def test_jn_zeros(self): - jn0 = jn_zeros(0,5) - jn1 = jn_zeros(1,5) + jn0 = special.jn_zeros(0,5) + jn1 = special.jn_zeros(1,5) assert_array_almost_equal(jn0,array([ 2.4048255577, 5.5200781103, 8.6537279129, @@ -1309,14 +1314,14 @@ 13.32369, 16.47063]),4) - jn102 = jn_zeros(102,5) + jn102 = special.jn_zeros(102,5) assert_tol_equal(jn102, array([110.89174935992040343, 117.83464175788308398, 123.70194191713507279, 129.02417238949092824, 134.00114761868422559]), rtol=1e-13) - jn301 = jn_zeros(301,5) + jn301 = special.jn_zeros(301,5) assert_tol_equal(jn301, array([313.59097866698830153, 323.21549776096288280, 331.22338738656748796, @@ -1324,17 +1329,17 @@ 345.03284233056064157]), rtol=1e-13) def test_jn_zeros_slow(self): - jn0 = jn_zeros(0, 300) + jn0 = special.jn_zeros(0, 300) assert_tol_equal(jn0[260-1], 816.02884495068867280, rtol=1e-13) assert_tol_equal(jn0[280-1], 878.86068707124422606, rtol=1e-13) assert_tol_equal(jn0[300-1], 941.69253065317954064, rtol=1e-13) - jn10 = jn_zeros(10, 300) + jn10 = special.jn_zeros(10, 300) assert_tol_equal(jn10[260-1], 831.67668514305631151, rtol=1e-13) assert_tol_equal(jn10[280-1], 894.51275095371316931, rtol=1e-13) assert_tol_equal(jn10[300-1], 957.34826370866539775, rtol=1e-13) - jn3010 = jn_zeros(3010,5) + jn3010 = special.jn_zeros(3010,5) assert_tol_equal(jn3010, array([3036.86590780927, 3057.06598526482, 3073.66360690272, @@ -1349,17 +1354,17 @@ #to the inputs def test_jnp_zeros(self): - jnp = jnp_zeros(1,5) + jnp = special.jnp_zeros(1,5) assert_array_almost_equal(jnp, array([ 1.84118, 5.33144, 8.53632, 11.70600, 14.86359]),4) - jnp = jnp_zeros(443,5) - assert_tol_equal(jvp(443, jnp), 0, atol=1e-15) + jnp = special.jnp_zeros(443,5) + assert_tol_equal(special.jvp(443, jnp), 0, atol=1e-15) def test_jnyn_zeros(self): - jnz = jnyn_zeros(1,5) + jnz = special.jnyn_zeros(1,5) assert_array_almost_equal(jnz,(array([ 3.83171, 7.01559, 10.17347, @@ -1382,37 +1387,37 @@ 16.44006])),5) def test_jvp(self): - jvprim = jvp(2,2) - jv0 = (jv(1,2)-jv(3,2))/2 + jvprim = special.jvp(2,2) + jv0 = (special.jv(1,2)-special.jv(3,2))/2 assert_almost_equal(jvprim,jv0,10) def test_k0(self): - ozk = k0(.1) - ozkr = kv(0,.1) + ozk = special.k0(.1) + ozkr = special.kv(0,.1) assert_almost_equal(ozk,ozkr,8) def test_k0e(self): - ozke = k0e(.1) - ozker = kve(0,.1) + ozke = special.k0e(.1) + ozker = special.kve(0,.1) assert_almost_equal(ozke,ozker,8) def test_k1(self): - o1k = k1(.1) - o1kr = kv(1,.1) + o1k = special.k1(.1) + o1kr = special.kv(1,.1) assert_almost_equal(o1k,o1kr,8) def test_k1e(self): - o1ke = k1e(.1) - o1ker = kve(1,.1) + o1ke = special.k1e(.1) + o1ker = special.kve(1,.1) assert_almost_equal(o1ke,o1ker,8) def test_jacobi(self): a = 5*rand() - 1 b = 5*rand() - 1 - P0 = jacobi(0,a,b) - P1 = jacobi(1,a,b) - P2 = jacobi(2,a,b) - P3 = jacobi(3,a,b) + P0 = special.jacobi(0,a,b) + P1 = special.jacobi(1,a,b) + P2 = special.jacobi(2,a,b) + P3 = special.jacobi(3,a,b) assert_array_almost_equal(P0.c,[1],13) assert_array_almost_equal(P1.c,array([a+b+2,a-b])/2.0,13) @@ -1425,127 +1430,129 @@ assert_array_almost_equal(P3.c,array(p3c)/48.0,13) def test_kn(self): - kn1 = kn(0,.2) + kn1 = special.kn(0,.2) assert_almost_equal(kn1,1.7527038555281462,8) - def test_negv(self): - assert_equal(kv(3.0, 2.2), kv(-3.0, 2.2)) + def test_negv_kv(self): + assert_equal(special.kv(3.0, 2.2), special.kv(-3.0, 2.2)) def test_kv0(self): - kv0 = kv(0,.2) + kv0 = special.kv(0,.2) assert_almost_equal(kv0, 1.7527038555281462, 10) + def test_kv1(self): - kv1 = kv(1,0.2) + kv1 = special.kv(1,0.2) assert_almost_equal(kv1, 4.775972543220472, 10) + def test_kv2(self): - kv2 = kv(2,0.2) + kv2 = special.kv(2,0.2) assert_almost_equal(kv2, 49.51242928773287, 10) - def test_negv(self): - assert_equal(kve(3.0, 2.2), kve(-3.0, 2.2)) + def test_negv_kve(self): + assert_equal(special.kve(3.0, 2.2), special.kve(-3.0, 2.2)) def test_kve(self): - kve1 = kve(0,.2) - kv1 = kv(0,.2)*exp(.2) + kve1 = special.kve(0,.2) + kv1 = special.kv(0,.2)*exp(.2) assert_almost_equal(kve1,kv1,8) z = .2+1j - kve2 = kve(0,z) - kv2 = kv(0,z)*exp(z) + kve2 = special.kve(0,z) + kv2 = special.kv(0,z)*exp(z) assert_almost_equal(kve2,kv2,8) def test_kvp_v0n1(self): z = 2.2 - assert_almost_equal(-kv(1,z), kvp(0,z, n=1), 10) + assert_almost_equal(-special.kv(1,z), special.kvp(0,z, n=1), 10) def test_kvp_n1(self): v = 3. z = 2.2 - xc = -kv(v+1,z) + v/z*kv(v,z) - x = kvp(v,z, n=1) + xc = -special.kv(v+1,z) + v/z*special.kv(v,z) + x = special.kvp(v,z, n=1) assert_almost_equal(xc, x, 10) #this function (kvp) is broken def test_kvp_n2(self): v = 3. z = 2.2 - xc = (z**2+v**2-v)/z**2 * kv(v,z) + kv(v+1,z)/z - x = kvp(v, z, n=2) + xc = (z**2+v**2-v)/z**2 * special.kv(v,z) + special.kv(v+1,z)/z + x = special.kvp(v, z, n=2) assert_almost_equal(xc, x, 10) def test_y0(self): - oz = y0(.1) - ozr = yn(0,.1) + oz = special.y0(.1) + ozr = special.yn(0,.1) assert_almost_equal(oz,ozr,8) def test_y1(self): - o1 = y1(.1) - o1r = yn(1,.1) + o1 = special.y1(.1) + o1r = special.yn(1,.1) assert_almost_equal(o1,o1r,8) def test_y0_zeros(self): - yo,ypo = y0_zeros(2) - zo,zpo = y0_zeros(2,complex=1) + yo,ypo = special.y0_zeros(2) + zo,zpo = special.y0_zeros(2,complex=1) all = r_[yo,zo] allval = r_[ypo,zpo] - assert_array_almost_equal(abs(yv(0.0,all)),0.0,11) - assert_array_almost_equal(abs(yv(1,all)-allval),0.0,11) + assert_array_almost_equal(abs(special.yv(0.0,all)),0.0,11) + assert_array_almost_equal(abs(special.yv(1,all)-allval),0.0,11) def test_y1_zeros(self): - y1 = y1_zeros(1) + y1 = special.y1_zeros(1) assert_array_almost_equal(y1,(array([2.19714]),array([0.52079])),5) def test_y1p_zeros(self): - y1p = y1p_zeros(1,complex=1) + y1p = special.y1p_zeros(1,complex=1) assert_array_almost_equal(y1p,(array([ 0.5768+0.904j]), array([-0.7635+0.5892j])),3) def test_yn_zeros(self): - an = yn_zeros(4,2) + an = special.yn_zeros(4,2) assert_array_almost_equal(an,array([ 5.64515, 9.36162]),5) - an = yn_zeros(443,5) + an = special.yn_zeros(443,5) assert_tol_equal(an, [450.13573091578090314, 463.05692376675001542, 472.80651546418663566, 481.27353184725625838, 488.98055964441374646], rtol=1e-15) def test_ynp_zeros(self): - ao = ynp_zeros(0,2) + ao = special.ynp_zeros(0,2) assert_array_almost_equal(ao,array([ 2.19714133, 5.42968104]),6) - ao = ynp_zeros(43,5) - assert_tol_equal(yvp(43, ao), 0, atol=1e-15) - ao = ynp_zeros(443,5) - assert_tol_equal(yvp(443, ao), 0, atol=1e-9) + ao = special.ynp_zeros(43,5) + assert_tol_equal(special.yvp(43, ao), 0, atol=1e-15) + ao = special.ynp_zeros(443,5) + assert_tol_equal(special.yvp(443, ao), 0, atol=1e-9) @dec.knownfailureif(True, "cephes/yv is not eps accurate for large orders on " "all platforms, and has nan/inf issues") def test_ynp_zeros_large_order(self): - ao = ynp_zeros(443,5) - assert_tol_equal(yvp(443, ao), 0, atol=1e-15) + ao = special.ynp_zeros(443,5) + assert_tol_equal(special.yvp(443, ao), 0, atol=1e-15) def test_yn(self): - yn2n = yn(1,.2) + yn2n = special.yn(1,.2) assert_almost_equal(yn2n,-3.3238249881118471,8) - def test_negv(self): - assert_almost_equal(yv(-3,2), -yv(3,2), 14) + def test_negv_yv(self): + assert_almost_equal(special.yv(-3,2), -special.yv(3,2), 14) def test_yv(self): - yv2 = yv(1,.2) + yv2 = special.yv(1,.2) assert_almost_equal(yv2,-3.3238249881118471,8) - def test_negv(self): - assert_almost_equal(yve(-3,2), -yve(3,2), 14) + def test_negv_yve(self): + assert_almost_equal(special.yve(-3,2), -special.yve(3,2), 14) def test_yve(self): - yve2 = yve(1,.2) + yve2 = special.yve(1,.2) assert_almost_equal(yve2,-3.3238249881118471,8) - yve2r = yv(1,.2+1j)*exp(-1) - yve22 = yve(1,.2+1j) + yve2r = special.yv(1,.2+1j)*exp(-1) + yve22 = special.yve(1,.2+1j) assert_almost_equal(yve22,yve2r,8) def test_yvp(self): - yvpr = (yv(1,.2) - yv(3,.2))/2.0 - yvp1 = yvp(2,.2) + yvpr = (special.yv(1,.2) - special.yv(3,.2))/2.0 + yvp1 = special.yvp(2,.2) assert_array_almost_equal(yvp1,yvpr,10) @@ -1569,9 +1576,9 @@ continue c1, c2, c3 = f1(v, z), f1(v,z+0j), f2(int(v), z) if np.isinf(c1): - assert np.abs(c2) >= 1e300, (v, z) + assert_(np.abs(c2) >= 1e300, (v, z)) elif np.isnan(c1): - assert c2.imag != 0, (v, z) + assert_(c2.imag != 0, (v, z)) else: assert_tol_equal(c1, c2, err_msg=(v, z), rtol=rtol, atol=atol) if v == int(v): @@ -1579,20 +1586,20 @@ rtol=rtol, atol=atol) def test_jv_cephes_vs_amos(self): - self.check_cephes_vs_amos(jv, jn, rtol=1e-10, atol=1e-305) + self.check_cephes_vs_amos(special.jv, special.jn, rtol=1e-10, atol=1e-305) @dec.knownfailureif(True, "cephes/yv is not eps accurate for large orders on " "all platforms, and has nan/inf issues") def test_yv_cephes_vs_amos(self): - self.check_cephes_vs_amos(yv, yn, rtol=1e-11, atol=1e-305) + self.check_cephes_vs_amos(special.yv, special.yn, rtol=1e-11, atol=1e-305) def test_yv_cephes_vs_amos_only_small_orders(self): skipper = lambda v, z: (abs(v) > 50) - self.check_cephes_vs_amos(yv, yn, rtol=1e-11, atol=1e-305, skip=skipper) + self.check_cephes_vs_amos(special.yv, special.yn, rtol=1e-11, atol=1e-305, skip=skipper) def test_iv_cephes_vs_amos(self): - self.check_cephes_vs_amos(iv, iv, rtol=5e-9, atol=1e-305) + self.check_cephes_vs_amos(special.iv, special.iv, rtol=5e-9, atol=1e-305) @dec.slow def test_iv_cephes_vs_amos_mass_test(self): @@ -1604,8 +1611,8 @@ imsk = (np.random.randint(8, size=N) == 0) v[imsk] = v.astype(int) - c1 = iv(v, x) - c2 = iv(v, x+0j) + c1 = special.iv(v, x) + c2 = special.iv(v, x+0j) # deal with differences in the inf cutoffs c1[abs(c1) > 1e300] = np.inf @@ -1618,89 +1625,89 @@ # Most error apparently comes from AMOS and not our implementation; # there are some problems near integer orders there - assert dc[k] < 1e-9, (v[k], x[k], iv(v[k], x[k]), iv(v[k], x[k]+0j)) + assert_(dc[k] < 1e-9, (v[k], x[k], special.iv(v[k], x[k]), special.iv(v[k], x[k]+0j))) def test_kv_cephes_vs_amos(self): #self.check_cephes_vs_amos(kv, kn, rtol=1e-9, atol=1e-305) - self.check_cephes_vs_amos(kv, kv, rtol=1e-9, atol=1e-305) + self.check_cephes_vs_amos(special.kv, special.kv, rtol=1e-9, atol=1e-305) def test_ticket_623(self): - assert_tol_equal(jv(3, 4), 0.43017147387562193) - assert_tol_equal(jv(301, 1300), 0.0183487151115275) - assert_tol_equal(jv(301, 1296.0682), -0.0224174325312048) + assert_tol_equal(special.jv(3, 4), 0.43017147387562193) + assert_tol_equal(special.jv(301, 1300), 0.0183487151115275) + assert_tol_equal(special.jv(301, 1296.0682), -0.0224174325312048) def test_ticket_853(self): """Negative-order Bessels""" # cephes - assert_tol_equal(jv(-1, 1 ), -0.4400505857449335) - assert_tol_equal(jv(-2, 1 ), 0.1149034849319005) - assert_tol_equal(yv(-1, 1 ), 0.7812128213002887) - assert_tol_equal(yv(-2, 1 ), -1.650682606816255) - assert_tol_equal(iv(-1, 1 ), 0.5651591039924851) - assert_tol_equal(iv(-2, 1 ), 0.1357476697670383) - assert_tol_equal(kv(-1, 1 ), 0.6019072301972347) - assert_tol_equal(kv(-2, 1 ), 1.624838898635178) - assert_tol_equal(jv(-0.5, 1 ), 0.43109886801837607952) - assert_tol_equal(yv(-0.5, 1 ), 0.6713967071418031) - assert_tol_equal(iv(-0.5, 1 ), 1.231200214592967) - assert_tol_equal(kv(-0.5, 1 ), 0.4610685044478945) + assert_tol_equal(special.jv(-1, 1 ), -0.4400505857449335) + assert_tol_equal(special.jv(-2, 1 ), 0.1149034849319005) + assert_tol_equal(special.yv(-1, 1 ), 0.7812128213002887) + assert_tol_equal(special.yv(-2, 1 ), -1.650682606816255) + assert_tol_equal(special.iv(-1, 1 ), 0.5651591039924851) + assert_tol_equal(special.iv(-2, 1 ), 0.1357476697670383) + assert_tol_equal(special.kv(-1, 1 ), 0.6019072301972347) + assert_tol_equal(special.kv(-2, 1 ), 1.624838898635178) + assert_tol_equal(special.jv(-0.5, 1 ), 0.43109886801837607952) + assert_tol_equal(special.yv(-0.5, 1 ), 0.6713967071418031) + assert_tol_equal(special.iv(-0.5, 1 ), 1.231200214592967) + assert_tol_equal(special.kv(-0.5, 1 ), 0.4610685044478945) # amos - assert_tol_equal(jv(-1, 1+0j), -0.4400505857449335) - assert_tol_equal(jv(-2, 1+0j), 0.1149034849319005) - assert_tol_equal(yv(-1, 1+0j), 0.7812128213002887) - assert_tol_equal(yv(-2, 1+0j), -1.650682606816255) + assert_tol_equal(special.jv(-1, 1+0j), -0.4400505857449335) + assert_tol_equal(special.jv(-2, 1+0j), 0.1149034849319005) + assert_tol_equal(special.yv(-1, 1+0j), 0.7812128213002887) + assert_tol_equal(special.yv(-2, 1+0j), -1.650682606816255) - assert_tol_equal(iv(-1, 1+0j), 0.5651591039924851) - assert_tol_equal(iv(-2, 1+0j), 0.1357476697670383) - assert_tol_equal(kv(-1, 1+0j), 0.6019072301972347) - assert_tol_equal(kv(-2, 1+0j), 1.624838898635178) + assert_tol_equal(special.iv(-1, 1+0j), 0.5651591039924851) + assert_tol_equal(special.iv(-2, 1+0j), 0.1357476697670383) + assert_tol_equal(special.kv(-1, 1+0j), 0.6019072301972347) + assert_tol_equal(special.kv(-2, 1+0j), 1.624838898635178) - assert_tol_equal(jv(-0.5, 1+0j), 0.43109886801837607952) - assert_tol_equal(jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j) - assert_tol_equal(yv(-0.5, 1+0j), 0.6713967071418031) - assert_tol_equal(yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j) + assert_tol_equal(special.jv(-0.5, 1+0j), 0.43109886801837607952) + assert_tol_equal(special.jv(-0.5, 1+1j), 0.2628946385649065-0.827050182040562j) + assert_tol_equal(special.yv(-0.5, 1+0j), 0.6713967071418031) + assert_tol_equal(special.yv(-0.5, 1+1j), 0.967901282890131+0.0602046062142816j) - assert_tol_equal(iv(-0.5, 1+0j), 1.231200214592967) - assert_tol_equal(iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j) - assert_tol_equal(kv(-0.5, 1+0j), 0.4610685044478945) - assert_tol_equal(kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j) + assert_tol_equal(special.iv(-0.5, 1+0j), 1.231200214592967) + assert_tol_equal(special.iv(-0.5, 1+1j), 0.77070737376928+0.39891821043561j) + assert_tol_equal(special.kv(-0.5, 1+0j), 0.4610685044478945) + assert_tol_equal(special.kv(-0.5, 1+1j), 0.06868578341999-0.38157825981268j) - assert_tol_equal(jve(-0.5,1+0.3j), jv(-0.5, 1+0.3j)*exp(-0.3)) - assert_tol_equal(yve(-0.5,1+0.3j), yv(-0.5, 1+0.3j)*exp(-0.3)) - assert_tol_equal(ive(-0.5,0.3+1j), iv(-0.5, 0.3+1j)*exp(-0.3)) - assert_tol_equal(kve(-0.5,0.3+1j), kv(-0.5, 0.3+1j)*exp(0.3+1j)) + assert_tol_equal(special.jve(-0.5,1+0.3j), special.jv(-0.5, 1+0.3j)*exp(-0.3)) + assert_tol_equal(special.yve(-0.5,1+0.3j), special.yv(-0.5, 1+0.3j)*exp(-0.3)) + assert_tol_equal(special.ive(-0.5,0.3+1j), special.iv(-0.5, 0.3+1j)*exp(-0.3)) + assert_tol_equal(special.kve(-0.5,0.3+1j), special.kv(-0.5, 0.3+1j)*exp(0.3+1j)) - assert_tol_equal(hankel1(-0.5, 1+1j), jv(-0.5, 1+1j) + 1j*yv(-0.5,1+1j)) - assert_tol_equal(hankel2(-0.5, 1+1j), jv(-0.5, 1+1j) - 1j*yv(-0.5,1+1j)) + assert_tol_equal(special.hankel1(-0.5, 1+1j), special.jv(-0.5, 1+1j) + 1j*special.yv(-0.5,1+1j)) + assert_tol_equal(special.hankel2(-0.5, 1+1j), special.jv(-0.5, 1+1j) - 1j*special.yv(-0.5,1+1j)) def test_ticket_854(self): """Real-valued Bessel domains""" - assert isnan(jv(0.5, -1)) - assert isnan(iv(0.5, -1)) - assert isnan(yv(0.5, -1)) - assert isnan(yv(1, -1)) - assert isnan(kv(0.5, -1)) - assert isnan(kv(1, -1)) - assert isnan(jve(0.5, -1)) - assert isnan(ive(0.5, -1)) - assert isnan(yve(0.5, -1)) - assert isnan(yve(1, -1)) - assert isnan(kve(0.5, -1)) - assert isnan(kve(1, -1)) - assert isnan(airye(-1)[0:2]).all(), airye(-1) - assert not isnan(airye(-1)[2:4]).any(), airye(-1) + assert_(isnan(special.jv(0.5, -1))) + assert_(isnan(special.iv(0.5, -1))) + assert_(isnan(special.yv(0.5, -1))) + assert_(isnan(special.yv(1, -1))) + assert_(isnan(special.kv(0.5, -1))) + assert_(isnan(special.kv(1, -1))) + assert_(isnan(special.jve(0.5, -1))) + assert_(isnan(special.ive(0.5, -1))) + assert_(isnan(special.yve(0.5, -1))) + assert_(isnan(special.yve(1, -1))) + assert_(isnan(special.kve(0.5, -1))) + assert_(isnan(special.kve(1, -1))) + assert_(isnan(special.airye(-1)[0:2]).all(), special.airye(-1)) + assert_(not isnan(special.airye(-1)[2:4]).any(), special.airye(-1)) def test_ticket_503(self): """Real-valued Bessel I overflow""" - assert_tol_equal(iv(1, 700), 1.528500390233901e302) - assert_tol_equal(iv(1000, 1120), 1.301564549405821e301) + assert_tol_equal(special.iv(1, 700), 1.528500390233901e302) + assert_tol_equal(special.iv(1000, 1120), 1.301564549405821e301) def test_iv_hyperg_poles(self): - assert_tol_equal(iv(-0.5, 1), 1.231200214592967) + assert_tol_equal(special.iv(-0.5, 1), 1.231200214592967) def iv_series(self, v, z, n=200): k = arange(0, n).astype(float_) - r = (v+2*k)*log(.5*z) - gammaln(k+1) - gammaln(v+k+1) + r = (v+2*k)*log(.5*z) - special.gammaln(k+1) - special.gammaln(v+k+1) r[isnan(r)] = inf r = exp(r) err = abs(r).max() * finfo(float_).eps * n + abs(r[-1])*10 @@ -1709,18 +1716,18 @@ def test_i0_series(self): for z in [1., 10., 200.5]: value, err = self.iv_series(0, z) - assert_tol_equal(i0(z), value, atol=err, err_msg=z) + assert_tol_equal(special.i0(z), value, atol=err, err_msg=z) def test_i1_series(self): for z in [1., 10., 200.5]: value, err = self.iv_series(1, z) - assert_tol_equal(i1(z), value, atol=err, err_msg=z) + assert_tol_equal(special.i1(z), value, atol=err, err_msg=z) def test_iv_series(self): for v in [-20., -10., -1., 0., 1., 12.49, 120.]: for z in [1., 10., 200.5, -1+2j]: value, err = self.iv_series(v, z) - assert_tol_equal(iv(v, z), value, atol=err, err_msg=(v, z)) + assert_tol_equal(special.iv(v, z), value, atol=err, err_msg=(v, z)) def test_i0(self): values = [[0.0, 1.0], @@ -1733,12 +1740,12 @@ [20.0, 0.0897803119], ] for i, (x, v) in enumerate(values): - cv = i0(x) * exp(-x) + cv = special.i0(x) * exp(-x) assert_almost_equal(cv, v, 8, err_msg='test #%d' % i) def test_i0e(self): - oize = i0e(.1) - oizer = ive(0,.1) + oize = special.i0e(.1) + oizer = special.ive(0,.1) assert_almost_equal(oize,oizer,8) def test_i1(self): @@ -1751,51 +1758,51 @@ [20.0, 0.0875062222], ] for i, (x, v) in enumerate(values): - cv = i1(x) * exp(-x) + cv = special.i1(x) * exp(-x) assert_almost_equal(cv, v, 8, err_msg='test #%d' % i) def test_i1e(self): - oi1e = i1e(.1) - oi1er = ive(1,.1) + oi1e = special.i1e(.1) + oi1er = special.ive(1,.1) assert_almost_equal(oi1e,oi1er,8) def test_iti0k0(self): - iti0 = array(iti0k0(5)) + iti0 = array(special.iti0k0(5)) assert_array_almost_equal(iti0,array([31.848667776169801, 1.5673873907283657]),5) def test_it2i0k0(self): - it2k = it2i0k0(.1) + it2k = special.it2i0k0(.1) assert_array_almost_equal(it2k,array([0.0012503906973464409, 3.3309450354686687]),6) def test_iv(self): - iv1 = iv(0,.1)*exp(-.1) + iv1 = special.iv(0,.1)*exp(-.1) assert_almost_equal(iv1,0.90710092578230106,10) - def test_negv(self): - assert_equal(ive(3,2), ive(-3,2)) + def test_negv_ive(self): + assert_equal(special.ive(3,2), special.ive(-3,2)) def test_ive(self): - ive1 = ive(0,.1) - iv1 = iv(0,.1)*exp(-.1) + ive1 = special.ive(0,.1) + iv1 = special.iv(0,.1)*exp(-.1) assert_almost_equal(ive1,iv1,10) def test_ivp0(self): - assert_almost_equal(iv(1,2), ivp(0,2), 10) + assert_almost_equal(special.iv(1,2), special.ivp(0,2), 10) def test_ivp(self): - y=(iv(0,2)+iv(2,2))/2 - x = ivp(1,2) + y=(special.iv(0,2) + special.iv(2,2))/2 + x = special.ivp(1,2) assert_almost_equal(x,y,10) class TestLaguerre(TestCase): def test_laguerre(self): - lag0 = laguerre(0) - lag1 = laguerre(1) - lag2 = laguerre(2) - lag3 = laguerre(3) - lag4 = laguerre(4) - lag5 = laguerre(5) + lag0 = special.laguerre(0) + lag1 = special.laguerre(1) + lag2 = special.laguerre(2) + lag3 = special.laguerre(3) + lag4 = special.laguerre(4) + lag5 = special.laguerre(5) assert_array_almost_equal(lag0.c,[1],13) assert_array_almost_equal(lag1.c,[-1,1],13) assert_array_almost_equal(lag2.c,array([1,-4,2])/2.0,13) @@ -1805,10 +1812,10 @@ def test_genlaguerre(self): k = 5*rand()-0.9 - lag0 = genlaguerre(0,k) - lag1 = genlaguerre(1,k) - lag2 = genlaguerre(2,k) - lag3 = genlaguerre(3,k) + lag0 = special.genlaguerre(0,k) + lag1 = special.genlaguerre(1,k) + lag2 = special.genlaguerre(2,k) + lag3 = special.genlaguerre(3,k) assert_equal(lag0.c,[1]) assert_equal(lag1.c,[-1,k+1]) assert_almost_equal(lag2.c,array([1,-2*(k+2),(k+1.)*(k+2.)])/2.0) @@ -1818,12 +1825,12 @@ # Base polynomials come from Abrahmowitz and Stegan class TestLegendre(TestCase): def test_legendre(self): - leg0 = legendre(0) - leg1 = legendre(1) - leg2 = legendre(2) - leg3 = legendre(3) - leg4 = legendre(4) - leg5 = legendre(5) + leg0 = special.legendre(0) + leg1 = special.legendre(1) + leg2 = special.legendre(2) + leg3 = special.legendre(3) + leg4 = special.legendre(4) + leg5 = special.legendre(5) assert_equal(leg0.c,[1]) assert_equal(leg1.c,[1,0]) assert_equal(leg2.c,array([3,0,-1])/2.0) @@ -1834,25 +1841,25 @@ class TestLambda(TestCase): def test_lmbda(self): - lam = lmbda(1,.1) - lamr = (array([jn(0,.1), 2*jn(1,.1)/.1]), - array([jvp(0,.1), -2*jv(1,.1)/.01 + 2*jvp(1,.1)/.1])) + lam = special.lmbda(1,.1) + lamr = (array([special.jn(0,.1), 2*special.jn(1,.1)/.1]), + array([special.jvp(0,.1), -2*special.jv(1,.1)/.01 + 2*special.jvp(1,.1)/.1])) assert_array_almost_equal(lam,lamr,8) class TestLog1p(TestCase): def test_log1p(self): - l1p = (log1p(10),log1p(11),log1p(12)) - l1prl = (log(11),log(12),log(13)) + l1p = (special.log1p(10), special.log1p(11), special.log1p(12)) + l1prl = (log(11), log(12), log(13)) assert_array_almost_equal(l1p,l1prl,8) def test_log1pmore(self): - l1pm = (log1p(1),log1p(1.1),log1p(1.2)) + l1pm = (special.log1p(1), special.log1p(1.1), special.log1p(1.2)) l1pmrl = (log(2),log(2.1),log(2.2)) assert_array_almost_equal(l1pm,l1pmrl,8) class TestLegendreFunctions(TestCase): def test_lpmn(self): - lp = lpmn(0,2,.5) + lp = special.lpmn(0,2,.5) assert_array_almost_equal(lp,(array([ [ 1.00000 , 0.50000, -0.12500]]), @@ -1861,7 +1868,7 @@ 1.50000]])),4) def test_lpn(self): - lpnf = lpn(2,.5) + lpnf = special.lpn(2,.5) assert_array_almost_equal(lpnf,(array( [ 1.00000 , 0.50000, -0.12500]), @@ -1870,27 +1877,27 @@ 1.50000])),4) def test_lpmv(self): - lp = lpmv(0,2,.5) + lp = special.lpmv(0,2,.5) assert_almost_equal(lp,-0.125,3) def test_lqmn(self): - lqmnf = lqmn(0,2,.5) - lqmnf = lqmn(0,2,.5) - lqf = lqn(2,.5) + lqmnf = special.lqmn(0,2,.5) + lqmnf = special.lqmn(0,2,.5) + lqf = special.lqn(2,.5) assert_array_almost_equal(lqmnf[0][0],lqf[0],4) assert_array_almost_equal(lqmnf[1][0],lqf[1],4) def test_lqmn_shape(self): - a, b = lqmn(4, 4, 1.1) + a, b = special.lqmn(4, 4, 1.1) assert_equal(a.shape, (5, 5)) assert_equal(b.shape, (5, 5)) - a, b = lqmn(4, 0, 1.1) + a, b = special.lqmn(4, 0, 1.1) assert_equal(a.shape, (5, 1)) assert_equal(b.shape, (5, 1)) def test_lqn(self): - lqf = lqn(2,.5) + lqf = special.lqn(2,.5) assert_array_almost_equal(lqf,(array([ 0.5493, -0.7253, -0.8187]), array([ 1.3333, 1.216 , -0.8427])),4) @@ -1900,7 +1907,7 @@ pass def test_mathieu_even_coef(self): - mc = mathieu_even_coef(2,5) + mc = special.mathieu_even_coef(2,5) #Q not defined broken and cannot figure out proper reporting order def test_mathieu_odd_coef(self): @@ -1917,7 +1924,7 @@ class TestOblCvSeq(TestCase): def test_obl_cv_seq(self): - obl = obl_cv_seq(0,3,1) + obl = special.obl_cv_seq(0,3,1) assert_array_almost_equal(obl,array([ -0.348602, 1.393206, 5.486800, @@ -1925,61 +1932,61 @@ class TestParabolicCylinder(TestCase): def test_pbdn_seq(self): - pb = pbdn_seq(1,.1) + pb = special.pbdn_seq(1,.1) assert_array_almost_equal(pb,(array([ 0.9975, 0.0998]), array([-0.0499, 0.9925])),4) def test_pbdv(self): - pbv = pbdv(1,.2) - derrl = 1/2*(.2)*pbdv(1,.2)[0] - pbdv(0,.2)[0] + pbv = special.pbdv(1,.2) + derrl = 1/2*(.2)*special.pbdv(1,.2)[0] - special.pbdv(0,.2)[0] def test_pbdv_seq(self): - pbn = pbdn_seq(1,.1) - pbv = pbdv_seq(1,.1) + pbn = special.pbdn_seq(1,.1) + pbv = special.pbdv_seq(1,.1) assert_array_almost_equal(pbv,(real(pbn[0]),real(pbn[1])),4) def test_pbdv_points(self): # simple case eta = np.linspace(-10, 10, 5) - z = 2**(eta/2)*np.sqrt(np.pi)/gamma(.5-.5*eta) - assert_tol_equal(pbdv(eta, 0.)[0], z, rtol=1e-14, atol=1e-14) + z = 2**(eta/2)*np.sqrt(np.pi)/special.gamma(.5-.5*eta) + assert_tol_equal(special.pbdv(eta, 0.)[0], z, rtol=1e-14, atol=1e-14) # some points - assert_tol_equal(pbdv(10.34, 20.44)[0], 1.3731383034455e-32, rtol=1e-12) - assert_tol_equal(pbdv(-9.53, 3.44)[0], 3.166735001119246e-8, rtol=1e-12) + assert_tol_equal(special.pbdv(10.34, 20.44)[0], 1.3731383034455e-32, rtol=1e-12) + assert_tol_equal(special.pbdv(-9.53, 3.44)[0], 3.166735001119246e-8, rtol=1e-12) def test_pbdv_gradient(self): x = np.linspace(-4, 4, 8)[:,None] eta = np.linspace(-10, 10, 5)[None,:] - p = pbdv(eta, x) + p = special.pbdv(eta, x) eps = 1e-7 + 1e-7*abs(x) - dp = (pbdv(eta, x + eps)[0] - pbdv(eta, x - eps)[0]) / eps / 2. + dp = (special.pbdv(eta, x + eps)[0] - special.pbdv(eta, x - eps)[0]) / eps / 2. assert_tol_equal(p[1], dp, rtol=1e-6, atol=1e-6) def test_pbvv_gradient(self): x = np.linspace(-4, 4, 8)[:,None] eta = np.linspace(-10, 10, 5)[None,:] - p = pbvv(eta, x) + p = special.pbvv(eta, x) eps = 1e-7 + 1e-7*abs(x) - dp = (pbvv(eta, x + eps)[0] - pbvv(eta, x - eps)[0]) / eps / 2. + dp = (special.pbvv(eta, x + eps)[0] - special.pbvv(eta, x - eps)[0]) / eps / 2. assert_tol_equal(p[1], dp, rtol=1e-6, atol=1e-6) class TestPolygamma(TestCase): # from Table 6.2 (pg. 271) of A&S def test_polygamma(self): - poly2 = polygamma(2,1) - poly3 = polygamma(3,1) + poly2 = special.polygamma(2,1) + poly3 = special.polygamma(3,1) assert_almost_equal(poly2,-2.4041138063,10) assert_almost_equal(poly3,6.4939394023,10) class TestProCvSeq(TestCase): def test_pro_cv_seq(self): - prol = pro_cv_seq(0,3,1) + prol = special.pro_cv_seq(0,3,1) assert_array_almost_equal(prol,array([ 0.319000, 2.593084, 6.533471, @@ -1987,32 +1994,32 @@ class TestPsi(TestCase): def test_psi(self): - ps = psi(1) + ps = special.psi(1) assert_almost_equal(ps,-0.57721566490153287,8) class TestRadian(TestCase): def test_radian(self): - rad = radian(90,0,0) + rad = special.radian(90,0,0) assert_almost_equal(rad,pi/2.0,5) def test_radianmore(self): - rad1 = radian(90,1,60) + rad1 = special.radian(90,1,60) assert_almost_equal(rad1,pi/2+0.0005816135199345904,5) class TestRiccati(TestCase): def test_riccati_jn(self): - jnrl = (sph_jn(1,.2)[0]*.2,sph_jn(1,.2)[0]+sph_jn(1,.2)[1]*.2) - ricjn = riccati_jn(1,.2) + jnrl = (special.sph_jn(1,.2)[0]*.2,special.sph_jn(1,.2)[0]+special.sph_jn(1,.2)[1]*.2) + ricjn = special.riccati_jn(1,.2) assert_array_almost_equal(ricjn,jnrl,8) def test_riccati_yn(self): - ynrl = (sph_yn(1,.2)[0]*.2,sph_yn(1,.2)[0]+sph_yn(1,.2)[1]*.2) - ricyn = riccati_yn(1,.2) + ynrl = (special.sph_yn(1,.2)[0]*.2,special.sph_yn(1,.2)[0]+special.sph_yn(1,.2)[1]*.2) + ricyn = special.riccati_yn(1,.2) assert_array_almost_equal(ricyn,ynrl,8) class TestRound(TestCase): def test_round(self): - rnd = map(int,(round(10.1),round(10.4),round(10.5),round(10.6))) + rnd = map(int,(special.round(10.1),special.round(10.4),special.round(10.5),special.round(10.6))) # Note: According to the documentation, scipy.special.round is # supposed to round to the nearest even number if the fractional @@ -2026,7 +2033,7 @@ def test_sph_harm(): # Tests derived from tables in # http://en.wikipedia.org/wiki/Table_of_spherical_harmonics - sh = sph_harm + sh = special.sph_harm pi = np.pi exp = np.exp sqrt = np.sqrt @@ -2058,7 +2065,7 @@ pass def test_sph_in(self): - i1n = sph_in(1,.2) + i1n = special.sph_in(1,.2) inp0 = (i1n[0][1]) inp1 = (i1n[0][0] - 2.0/0.2 * i1n[0][1]) assert_array_almost_equal(i1n[0],array([1.0066800127054699381, @@ -2066,12 +2073,12 @@ assert_array_almost_equal(i1n[1],[inp0,inp1],12) def test_sph_inkn(self): - spikn = r_[sph_in(1,.2)+sph_kn(1,.2)] - inkn = r_[sph_inkn(1,.2)] + spikn = r_[special.sph_in(1,.2) + special.sph_kn(1,.2)] + inkn = r_[special.sph_inkn(1,.2)] assert_array_almost_equal(inkn,spikn,10) def test_sph_jn(self): - s1 = sph_jn(2,.2) + s1 = special.sph_jn(2,.2) s10 = -s1[0][1] s11 = s1[0][0]-2.0/0.2*s1[0][1] s12 = s1[0][1]-3.0/0.2*s1[0][2] @@ -2081,12 +2088,12 @@ assert_array_almost_equal(s1[1],[s10,s11,s12],12) def test_sph_jnyn(self): - jnyn = r_[sph_jn(1,.2) + sph_yn(1,.2)] # tuple addition - jnyn1 = r_[sph_jnyn(1,.2)] + jnyn = r_[special.sph_jn(1,.2) + special.sph_yn(1,.2)] # tuple addition + jnyn1 = r_[special.sph_jnyn(1,.2)] assert_array_almost_equal(jnyn1,jnyn,9) def test_sph_kn(self): - kn = sph_kn(2,.2) + kn = special.sph_kn(2,.2) kn0 = -kn[0][1] kn1 = -kn[0][0]-2.0/0.2*kn[0][1] kn2 = -kn[0][1]-3.0/0.2*kn[0][2] @@ -2096,19 +2103,19 @@ assert_array_almost_equal(kn[1],[kn0,kn1,kn2],9) def test_sph_yn(self): - sy1 = sph_yn(2,.2)[0][2] - sy2 = sph_yn(0,.2)[0][0] - sphpy = (sph_yn(1,.2)[0][0]-2*sph_yn(2,.2)[0][2])/3 #correct derivative value + sy1 = special.sph_yn(2,.2)[0][2] + sy2 = special.sph_yn(0,.2)[0][0] + sphpy = (special.sph_yn(1,.2)[0][0]-2*special.sph_yn(2,.2)[0][2])/3 #correct derivative value assert_almost_equal(sy1,-377.52483,5)#previous values in the system assert_almost_equal(sy2,-4.9003329,5) - sy3 = sph_yn(1,.2)[1][1] + sy3 = special.sph_yn(1,.2)[1][1] assert_almost_equal(sy3,sphpy,4) #compare correct derivative val. (correct =-system val). class TestStruve(object): def _series(self, v, z, n=100): """Compute Struve function & error estimate from its power series.""" k = arange(0, n) - r = (-1)**k * (.5*z)**(2*k+v+1)/gamma(k+1.5)/gamma(k+v+1.5) + r = (-1)**k * (.5*z)**(2*k+v+1)/special.gamma(k+1.5)/special.gamma(k+v+1.5) err = abs(r).max() * finfo(float_).eps * n return r.sum(), err @@ -2117,35 +2124,35 @@ for v in [-20, -10, -7.99, -3.4, -1, 0, 1, 3.4, 12.49, 16]: for z in [1, 10, 19, 21, 30]: value, err = self._series(v, z) - assert_tol_equal(struve(v, z), value, rtol=0, atol=err), (v, z) + assert_tol_equal(special.struve(v, z), value, rtol=0, atol=err), (v, z) def test_some_values(self): - assert_tol_equal(struve(-7.99, 21), 0.0467547614113, rtol=1e-7) - assert_tol_equal(struve(-8.01, 21), 0.0398716951023, rtol=1e-8) - assert_tol_equal(struve(-3.0, 200), 0.0142134427432, rtol=1e-12) - assert_tol_equal(struve(-8.0, -41), 0.0192469727846, rtol=1e-11) - assert_equal(struve(-12, -41), -struve(-12, 41)) - assert_equal(struve(+12, -41), -struve(+12, 41)) - assert_equal(struve(-11, -41), +struve(-11, 41)) - assert_equal(struve(+11, -41), +struve(+11, 41)) + assert_tol_equal(special.struve(-7.99, 21), 0.0467547614113, rtol=1e-7) + assert_tol_equal(special.struve(-8.01, 21), 0.0398716951023, rtol=1e-8) + assert_tol_equal(special.struve(-3.0, 200), 0.0142134427432, rtol=1e-12) + assert_tol_equal(special.struve(-8.0, -41), 0.0192469727846, rtol=1e-11) + assert_equal(special.struve(-12, -41), -special.struve(-12, 41)) + assert_equal(special.struve(+12, -41), -special.struve(+12, 41)) + assert_equal(special.struve(-11, -41), +special.struve(-11, 41)) + assert_equal(special.struve(+11, -41), +special.struve(+11, 41)) - assert isnan(struve(-7.1, -1)) - assert isnan(struve(-10.1, -1)) + assert_(isnan(special.struve(-7.1, -1))) + assert_(isnan(special.struve(-10.1, -1))) def test_regression_679(self): """Regression test for #679""" - assert_tol_equal(struve(-1.0, 20 - 1e-8), struve(-1.0, 20 + 1e-8)) - assert_tol_equal(struve(-2.0, 20 - 1e-8), struve(-2.0, 20 + 1e-8)) - assert_tol_equal(struve(-4.3, 20 - 1e-8), struve(-4.3, 20 + 1e-8)) + assert_tol_equal(special.struve(-1.0, 20 - 1e-8), special.struve(-1.0, 20 + 1e-8)) + assert_tol_equal(special.struve(-2.0, 20 - 1e-8), special.struve(-2.0, 20 + 1e-8)) + assert_tol_equal(special.struve(-4.3, 20 - 1e-8), special.struve(-4.3, 20 + 1e-8)) def test_chi2_smalldf(): - assert_almost_equal(chdtr(0.6,3), 0.957890536704110) + assert_almost_equal(special.chdtr(0.6,3), 0.957890536704110) def test_chi2c_smalldf(): - assert_almost_equal(chdtrc(0.6,3), 1-0.957890536704110) + assert_almost_equal(special.chdtrc(0.6,3), 1-0.957890536704110) def test_chi2_inv_smalldf(): - assert_almost_equal(chdtri(0.6,1-0.957890536704110), 3) + assert_almost_equal(special.chdtri(0.6,1-0.957890536704110), 3) if __name__ == "__main__": Modified: trunk/scipy/special/tests/test_data.py =================================================================== --- trunk/scipy/special/tests/test_data.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_data.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -1,7 +1,6 @@ import os import numpy as np -from numpy.testing import * from scipy.special import ( arccosh, arcsinh, arctanh, erf, erfc, log1p, expm1, jn, jv, yn, yv, iv, kv, kn, gamma, gammaln, digamma, beta, cbrt, @@ -9,7 +8,7 @@ zeta, gammaincinv, ) -from testutils import * +from testutils import FuncData DATASETS = np.load(os.path.join(os.path.dirname(__file__), "data", "boost.npz")) Modified: trunk/scipy/special/tests/test_lambertw.py =================================================================== --- trunk/scipy/special/tests/test_lambertw.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_lambertw.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -6,14 +6,15 @@ # [1] mpmath source code, Subversion revision 992 # http://code.google.com/p/mpmath/source/browse/trunk/mpmath/tests/test_functions2.py?spec=svn994&r=992 -from numpy.testing import * +from numpy.testing import assert_, assert_equal, assert_array_almost_equal from scipy.special import lambertw from numpy import nan, inf, pi, e, isnan, log, r_, array, complex_ -from testutils import * +from testutils import FuncData + def test_values(): - assert isnan(lambertw(nan)) + assert_(isnan(lambertw(nan))) assert_equal(lambertw(inf,1).real, inf) assert_equal(lambertw(inf,1).imag, 2*pi) assert_equal(lambertw(-inf,1).real, inf) Modified: trunk/scipy/special/tests/test_mpmath.py =================================================================== --- trunk/scipy/special/tests/test_mpmath.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_mpmath.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -4,10 +4,10 @@ """ import re import numpy as np -from numpy.testing import * +from numpy.testing import dec import scipy.special as sc -from testutils import * +from testutils import FuncData, assert_func_equal try: import mpmath Modified: trunk/scipy/special/tests/test_orthogonal.py =================================================================== --- trunk/scipy/special/tests/test_orthogonal.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_orthogonal.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -1,20 +1,19 @@ -from numpy.testing import * +from numpy.testing import assert_array_almost_equal, assert_almost_equal, \ + rand, TestCase import numpy as np from numpy import array, sqrt -from scipy.special.orthogonal import * +import scipy.special.orthogonal as orth from scipy.special import gamma -from testutils import * - class TestCheby(TestCase): def test_chebyc(self): - C0 = chebyc(0) - C1 = chebyc(1) - C2 = chebyc(2) - C3 = chebyc(3) - C4 = chebyc(4) - C5 = chebyc(5) + C0 = orth.chebyc(0) + C1 = orth.chebyc(1) + C2 = orth.chebyc(2) + C3 = orth.chebyc(3) + C4 = orth.chebyc(4) + C5 = orth.chebyc(5) assert_array_almost_equal(C0.c,[2],13) assert_array_almost_equal(C1.c,[1,0],13) @@ -24,12 +23,12 @@ assert_array_almost_equal(C5.c,[1,0,-5,0,5,0],13) def test_chebys(self): - S0 = chebys(0) - S1 = chebys(1) - S2 = chebys(2) - S3 = chebys(3) - S4 = chebys(4) - S5 = chebys(5) + S0 = orth.chebys(0) + S1 = orth.chebys(1) + S2 = orth.chebys(2) + S3 = orth.chebys(3) + S4 = orth.chebys(4) + S5 = orth.chebys(5) assert_array_almost_equal(S0.c,[1],13) assert_array_almost_equal(S1.c,[1,0],13) assert_array_almost_equal(S2.c,[1,0,-1],13) @@ -38,12 +37,12 @@ assert_array_almost_equal(S5.c,[1,0,-4,0,3,0],13) def test_chebyt(self): - T0 = chebyt(0) - T1 = chebyt(1) - T2 = chebyt(2) - T3 = chebyt(3) - T4 = chebyt(4) - T5 = chebyt(5) + T0 = orth.chebyt(0) + T1 = orth.chebyt(1) + T2 = orth.chebyt(2) + T3 = orth.chebyt(3) + T4 = orth.chebyt(4) + T5 = orth.chebyt(5) assert_array_almost_equal(T0.c,[1],13) assert_array_almost_equal(T1.c,[1,0],13) assert_array_almost_equal(T2.c,[2,0,-1],13) @@ -52,12 +51,12 @@ assert_array_almost_equal(T5.c,[16,0,-20,0,5,0],13) def test_chebyu(self): - U0 = chebyu(0) - U1 = chebyu(1) - U2 = chebyu(2) - U3 = chebyu(3) - U4 = chebyu(4) - U5 = chebyu(5) + U0 = orth.chebyu(0) + U1 = orth.chebyu(1) + U2 = orth.chebyu(2) + U3 = orth.chebyu(3) + U4 = orth.chebyu(4) + U5 = orth.chebyu(5) assert_array_almost_equal(U0.c,[1],13) assert_array_almost_equal(U1.c,[2,0],13) assert_array_almost_equal(U2.c,[4,0,-1],13) @@ -70,31 +69,31 @@ def test_gegenbauer(self): a = 5*rand()-0.5 if np.any(a==0): a = -0.2 - Ca0 = gegenbauer(0,a) - Ca1 = gegenbauer(1,a) - Ca2 = gegenbauer(2,a) - Ca3 = gegenbauer(3,a) - Ca4 = gegenbauer(4,a) - Ca5 = gegenbauer(5,a) + Ca0 = orth.gegenbauer(0,a) + Ca1 = orth.gegenbauer(1,a) + Ca2 = orth.gegenbauer(2,a) + Ca3 = orth.gegenbauer(3,a) + Ca4 = orth.gegenbauer(4,a) + Ca5 = orth.gegenbauer(5,a) assert_array_almost_equal(Ca0.c,array([1]),13) assert_array_almost_equal(Ca1.c,array([2*a,0]),13) assert_array_almost_equal(Ca2.c,array([2*a*(a+1),0,-a]),13) - assert_array_almost_equal(Ca3.c,array([4*poch(a,3),0,-6*a*(a+1), + assert_array_almost_equal(Ca3.c,array([4*orth.poch(a,3),0,-6*a*(a+1), 0])/3.0,11) - assert_array_almost_equal(Ca4.c,array([4*poch(a,4),0,-12*poch(a,3), + assert_array_almost_equal(Ca4.c,array([4*orth.poch(a,4),0,-12*orth.poch(a,3), 0,3*a*(a+1)])/6.0,11) - assert_array_almost_equal(Ca5.c,array([4*poch(a,5),0,-20*poch(a,4), - 0,15*poch(a,3),0])/15.0,11) + assert_array_almost_equal(Ca5.c,array([4*orth.poch(a,5),0,-20*orth.poch(a,4), + 0,15*orth.poch(a,3),0])/15.0,11) class TestHermite(TestCase): def test_hermite(self): - H0 = hermite(0) - H1 = hermite(1) - H2 = hermite(2) - H3 = hermite(3) - H4 = hermite(4) - H5 = hermite(5) + H0 = orth.hermite(0) + H1 = orth.hermite(1) + H2 = orth.hermite(2) + H3 = orth.hermite(3) + H4 = orth.hermite(4) + H5 = orth.hermite(5) assert_array_almost_equal(H0.c,[1],13) assert_array_almost_equal(H1.c,[2,0],13) assert_array_almost_equal(H2.c,[4,0,-2],13) @@ -105,18 +104,18 @@ def test_hermitenorm(self): # He_n(x) = 2**(-n/2) H_n(x/sqrt(2)) psub = np.poly1d([1.0/sqrt(2),0]) - H0 = hermitenorm(0) - H1 = hermitenorm(1) - H2 = hermitenorm(2) - H3 = hermitenorm(3) - H4 = hermitenorm(4) - H5 = hermitenorm(5) - he0 = hermite(0)(psub) - he1 = hermite(1)(psub) / sqrt(2) - he2 = hermite(2)(psub) / 2.0 - he3 = hermite(3)(psub) / (2*sqrt(2)) - he4 = hermite(4)(psub) / 4.0 - he5 = hermite(5)(psub) / (4.0*sqrt(2)) + H0 = orth.hermitenorm(0) + H1 = orth.hermitenorm(1) + H2 = orth.hermitenorm(2) + H3 = orth.hermitenorm(3) + H4 = orth.hermitenorm(4) + H5 = orth.hermitenorm(5) + he0 = orth.hermite(0)(psub) + he1 = orth.hermite(1)(psub) / sqrt(2) + he2 = orth.hermite(2)(psub) / 2.0 + he3 = orth.hermite(3)(psub) / (2*sqrt(2)) + he4 = orth.hermite(4)(psub) / 4.0 + he5 = orth.hermite(5)(psub) / (4.0*sqrt(2)) assert_array_almost_equal(H0.c,he0.c,13) assert_array_almost_equal(H1.c,he1.c,13) @@ -130,18 +129,18 @@ def test_sh_legendre(self): # P*_n(x) = P_n(2x-1) psub = np.poly1d([2,-1]) - Ps0 = sh_legendre(0) - Ps1 = sh_legendre(1) - Ps2 = sh_legendre(2) - Ps3 = sh_legendre(3) - Ps4 = sh_legendre(4) - Ps5 = sh_legendre(5) - pse0 = legendre(0)(psub) - pse1 = legendre(1)(psub) - pse2 = legendre(2)(psub) - pse3 = legendre(3)(psub) - pse4 = legendre(4)(psub) - pse5 = legendre(5)(psub) + Ps0 = orth.sh_legendre(0) + Ps1 = orth.sh_legendre(1) + Ps2 = orth.sh_legendre(2) + Ps3 = orth.sh_legendre(3) + Ps4 = orth.sh_legendre(4) + Ps5 = orth.sh_legendre(5) + pse0 = orth.legendre(0)(psub) + pse1 = orth.legendre(1)(psub) + pse2 = orth.legendre(2)(psub) + pse3 = orth.legendre(3)(psub) + pse4 = orth.legendre(4)(psub) + pse5 = orth.legendre(5)(psub) assert_array_almost_equal(Ps0.c,pse0.c,13) assert_array_almost_equal(Ps1.c,pse1.c,13) assert_array_almost_equal(Ps2.c,pse2.c,13) @@ -154,18 +153,18 @@ def test_sh_chebyt(self): # T*_n(x) = T_n(2x-1) psub = np.poly1d([2,-1]) - Ts0 = sh_chebyt(0) - Ts1 = sh_chebyt(1) - Ts2 = sh_chebyt(2) - Ts3 = sh_chebyt(3) - Ts4 = sh_chebyt(4) - Ts5 = sh_chebyt(5) - tse0 = chebyt(0)(psub) - tse1 = chebyt(1)(psub) - tse2 = chebyt(2)(psub) - tse3 = chebyt(3)(psub) - tse4 = chebyt(4)(psub) - tse5 = chebyt(5)(psub) + Ts0 = orth.sh_chebyt(0) + Ts1 = orth.sh_chebyt(1) + Ts2 = orth.sh_chebyt(2) + Ts3 = orth.sh_chebyt(3) + Ts4 = orth.sh_chebyt(4) + Ts5 = orth.sh_chebyt(5) + tse0 = orth.chebyt(0)(psub) + tse1 = orth.chebyt(1)(psub) + tse2 = orth.chebyt(2)(psub) + tse3 = orth.chebyt(3)(psub) + tse4 = orth.chebyt(4)(psub) + tse5 = orth.chebyt(5)(psub) assert_array_almost_equal(Ts0.c,tse0.c,13) assert_array_almost_equal(Ts1.c,tse1.c,13) assert_array_almost_equal(Ts2.c,tse2.c,13) @@ -178,18 +177,18 @@ def test_sh_chebyu(self): # U*_n(x) = U_n(2x-1) psub = np.poly1d([2,-1]) - Us0 = sh_chebyu(0) - Us1 = sh_chebyu(1) - Us2 = sh_chebyu(2) - Us3 = sh_chebyu(3) - Us4 = sh_chebyu(4) - Us5 = sh_chebyu(5) - use0 = chebyu(0)(psub) - use1 = chebyu(1)(psub) - use2 = chebyu(2)(psub) - use3 = chebyu(3)(psub) - use4 = chebyu(4)(psub) - use5 = chebyu(5)(psub) + Us0 = orth.sh_chebyu(0) + Us1 = orth.sh_chebyu(1) + Us2 = orth.sh_chebyu(2) + Us3 = orth.sh_chebyu(3) + Us4 = orth.sh_chebyu(4) + Us5 = orth.sh_chebyu(5) + use0 = orth.chebyu(0)(psub) + use1 = orth.chebyu(1)(psub) + use2 = orth.chebyu(2)(psub) + use3 = orth.chebyu(3)(psub) + use4 = orth.chebyu(4)(psub) + use5 = orth.chebyu(5)(psub) assert_array_almost_equal(Us0.c,use0.c,13) assert_array_almost_equal(Us1.c,use1.c,13) assert_array_almost_equal(Us2.c,use2.c,13) @@ -205,18 +204,18 @@ q = 4*rand() p = q-1 + 2*rand() #print "shifted jacobi p,q = ", p, q - G0 = sh_jacobi(0,p,q) - G1 = sh_jacobi(1,p,q) - G2 = sh_jacobi(2,p,q) - G3 = sh_jacobi(3,p,q) - G4 = sh_jacobi(4,p,q) - G5 = sh_jacobi(5,p,q) - ge0 = jacobi(0,p-q,q-1)(psub) * conv(0,p) - ge1 = jacobi(1,p-q,q-1)(psub) * conv(1,p) - ge2 = jacobi(2,p-q,q-1)(psub) * conv(2,p) - ge3 = jacobi(3,p-q,q-1)(psub) * conv(3,p) - ge4 = jacobi(4,p-q,q-1)(psub) * conv(4,p) - ge5 = jacobi(5,p-q,q-1)(psub) * conv(5,p) + G0 = orth.sh_jacobi(0,p,q) + G1 = orth.sh_jacobi(1,p,q) + G2 = orth.sh_jacobi(2,p,q) + G3 = orth.sh_jacobi(3,p,q) + G4 = orth.sh_jacobi(4,p,q) + G5 = orth.sh_jacobi(5,p,q) + ge0 = orth.jacobi(0,p-q,q-1)(psub) * conv(0,p) + ge1 = orth.jacobi(1,p-q,q-1)(psub) * conv(1,p) + ge2 = orth.jacobi(2,p-q,q-1)(psub) * conv(2,p) + ge3 = orth.jacobi(3,p-q,q-1)(psub) * conv(3,p) + ge4 = orth.jacobi(4,p-q,q-1)(psub) * conv(4,p) + ge5 = orth.jacobi(5,p-q,q-1)(psub) * conv(5,p) assert_array_almost_equal(G0.c,ge0.c,13) assert_array_almost_equal(G1.c,ge1.c,13) @@ -231,21 +230,21 @@ for n in xrange(5): poly.extend([x.strip() for x in (""" - jacobi(%(n)d,0.3,0.9) - sh_jacobi(%(n)d,0.3,0.9) - genlaguerre(%(n)d,0.3) - laguerre(%(n)d) - hermite(%(n)d) - hermitenorm(%(n)d) - gegenbauer(%(n)d,0.3) - chebyt(%(n)d) - chebyu(%(n)d) - chebyc(%(n)d) - chebys(%(n)d) - sh_chebyt(%(n)d) - sh_chebyu(%(n)d) - legendre(%(n)d) - sh_legendre(%(n)d) + orth.jacobi(%(n)d,0.3,0.9) + orth.sh_jacobi(%(n)d,0.3,0.9) + orth.genlaguerre(%(n)d,0.3) + orth.laguerre(%(n)d) + orth.hermite(%(n)d) + orth.hermitenorm(%(n)d) + orth.gegenbauer(%(n)d,0.3) + orth.chebyt(%(n)d) + orth.chebyu(%(n)d) + orth.chebyc(%(n)d) + orth.chebys(%(n)d) + orth.sh_chebyt(%(n)d) + orth.sh_chebyu(%(n)d) + orth.legendre(%(n)d) + orth.sh_legendre(%(n)d) """ % dict(n=n)).split() ]) for pstr in poly: Modified: trunk/scipy/special/tests/test_orthogonal_eval.py =================================================================== --- trunk/scipy/special/tests/test_orthogonal_eval.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_orthogonal_eval.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -1,18 +1,20 @@ -from numpy.testing import * +#from numpy.testing import + import numpy as np -from numpy import array, sqrt -from scipy.special.orthogonal import * -from scipy.special import gamma +from numpy.testing import assert_ +import scipy.special.orthogonal as orth -from testutils import * +from testutils import FuncData + def test_eval_chebyt(): n = np.arange(0, 10000, 7) x = 2*np.random.rand() - 1 v1 = np.cos(n*np.arccos(x)) - v2 = eval_chebyt(n, x) - assert np.allclose(v1, v2, rtol=1e-15) + v2 = orth.eval_chebyt(n, x) + assert_(np.allclose(v1, v2, rtol=1e-15)) + class TestPolys(object): """ Check that the eval_* functions agree with the constructed polynomials @@ -50,64 +52,64 @@ ds.check() def test_jacobi(self): - self.check_poly(eval_jacobi, jacobi, + self.check_poly(orth.eval_jacobi, orth.jacobi, param_ranges=[(-0.99, 10), (-0.99, 10)], x_range=[-1, 1], rtol=1e-5) def test_sh_jacobi(self): - self.check_poly(eval_sh_jacobi, sh_jacobi, + self.check_poly(orth.eval_sh_jacobi, orth.sh_jacobi, param_ranges=[(1, 10), (0, 1)], x_range=[0, 1], rtol=1e-5) def test_gegenbauer(self): - self.check_poly(eval_gegenbauer, gegenbauer, + self.check_poly(orth.eval_gegenbauer, orth.gegenbauer, param_ranges=[(-0.499, 10)], x_range=[-1, 1], rtol=1e-7) def test_chebyt(self): - self.check_poly(eval_chebyt, chebyt, + self.check_poly(orth.eval_chebyt, orth.chebyt, param_ranges=[], x_range=[-1, 1]) def test_chebyu(self): - self.check_poly(eval_chebyu, chebyu, + self.check_poly(orth.eval_chebyu, orth.chebyu, param_ranges=[], x_range=[-1, 1]) def test_chebys(self): - self.check_poly(eval_chebys, chebys, + self.check_poly(orth.eval_chebys, orth.chebys, param_ranges=[], x_range=[-2, 2]) def test_chebyc(self): - self.check_poly(eval_chebyc, chebyc, + self.check_poly(orth.eval_chebyc, orth.chebyc, param_ranges=[], x_range=[-2, 2]) def test_sh_chebyt(self): - self.check_poly(eval_sh_chebyt, sh_chebyt, + self.check_poly(orth.eval_sh_chebyt, orth.sh_chebyt, param_ranges=[], x_range=[0, 1]) def test_sh_chebyu(self): - self.check_poly(eval_sh_chebyu, sh_chebyu, + self.check_poly(orth.eval_sh_chebyu, orth.sh_chebyu, param_ranges=[], x_range=[0, 1]) def test_legendre(self): - self.check_poly(eval_legendre, legendre, + self.check_poly(orth.eval_legendre, orth.legendre, param_ranges=[], x_range=[-1, 1]) def test_sh_legendre(self): - self.check_poly(eval_sh_legendre, sh_legendre, + self.check_poly(orth.eval_sh_legendre, orth.sh_legendre, param_ranges=[], x_range=[0, 1]) def test_genlaguerre(self): - self.check_poly(eval_genlaguerre, genlaguerre, + self.check_poly(orth.eval_genlaguerre, orth.genlaguerre, param_ranges=[(-0.99, 10)], x_range=[0, 100]) def test_laguerre(self): - self.check_poly(eval_laguerre, laguerre, + self.check_poly(orth.eval_laguerre, orth.laguerre, param_ranges=[], x_range=[0, 100]) def test_hermite(self): - self.check_poly(eval_hermite, hermite, + self.check_poly(orth.eval_hermite, orth.hermite, param_ranges=[], x_range=[-100, 100]) def test_hermitenorm(self): - self.check_poly(eval_hermitenorm, hermitenorm, + self.check_poly(orth.eval_hermitenorm, orth.hermitenorm, param_ranges=[], x_range=[-100, 100]) Modified: trunk/scipy/special/tests/test_spfun_stats.py =================================================================== --- trunk/scipy/special/tests/test_spfun_stats.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/test_spfun_stats.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -1,8 +1,9 @@ import numpy as np -from numpy.testing import * +from numpy.testing import assert_array_equal, TestCase, run_module_suite from scipy.special import gammaln, multigammaln + class TestMultiGammaLn(TestCase): def test1(self): a = np.abs(np.random.randn()) Modified: trunk/scipy/special/tests/testutils.py =================================================================== --- trunk/scipy/special/tests/testutils.py 2010-09-12 21:29:13 UTC (rev 6799) +++ trunk/scipy/special/tests/testutils.py 2010-09-12 21:30:28 UTC (rev 6800) @@ -2,6 +2,7 @@ import warnings import numpy as np +from numpy.testing import assert_ from numpy.testing.noseclasses import KnownFailureTest import scipy.special as sc @@ -180,7 +181,7 @@ # Check the validity of each output returned - assert len(got) == len(wanted) + assert_(len(got) == len(wanted)) for output_num, (x, y) in enumerate(zip(got, wanted)): pinf_x = np.isinf(x) & (x > 0) @@ -220,7 +221,7 @@ c = " ".join(map(fmt, wanted)) d = fmt(rdiff) msg.append("%s => %s != %s (rdiff %s)" % (a, b, c, d)) - assert False, "\n".join(msg) + assert_(False, "\n".join(msg)) def __repr__(self): """Pretty-printing, esp. for Nose output""" From scipy-svn at scipy.org Sun Sep 12 17:31:02 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:31:02 -0500 (CDT) Subject: [Scipy-svn] r6801 - trunk/scipy/stats/tests Message-ID: <20100912213102.F3B2B39CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:31:02 -0500 (Sun, 12 Sep 2010) New Revision: 6801 Modified: trunk/scipy/stats/tests/test_continuous_basic.py trunk/scipy/stats/tests/test_continuous_extra.py trunk/scipy/stats/tests/test_discrete_basic.py trunk/scipy/stats/tests/test_distributions.py trunk/scipy/stats/tests/test_mstats_basic.py trunk/scipy/stats/tests/test_mstats_extras.py trunk/scipy/stats/tests/test_stats.py Log: TST: stats: Don't use plain 'assert'. Modified: trunk/scipy/stats/tests/test_continuous_basic.py =================================================================== --- trunk/scipy/stats/tests/test_continuous_basic.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_continuous_basic.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -220,15 +220,15 @@ npt.assert_almost_equal(m1, m, decimal=10, err_msg= msg + \ ' - 1st moment') else: # or np.isnan(m1), - assert np.isinf(m1), \ - msg + ' - 1st moment -infinite, m1=%s' % str(m1) + npt.assert_(np.isinf(m1), + msg + ' - 1st moment -infinite, m1=%s' % str(m1)) #np.isnan(m1) temporary special treatment for loggamma if not np.isinf(v): npt.assert_almost_equal(m2-m1*m1, v, decimal=10, err_msg= msg + \ ' - 2ndt moment') else: #or np.isnan(m2), - assert np.isinf(m2), \ - msg + ' - 2nd moment -infinite, m2=%s' % str(m2) + npt.assert_(np.isinf(m2), + msg + ' - 2nd moment -infinite, m2=%s' % str(m2)) #np.isnan(m2) temporary special treatment for loggamma def check_sample_meanvar_(distfn, arg, m, v, sm, sv, sn, msg): @@ -260,7 +260,7 @@ prob = stats.betai(0.5*df,0.5,df/(df+t*t)) #return t,prob - assert prob>0.01, 'mean fail, t,prob = %f, %f, m,sm=%f,%f' % (t,prob,popmean,sm) + npt.assert_(prob > 0.01, 'mean fail, t,prob = %f, %f, m,sm=%f,%f' % (t,prob,popmean,sm)) def check_sample_var(sv,n, popvar): ''' @@ -269,10 +269,9 @@ df = n-1 chi2 = (n-1)*popvar/float(popvar) pval = stats.chisqprob(chi2,df)*2 - assert pval>0.01, 'var fail, t,pval = %f, %f, v,sv=%f,%f' % (chi2,pval,popvar,sv) - + npt.assert_(pval > 0.01, 'var fail, t,pval = %f, %f, v,sv=%f,%f' % (chi2,pval,popvar,sv)) - + def check_sample_skew_kurt(distfn, arg, ss, sk, msg): skew,kurt = distfn.stats(moments='sk',*arg) ## skew = distfn.stats(moment='s',*arg)[()] @@ -354,10 +353,9 @@ D,pval = stats.kstest(rvs, dist, args=args, N=1000) if (pval < alpha): D,pval = stats.kstest(dist,'',args=args, N=1000) - assert (pval > alpha), "D = " + str(D) + "; pval = " + str(pval) + \ - "; alpha = " + str(alpha) + "\nargs = " + str(args) + npt.assert_(pval > alpha, "D = " + str(D) + "; pval = " + str(pval) + + "; alpha = " + str(alpha) + "\nargs = " + str(args)) if __name__ == "__main__": #nose.run(argv=['', __file__]) nose.runmodule(argv=[__file__,'-s'], exit=False) - Modified: trunk/scipy/stats/tests/test_continuous_extra.py =================================================================== --- trunk/scipy/stats/tests/test_continuous_extra.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_continuous_extra.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -8,7 +8,6 @@ import numpy.testing as npt import numpy as np -import nose from scipy import stats @@ -56,13 +55,13 @@ #print distfn.name,below,low,upp,above assert_equal_inf_nan(distfn.a,low, msg + 'ppf lower bound') assert_equal_inf_nan(distfn.b,upp, msg + 'ppf upper bound') - assert np.isnan(below), msg + 'ppf out of bounds - below' - assert np.isnan(above), msg + 'ppf out of bounds - above' + npt.assert_(np.isnan(below), msg + 'ppf out of bounds - below') + npt.assert_(np.isnan(above), msg + 'ppf out of bounds - above') def check_ppf_private(distfn,arg,msg): #fails by design for trunk norm self.nb not defined ppfs = distfn._ppf(np.array([0.1,0.5,0.9]), *arg) - assert not np.any(np.isnan(ppfs)), msg + 'ppf private is nan' + npt.assert_(not np.any(np.isnan(ppfs)), msg + 'ppf private is nan') def check_isf_limits(distfn,arg,msg): @@ -71,8 +70,8 @@ #print distfn.name,below,low,upp,above assert_equal_inf_nan(distfn.a,upp, msg + 'isf lower bound') assert_equal_inf_nan(distfn.b,low, msg + 'isf upper bound') - assert np.isnan(below), msg + 'isf out of bounds - below' - assert np.isnan(above), msg + 'isf out of bounds - above' + npt.assert_(np.isnan(below), msg + 'isf out of bounds - below') + npt.assert_(np.isnan(above), msg + 'isf out of bounds - above') def check_loc_scale(distfn,arg,msg): @@ -85,19 +84,18 @@ def check_entropy(distfn,arg,msg): ent = distfn.entropy(*arg) #print 'Entropy =', ent - assert not np.isnan(ent), msg + 'test Entropy is nan'\ + npt.assert_(not np.isnan(ent), msg + 'test Entropy is nan') def assert_equal_inf_nan(v1,v2,msg): - assert not np.isnan(v1) + npt.assert_(not np.isnan(v1)) if not np.isinf(v1): npt.assert_almost_equal(v1, v2, decimal=DECIMAL, err_msg = msg + \ ' - finite') else: - assert np.isinf(v2) or np.isnan(v2), \ - msg + ' - infinite, v2=%s' % str(v2) + npt.assert_(np.isinf(v2) or np.isnan(v2), + msg + ' - infinite, v2=%s' % str(v2)) if __name__ == "__main__": import nose #nose.run(argv=['', __file__]) nose.runmodule(argv=[__file__,'-s'], exit=False) - Modified: trunk/scipy/stats/tests/test_discrete_basic.py =================================================================== --- trunk/scipy/stats/tests/test_discrete_basic.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_discrete_basic.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -87,7 +87,7 @@ npt.assert_almost_equal(sm, m, decimal=DECIMAL_meanvar, err_msg=msg + \ ' - finite moment') else: - assert sm > 10000, 'infinite moment, sm = ' + str(sm) + npt.assert_(sm > 10000, msg='infinite moment, sm = ' + str(sm)) def check_sample_var(sm,m,msg): npt.assert_almost_equal(sm, m, decimal=DECIMAL_meanvar, err_msg= msg + 'var') @@ -97,7 +97,7 @@ cdf05 = distfn.cdf(ppf05,*arg) npt.assert_almost_equal(distfn.ppf(cdf05-1e-6,*arg),ppf05, err_msg=msg + 'ppf-cdf-median') - assert (distfn.ppf(cdf05+1e-4,*arg)>ppf05), msg + 'ppf-cdf-next' + npt.assert_((distfn.ppf(cdf05+1e-4,*arg)>ppf05), msg + 'ppf-cdf-next') def check_cdf_ppf2(distfn,arg,supp,msg): npt.assert_array_equal(distfn.ppf(distfn.cdf(supp,*arg),*arg), @@ -112,17 +112,17 @@ cdf05 = distfn.cdf(ppf05,*arg) npt.assert_almost_equal(distfn._ppf(cdf05-1e-6,*arg),ppf05, err_msg=msg + '_ppf-cdf-median ') - assert (distfn._ppf(cdf05+1e-4,*arg)>ppf05), msg + '_ppf-cdf-next' + npt.assert_((distfn._ppf(cdf05+1e-4,*arg)>ppf05), msg + '_ppf-cdf-next') def check_ppf_ppf(distfn, arg): - assert distfn.ppf(0.5,*arg) < np.inf + npt.assert_(distfn.ppf(0.5,*arg) < np.inf) ppfs = distfn.ppf([0.5,0.9],*arg) ppf_s = [distfn._ppf(0.5,*arg), distfn._ppf(0.9,*arg)] - assert np.all(ppfs < np.inf) - assert ppf_s[0] == distfn.ppf(0.5,*arg) - assert ppf_s[1] == distfn.ppf(0.9,*arg) - assert ppf_s[0] == ppfs[0] - assert ppf_s[1] == ppfs[1] + npt.assert_(np.all(ppfs < np.inf)) + npt.assert_(ppf_s[0] == distfn.ppf(0.5,*arg)) + npt.assert_(ppf_s[1] == distfn.ppf(0.9,*arg)) + npt.assert_(ppf_s[0] == ppfs[0]) + npt.assert_(ppf_s[1] == ppfs[1]) def check_pmf_cdf(distfn, arg, msg): startind = np.int(distfn._ppf(0.01,*arg)-1) @@ -147,8 +147,8 @@ distfn.cdf(meanint, *arg), decimal=8) median_sf = distfn.isf(0.5, *arg) - assert distfn.sf(median_sf - 1, *arg) > 0.5 - assert distfn.cdf(median_sf + 1, *arg) > 0.5 + npt.assert_(distfn.sf(median_sf - 1, *arg) > 0.5) + npt.assert_(distfn.cdf(median_sf + 1, *arg) > 0.5) npt.assert_equal(distfn.isf(0.5, *arg), distfn.ppf(0.5, *arg)) #next 3 functions copied from test_continous_extra @@ -160,8 +160,8 @@ #print distfn.name,below,low,upp,above assert_equal_inf_nan(distfn.a-1,low, msg + 'ppf lower bound') assert_equal_inf_nan(distfn.b,upp, msg + 'ppf upper bound') - assert np.isnan(below), msg + 'ppf out of bounds - below' - assert np.isnan(above), msg + 'ppf out of bounds - above' + npt.assert_(np.isnan(below), msg + 'ppf out of bounds - below') + npt.assert_(np.isnan(above), msg + 'ppf out of bounds - above') def check_isf_limits(distfn,arg,msg): below,low,upp,above = distfn.isf([-1,0,1,2], *arg) @@ -169,17 +169,17 @@ #print distfn.name,below,low,upp,above assert_equal_inf_nan(distfn.a-1,upp, msg + 'isf lower bound') assert_equal_inf_nan(distfn.b,low, msg + 'isf upper bound') - assert np.isnan(below), msg + 'isf out of bounds - below' - assert np.isnan(above), msg + 'isf out of bounds - above' + npt.assert_(np.isnan(below), msg + 'isf out of bounds - below') + npt.assert_(np.isnan(above), msg + 'isf out of bounds - above') def assert_equal_inf_nan(v1,v2,msg): - assert not np.isnan(v1) + npt.assert_(not np.isnan(v1)) if not np.isinf(v1): npt.assert_almost_equal(v1, v2, decimal=10, err_msg = msg + \ ' - finite') else: - assert np.isinf(v2) or np.isnan(v2), \ - msg + ' - infinite, v2=%s' % str(v2) + npt.assert_(np.isinf(v2) or np.isnan(v2), + msg + ' - infinite, v2=%s' % str(v2)) def check_sample_skew_kurt(distfn, arg, sk, ss, msg): k,s = distfn.stats(moment='ks',*arg) @@ -190,10 +190,9 @@ def check_entropy(distfn,arg,msg): ent = distfn.entropy(*arg) #print 'Entropy =', ent - assert not np.isnan(ent), msg + 'test Entropy is nan'\ + npt.assert_(not np.isnan(ent), msg + 'test Entropy is nan') - def check_discrete_chisquare(distfn, arg, rvs, alpha, msg): '''perform chisquare test for random sample of a discrete distribution @@ -253,8 +252,8 @@ cdfs = distfn.cdf(distsupp,*arg) (chis,pval) = stats.chisquare(np.array(freq),n*distmass) - assert (pval > alpha), 'chisquare - test for %s' \ - 'at arg = %s with pval = %s' % (msg,str(arg),str(pval)) + npt.assert_(pval > alpha, 'chisquare - test for %s' + ' at arg = %s with pval = %s' % (msg,str(arg),str(pval))) if __name__ == "__main__": Modified: trunk/scipy/stats/tests/test_distributions.py =================================================================== --- trunk/scipy/stats/tests/test_distributions.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_distributions.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -4,7 +4,7 @@ from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_equal, assert_almost_equal, assert_array_almost_equal, \ - rand, dec + assert_, rand, dec import numpy @@ -13,16 +13,16 @@ import scipy.stats as stats from scipy.stats.distributions import argsreduce -def kolmogorov_check(diststr,args=(),N=20,significance=0.01): - qtest = stats.ksoneisf(significance,N) +def kolmogorov_check(diststr, args=(), N=20, significance=0.01): + qtest = stats.ksoneisf(significance, N) cdf = eval('stats.'+diststr+'.cdf') dist = eval('stats.'+diststr) # Get random numbers kwds = {'size':N} - vals = numpy.sort(dist.rvs(*args,**kwds)) - cdfvals = cdf(vals,*args) - q = max(abs(cdfvals - np.arange(1.0,N+1)/N)) - assert (q < qtest), "Failed q=%f, bound=%f, alpha=%f" % (q, qtest, significance) + vals = numpy.sort(dist.rvs(*args, **kwds)) + cdfvals = cdf(vals, *args) + q = max(abs(cdfvals - np.arange(1.0, N+1)/N)) + assert_(q < qtest, msg="Failed q=%f, bound=%f, alpha=%f" % (q, qtest, significance)) return @@ -47,8 +47,8 @@ D,pval = stats.kstest(dist,'',args=args, N=1000) #if (pval < alpha): # D,pval = stats.kstest(dist,'',args=args, N=1000) - assert (pval > alpha), "D = " + str(D) + "; pval = " + str(pval) + \ - "; alpha = " + str(alpha) + "\nargs = " + str(args) + assert_(pval > alpha, msg="D = " + str(D) + "; pval = " + str(pval) + \ + "; alpha = " + str(alpha) + "\nargs = " + str(args)) # nose test generator def test_all_distributions(): @@ -97,16 +97,16 @@ class TestRandInt(TestCase): def test_rvs(self): vals = stats.randint.rvs(5,30,size=100) - assert(numpy.all(vals < 30) & numpy.all(vals >= 5)) - assert(len(vals) == 100) + assert_(numpy.all(vals < 30) & numpy.all(vals >= 5)) + assert_(len(vals) == 100) vals = stats.randint.rvs(5,30,size=(2,50)) - assert(numpy.shape(vals) == (2,50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.shape(vals) == (2,50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.randint.rvs(15,46) - assert((val >= 15) & (val < 46)) - assert isinstance(val, numpy.ScalarType),`type(val)` + assert_((val >= 15) & (val < 46)) + assert_(isinstance(val, numpy.ScalarType), msg=`type(val)`) val = stats.randint(15,46).rvs(3) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(val.dtype.char in typecodes['AllInteger']) def test_pdf(self): k = numpy.r_[0:36] @@ -124,51 +124,51 @@ class TestBinom(TestCase): def test_rvs(self): vals = stats.binom.rvs(10, 0.75, size=(2, 50)) - assert(numpy.all(vals >= 0) & numpy.all(vals <= 10)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 0) & numpy.all(vals <= 10)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.binom.rvs(10, 0.75) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.binom(10, 0.75).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestBernoulli(TestCase): def test_rvs(self): vals = stats.bernoulli.rvs(0.75, size=(2, 50)) - assert(numpy.all(vals >= 0) & numpy.all(vals <= 1)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 0) & numpy.all(vals <= 1)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.bernoulli.rvs(0.75) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.bernoulli(0.75).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestNBinom(TestCase): def test_rvs(self): vals = stats.nbinom.rvs(10, 0.75, size=(2, 50)) - assert(numpy.all(vals >= 0)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 0)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.nbinom.rvs(10, 0.75) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.nbinom(10, 0.75).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestGeom(TestCase): def test_rvs(self): vals = stats.geom.rvs(0.75, size=(2, 50)) - assert(numpy.all(vals >= 0)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 0)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.geom.rvs(0.75) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.geom(0.75).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) def test_pmf(self): vals = stats.geom.pmf([1,2,3],0.5) @@ -185,62 +185,62 @@ class TestHypergeom(TestCase): def test_rvs(self): vals = stats.hypergeom.rvs(20, 10, 3, size=(2, 50)) - assert(numpy.all(vals >= 0) & + assert_(numpy.all(vals >= 0) & numpy.all(vals <= 3)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.hypergeom.rvs(20, 3, 10) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.hypergeom(20, 3, 10).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestLogser(TestCase): def test_rvs(self): vals = stats.logser.rvs(0.75, size=(2, 50)) - assert(numpy.all(vals >= 1)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 1)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.logser.rvs(0.75) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.logser(0.75).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestPoisson(TestCase): def test_rvs(self): vals = stats.poisson.rvs(0.5, size=(2, 50)) - assert(numpy.all(vals >= 0)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 0)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.poisson.rvs(0.5) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.poisson(0.5).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestZipf(TestCase): def test_rvs(self): vals = stats.zipf.rvs(1.5, size=(2, 50)) - assert(numpy.all(vals >= 1)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.all(vals >= 1)) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.zipf.rvs(1.5) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.zipf(1.5).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestDLaplace(TestCase): def test_rvs(self): vals = stats.dlaplace.rvs(1.5 , size=(2, 50)) - assert(numpy.shape(vals) == (2, 50)) - assert(vals.dtype.char in typecodes['AllInteger']) + assert_(numpy.shape(vals) == (2, 50)) + assert_(vals.dtype.char in typecodes['AllInteger']) val = stats.dlaplace.rvs(1.5) - assert(isinstance(val, int)) + assert_(isinstance(val, int)) val = stats.dlaplace(1.5).rvs(3) - assert(isinstance(val, numpy.ndarray)) - assert(val.dtype.char in typecodes['AllInteger']) + assert_(isinstance(val, numpy.ndarray)) + assert_(val.dtype.char in typecodes['AllInteger']) class TestRvDiscrete(TestCase): def test_rvs(self): @@ -249,13 +249,13 @@ samples = 1000 r = stats.rv_discrete(name='sample',values=(states,probability)) x = r.rvs(size=samples) - assert(isinstance(x, numpy.ndarray)) + assert_(isinstance(x, numpy.ndarray)) for s,p in zip(states,probability): - assert abs(sum(x == s)/float(samples) - p) < 0.05 + assert_(abs(sum(x == s)/float(samples) - p) < 0.05) x = r.rvs() - assert(isinstance(x, int)) + assert_(isinstance(x, int)) class TestExpon(TestCase): def test_zero(self): @@ -276,7 +276,7 @@ def test_cdf_bounds(self): # CDF should always be positive cdf = stats.genexpon.cdf(numpy.arange(0, 10, 0.01), 0.5, 0.5, 2.0) - assert(numpy.all((0 <= cdf) & (cdf <= 1))) + assert_(numpy.all((0 <= cdf) & (cdf <= 1))) class TestExponpow(TestCase): def test_tail(self): @@ -367,8 +367,8 @@ qk = [0.1,0.25,0.65] eself = stats.entropy(pk,pk) edouble = stats.entropy(pk,qk) - assert(0.0 == eself) - assert(edouble >= 0.0) + assert_(0.0 == eself) + assert_(edouble >= 0.0) def TestArgsreduce(): a = array([1,3,2,1,2,3,3]) @@ -402,11 +402,11 @@ # FIXME: should check the actual results to see if we are 'close' # to what was created --- but what is 'close' enough if dist in ['erlang', 'frechet']: - assert(len(vals)==len(args)) - assert(len(vals2)==len(args)) + assert_(len(vals)==len(args)) + assert_(len(vals2)==len(args)) else: - assert(len(vals) == 2+len(args)) - assert(len(vals2)==2+len(args)) + assert_(len(vals) == 2+len(args)) + assert_(len(vals2)==2+len(args)) @dec.slow def test_fix_fit(self): @@ -419,22 +419,22 @@ res = distfunc.rvs(*args, **{'size':200}) vals = distfunc.fit(res,floc=0) vals2 = distfunc.fit(res,fscale=1) - assert(len(vals) == 2+len(args)) - assert(vals[-2] == 0) - assert(vals2[-1] == 1) - assert(len(vals2) == 2+len(args)) + assert_(len(vals) == 2+len(args)) + assert_(vals[-2] == 0) + assert_(vals2[-1] == 1) + assert_(len(vals2) == 2+len(args)) if len(args) > 0: vals3 = distfunc.fit(res, f0=args[0]) - assert(len(vals3) == 2+len(args)) - assert(vals3[0] == args[0]) + assert_(len(vals3) == 2+len(args)) + assert_(vals3[0] == args[0]) if len(args) > 1: vals4 = distfunc.fit(res, f1=args[1]) - assert(len(vals4) == 2+len(args)) - assert(vals4[1] == args[1]) + assert_(len(vals4) == 2+len(args)) + assert_(vals4[1] == args[1]) if len(args) > 2: vals5 = distfunc.fit(res, f2=args[2]) - assert(len(vals5) == 2+len(args)) - assert(vals5[2] == args[2]) + assert_(len(vals5) == 2+len(args)) + assert_(vals5[2] == args[2]) if __name__ == "__main__": run_module_suite() Modified: trunk/scipy/stats/tests/test_mstats_basic.py =================================================================== --- trunk/scipy/stats/tests/test_mstats_basic.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_mstats_basic.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -11,10 +11,9 @@ import scipy.stats.mstats as mstats from numpy.testing import TestCase, run_module_suite from numpy.ma.testutils import assert_equal, assert_almost_equal, \ - assert_array_almost_equal + assert_array_almost_equal, assert_ - class TestMquantiles(TestCase): """Regression tests for mstats module.""" def test_mquantiles_limit_keyword(self): @@ -47,7 +46,7 @@ desired1 = mstats.gmean(a,axis=-1) assert_almost_equal(actual, desired1, decimal=14) - assert not isinstance(desired1, ma.MaskedArray) + assert_(not isinstance(desired1, ma.MaskedArray)) # a = ma.array((1,2,3,4),mask=(0,0,0,1)) actual= mstats.gmean(a) @@ -134,8 +133,8 @@ # x = ma.array(x, mask=True) pr = mstats.pearsonr(x,x) - assert(pr[0] is masked) - assert(pr[1] is masked) + assert_(pr[0] is masked) + assert_(pr[1] is masked) # def test_spearmanr(self): "Tests some computations of Spearman's rho" Modified: trunk/scipy/stats/tests/test_mstats_extras.py =================================================================== --- trunk/scipy/stats/tests/test_mstats_extras.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_mstats_extras.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -14,7 +14,7 @@ #import scipy.stats.mmorestats as mms from numpy.testing import TestCase, run_module_suite, assert_equal, \ - assert_almost_equal + assert_almost_equal, assert_ class TestMisc(TestCase): @@ -49,7 +49,7 @@ test.repeat(2).reshape(-1,2)) test = [0,0] _result = ms.idealfourths(test) - assert(np.isnan(_result).all()) + assert_(np.isnan(_result).all()) #.............................................................................. class TestQuantiles(TestCase): Modified: trunk/scipy/stats/tests/test_stats.py =================================================================== --- trunk/scipy/stats/tests/test_stats.py 2010-09-12 21:30:28 UTC (rev 6800) +++ trunk/scipy/stats/tests/test_stats.py 2010-09-12 21:31:02 UTC (rev 6801) @@ -218,7 +218,7 @@ def test_nanmean_all(self): """Check nanmean when all values are nan.""" m = stats.nanmean(self.Xall) - assert np.isnan(m) + assert_(np.isnan(m)) def test_nanstd_none(self): """Check nanstd when no values are nan.""" @@ -233,7 +233,7 @@ def test_nanstd_all(self): """Check nanstd when all values are nan.""" s = stats.nanstd(self.Xall) - assert np.isnan(s) + assert_(np.isnan(s)) def test_nanstd_negative_axis(self): x = np.array([1, 2, 3]) @@ -252,7 +252,7 @@ def test_nanmedian_all(self): """Check nanmedian when all values are nan.""" m = stats.nanmedian(self.Xall) - assert np.isnan(m) + assert_(np.isnan(m)) class TestCorr(TestCase): """ W.II.D. Compute a correlation matrix on all the variables. From scipy-svn at scipy.org Sun Sep 12 17:46:09 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 16:46:09 -0500 (CDT) Subject: [Scipy-svn] r6802 - in trunk/scipy/io: arff/tests matlab/tests tests Message-ID: <20100912214609.0DC6839CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 16:46:08 -0500 (Sun, 12 Sep 2010) New Revision: 6802 Modified: trunk/scipy/io/arff/tests/test_arffread.py trunk/scipy/io/matlab/tests/test_byteordercodes.py trunk/scipy/io/tests/test_wavfile.py Log: TST: io: Don't use 'import *'. Don't use plain 'assert'. Simplify a test by using 'assert_raises'. Modified: trunk/scipy/io/arff/tests/test_arffread.py =================================================================== --- trunk/scipy/io/arff/tests/test_arffread.py 2010-09-12 21:31:02 UTC (rev 6801) +++ trunk/scipy/io/arff/tests/test_arffread.py 2010-09-12 21:46:08 UTC (rev 6802) @@ -4,7 +4,8 @@ import numpy as np -from numpy.testing import TestCase, assert_array_almost_equal, assert_equal +from numpy.testing import TestCase, assert_array_almost_equal, assert_equal, \ + assert_, assert_raises from scipy.io.arff.arffread import loadarff from scipy.io.arff.arffread import read_header, parse_type, ParseArffError @@ -61,7 +62,7 @@ 'numeric', 'string', 'string', 'nominal', 'nominal'] for i in range(len(attrs)): - assert parse_type(attrs[i][1]) == expected[i] + assert_(parse_type(attrs[i][1]) == expected[i]) def test_badtype_parsing(self): """Test parsing wrong type of attribute from their value.""" @@ -69,11 +70,7 @@ rel, attrs = read_header(ofile) for name, value in attrs: - try: - parse_type(value) - raise Error("Could parse type of crap, should not happen.") - except ParseArffError: - pass + assert_raises(ParseArffError, parse_type, value) def test_fullheader1(self): """Parsing trivial header with nothing.""" @@ -81,18 +78,18 @@ rel, attrs = read_header(ofile) # Test relation - assert rel == 'test1' + assert_(rel == 'test1') # Test numerical attributes - assert len(attrs) == 5 + assert_(len(attrs) == 5) for i in range(4): - assert attrs[i][0] == 'attr%d' % i - assert attrs[i][1] == 'REAL' + assert_(attrs[i][0] == 'attr%d' % i) + assert_(attrs[i][1] == 'REAL') classes = attrs[4][1] # Test nominal attribute - assert attrs[4][0] == 'class' - assert attrs[4][1] == '{class0, class1, class2, class3}' + assert_(attrs[4][0] == 'class') + assert_(attrs[4][1] == '{class0, class1, class2, class3}') if __name__ == "__main__": import nose Modified: trunk/scipy/io/matlab/tests/test_byteordercodes.py =================================================================== --- trunk/scipy/io/matlab/tests/test_byteordercodes.py 2010-09-12 21:31:02 UTC (rev 6801) +++ trunk/scipy/io/matlab/tests/test_byteordercodes.py 2010-09-12 21:46:08 UTC (rev 6802) @@ -2,29 +2,28 @@ import sys -import numpy as np +from numpy.testing import assert_raises, assert_, run_module_suite -from numpy.testing import assert_raises, run_module_suite - import scipy.io.matlab.byteordercodes as sibc + def test_native(): native_is_le = sys.byteorder == 'little' - assert sibc.sys_is_le == native_is_le + assert_(sibc.sys_is_le == native_is_le) def test_to_numpy(): if sys.byteorder == 'little': - assert sibc.to_numpy_code('native') == '<' - assert sibc.to_numpy_code('swapped') == '>' + assert_(sibc.to_numpy_code('native') == '<') + assert_(sibc.to_numpy_code('swapped') == '>') else: - assert sibc.to_numpy_code('native') == '>' - assert sibc.to_numpy_code('swapped') == '<' - assert sibc.to_numpy_code('native') == sibc.to_numpy_code('=') - assert sibc.to_numpy_code('big') == '>' + assert_(sibc.to_numpy_code('native') == '>') + assert_(sibc.to_numpy_code('swapped') == '<') + assert_(sibc.to_numpy_code('native') == sibc.to_numpy_code('=')) + assert_(sibc.to_numpy_code('big') == '>') for code in ('little', '<', 'l', 'L', 'le'): - assert sibc.to_numpy_code(code) == '<' + assert_(sibc.to_numpy_code(code) == '<') for code in ('big', '>', 'b', 'B', 'be'): - assert sibc.to_numpy_code(code) == '>' + assert_(sibc.to_numpy_code(code) == '>') assert_raises(ValueError, sibc.to_numpy_code, 'silly string') if __name__ == "__main__": Modified: trunk/scipy/io/tests/test_wavfile.py =================================================================== --- trunk/scipy/io/tests/test_wavfile.py 2010-09-12 21:31:02 UTC (rev 6801) +++ trunk/scipy/io/tests/test_wavfile.py 2010-09-12 21:46:08 UTC (rev 6802) @@ -2,7 +2,7 @@ import tempfile import numpy as np -from numpy.testing import * +from numpy.testing import assert_equal, assert_, assert_raises, assert_array_equal from scipy.io import wavfile def datafile(fn): @@ -10,15 +10,15 @@ def test_read_1(): rate, data = wavfile.read(datafile('test-44100-le-1ch-4bytes.wav')) - assert rate == 44100 - assert np.issubdtype(data.dtype, np.int32) - assert data.shape == (4410,) + assert_equal(rate, 44100) + assert_(np.issubdtype(data.dtype, np.int32)) + assert_equal(data.shape, (4410,)) def test_read_2(): rate, data = wavfile.read(datafile('test-8000-le-2ch-1byteu.wav')) - assert rate == 8000 - assert np.issubdtype(data.dtype, np.uint8) - assert data.shape == (800, 2) + assert_equal(rate, 8000) + assert_(np.issubdtype(data.dtype, np.uint8)) + assert_equal(data.shape, (800, 2)) def test_read_fail(): assert_raises(ValueError, wavfile.read, datafile('example_1.nc')) @@ -36,8 +36,8 @@ wavfile.write(tmpfile, rate, data) rate2, data2 = wavfile.read(tmpfile) - assert rate == rate2 - assert data2.dtype.byteorder in ('<', '=', '|'), data2.dtype + assert_equal(rate, rate2) + assert_(data2.dtype.byteorder in ('<', '=', '|'), msg=data2.dtype) assert_array_equal(data, data2) finally: os.unlink(tmpfile) From scipy-svn at scipy.org Sun Sep 12 18:11:24 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 12 Sep 2010 17:11:24 -0500 (CDT) Subject: [Scipy-svn] r6803 - in trunk/scipy: lib/blas/tests linalg/tests Message-ID: <20100912221124.CD3D139CAEC@scipy.org> Author: warren.weckesser Date: 2010-09-12 17:11:24 -0500 (Sun, 12 Sep 2010) New Revision: 6803 Modified: trunk/scipy/lib/blas/tests/test_fblas.py trunk/scipy/linalg/tests/test_fblas.py Log: TST: Remove plain asserts from two more files. Modified: trunk/scipy/lib/blas/tests/test_fblas.py =================================================================== --- trunk/scipy/lib/blas/tests/test_fblas.py 2010-09-12 21:46:08 UTC (rev 6802) +++ trunk/scipy/lib/blas/tests/test_fblas.py 2010-09-12 22:11:24 UTC (rev 6803) @@ -86,7 +86,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) def test_y_bad_size(self): x = arange(12.,dtype=complex64) @@ -96,7 +96,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) try: class TestSaxpy(TestCase, BaseAxpy): @@ -148,7 +148,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) try: class TestSscal(TestCase, BaseScal): @@ -214,7 +214,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) def test_y_bad_size(self): x = arange(12.,dtype=complex64) @@ -224,7 +224,8 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + #def test_y_bad_type(self): ## Hmmm. Should this work? What should be the output. # x = arange(3.,dtype=self.dtype) @@ -306,7 +307,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) def test_y_bad_size(self): x = arange(12.,dtype=complex64) @@ -316,7 +317,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) try: class TestSswap(TestCase, BaseSwap): @@ -401,12 +402,12 @@ alpha,beta,a,x,y = self.get_data(x_stride=2) try: y = self.blas_func(1,a,x,1,y,trans=0,incx=3) - assert(0) + assert_(0) except: pass try: y = self.blas_func(1,a,x,1,y,trans=1,incx=3) - assert(0) + assert_(0) except: pass @@ -429,12 +430,12 @@ alpha,beta,a,x,y = self.get_data(y_stride=2) try: y = self.blas_func(1,a,x,1,y,trans=0,incy=3) - assert(0) + assert_(0) except: pass try: y = self.blas_func(1,a,x,1,y,trans=1,incy=3) - assert(0) + assert_(0) except: pass Modified: trunk/scipy/linalg/tests/test_fblas.py =================================================================== --- trunk/scipy/linalg/tests/test_fblas.py 2010-09-12 21:46:08 UTC (rev 6802) +++ trunk/scipy/linalg/tests/test_fblas.py 2010-09-12 22:11:24 UTC (rev 6803) @@ -42,18 +42,21 @@ class BaseAxpy(object): ''' Mixin class for axpy tests ''' + def test_default_a(self): x = arange(3.,dtype=self.dtype) y = arange(3.,dtype=x.dtype) real_y = x*1.+y self.blas_func(x,y) assert_array_equal(real_y,y) + def test_simple(self): x = arange(3.,dtype=self.dtype) y = arange(3.,dtype=x.dtype) real_y = x*3.+y self.blas_func(x,y,a=3.) assert_array_equal(real_y,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) @@ -61,18 +64,21 @@ real_y = x[::2]*3.+y self.blas_func(x,y,a=3.,n=3,incx=2) assert_array_equal(real_y,y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) real_y = x*3.+y[::2] self.blas_func(x,y,a=3.,n=3,incy=2) assert_array_equal(real_y,y[::2]) + def test_x_and_y_stride(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) real_y = x[::4]*3.+y[::2] self.blas_func(x,y,a=3.,n=3,incx=4,incy=2) assert_array_equal(real_y,y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -81,7 +87,8 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -90,7 +97,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) try: class TestSaxpy(TestCase, BaseAxpy): @@ -98,15 +105,18 @@ dtype = float32 except AttributeError: class TestSaxpy: pass + class TestDaxpy(TestCase, BaseAxpy): blas_func = fblas.daxpy dtype = float64 + try: class TestCaxpy(TestCase, BaseAxpy): blas_func = fblas.caxpy dtype = complex64 except AttributeError: class TestCaxpy: pass + class TestZaxpy(TestCase, BaseAxpy): blas_func = fblas.zaxpy dtype = complex128 @@ -117,17 +127,20 @@ class BaseScal(object): ''' Mixin class for scal testing ''' + def test_simple(self): x = arange(3.,dtype=self.dtype) real_x = x*3. self.blas_func(3.,x) assert_array_equal(real_x,x) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) real_x = x.copy() real_x[::2] = x[::2]*array(3.,self.dtype) self.blas_func(3.,x,n=3,incx=2) assert_array_equal(real_x,x) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) try: @@ -135,54 +148,61 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + try: class TestSscal(TestCase, BaseScal): blas_func = fblas.sscal dtype = float32 except AttributeError: class TestSscal: pass + class TestDscal(TestCase, BaseScal): blas_func = fblas.dscal dtype = float64 + try: class TestCscal(TestCase, BaseScal): blas_func = fblas.cscal dtype = complex64 except AttributeError: class TestCscal: pass + class TestZscal(TestCase, BaseScal): blas_func = fblas.zscal dtype = complex128 - - ################################################## ### Test blas ?copy class BaseCopy(object): ''' Mixin class for copy testing ''' + def test_simple(self): x = arange(3.,dtype=self.dtype) y = zeros(shape(x),x.dtype) self.blas_func(x,y) assert_array_equal(x,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) self.blas_func(x,y,n=3,incx=2) assert_array_equal(x[::2],y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) self.blas_func(x,y,n=3,incy=2) assert_array_equal(x,y[::2]) + def test_x_and_y_stride(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) self.blas_func(x,y,n=3,incx=4,incy=2) assert_array_equal(x[::4],y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -191,7 +211,8 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -200,7 +221,8 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + #def test_y_bad_type(self): ## Hmmm. Should this work? What should be the output. # x = arange(3.,dtype=self.dtype) @@ -214,15 +236,18 @@ dtype = float32 except AttributeError: class TestScopy: pass + class TestDcopy(TestCase, BaseCopy): blas_func = fblas.dcopy dtype = float64 + try: class TestCcopy(TestCase, BaseCopy): blas_func = fblas.ccopy dtype = complex64 except AttributeError: class TestCcopy: pass + class TestZcopy(TestCase, BaseCopy): blas_func = fblas.zcopy dtype = complex128 @@ -233,6 +258,7 @@ class BaseSwap(object): ''' Mixin class for swap tests ''' + def test_simple(self): x = arange(3.,dtype=self.dtype) y = zeros(shape(x),x.dtype) @@ -241,6 +267,7 @@ self.blas_func(x,y) assert_array_equal(desired_x,x) assert_array_equal(desired_y,y) + def test_x_stride(self): x = arange(6.,dtype=self.dtype) y = zeros(3,x.dtype) @@ -249,6 +276,7 @@ self.blas_func(x,y,n=3,incx=2) assert_array_equal(desired_x,x[::2]) assert_array_equal(desired_y,y) + def test_y_stride(self): x = arange(3.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -266,6 +294,7 @@ self.blas_func(x,y,n=3,incx=4,incy=2) assert_array_equal(desired_x,x[::4]) assert_array_equal(desired_y,y[::2]) + def test_x_bad_size(self): x = arange(12.,dtype=self.dtype) y = zeros(6,x.dtype) @@ -274,7 +303,8 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) + def test_y_bad_size(self): x = arange(12.,dtype=complex64) y = zeros(6,x.dtype) @@ -283,7 +313,7 @@ except: # what kind of error should be caught? return # should catch error and never get here - assert(0) + assert_(0) try: class TestSswap(TestCase, BaseSwap): @@ -291,15 +321,18 @@ dtype = float32 except AttributeError: class TestSswap: pass + class TestDswap(TestCase, BaseSwap): blas_func = fblas.dswap dtype = float64 + try: class TestCswap(TestCase, BaseSwap): blas_func = fblas.cswap dtype = complex64 except AttributeError: class TestCswap: pass + class TestZswap(TestCase, BaseSwap): blas_func = fblas.zswap dtype = complex128 @@ -310,6 +343,7 @@ class BaseGemv(object): ''' Mixin class for gemv tests ''' + def get_data(self,x_stride=1,y_stride=1): mult = array(1, dtype = self.dtype) if self.dtype in [complex64, complex128]: @@ -321,72 +355,82 @@ x = arange(shape(a)[0]*x_stride,dtype=self.dtype) * mult y = arange(shape(a)[1]*y_stride,dtype=self.dtype) * mult return alpha,beta,a,x,y + def test_simple(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(a,x)+beta*y y = self.blas_func(alpha,a,x,beta,y) assert_array_almost_equal(desired_y,y) + def test_default_beta_y(self): alpha,beta,a,x,y = self.get_data() desired_y = matrixmultiply(a,x) y = self.blas_func(1,a,x) assert_array_almost_equal(desired_y,y) + def test_simple_transpose(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(transpose(a),x)+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=1) assert_array_almost_equal(desired_y,y) + def test_simple_transpose_conj(self): alpha,beta,a,x,y = self.get_data() desired_y = alpha*matrixmultiply(transpose(conjugate(a)),x)+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=2) assert_array_almost_equal(desired_y,y) + def test_x_stride(self): alpha,beta,a,x,y = self.get_data(x_stride=2) desired_y = alpha*matrixmultiply(a,x[::2])+beta*y y = self.blas_func(alpha,a,x,beta,y,incx=2) assert_array_almost_equal(desired_y,y) + def test_x_stride_transpose(self): alpha,beta,a,x,y = self.get_data(x_stride=2) desired_y = alpha*matrixmultiply(transpose(a),x[::2])+beta*y y = self.blas_func(alpha,a,x,beta,y,trans=1,incx=2) assert_array_almost_equal(desired_y,y) + def test_x_stride_assert(self): # What is the use of this test? alpha,beta,a,x,y = self.get_data(x_stride=2) try: y = self.blas_func(1,a,x,1,y,trans=0,incx=3) - assert(0) + assert_(0) except: pass try: y = self.blas_func(1,a,x,1,y,trans=1,incx=3) - assert(0) + assert_(0) except: pass + def test_y_stride(self): alpha,beta,a,x,y = self.get_data(y_stride=2) desired_y = y.copy() desired_y[::2] = alpha*matrixmultiply(a,x)+beta*y[::2] y = self.blas_func(alpha,a,x,beta,y,incy=2) assert_array_almost_equal(desired_y,y) + def test_y_stride_transpose(self): alpha,beta,a,x,y = self.get_data(y_stride=2) desired_y = y.copy() desired_y[::2] = alpha*matrixmultiply(transpose(a),x)+beta*y[::2] y = self.blas_func(alpha,a,x,beta,y,trans=1,incy=2) assert_array_almost_equal(desired_y,y) + def test_y_stride_assert(self): # What is the use of this test? alpha,beta,a,x,y = self.get_data(y_stride=2) try: y = self.blas_func(1,a,x,1,y,trans=0,incy=3) - assert(0) + assert_(0) except: pass try: y = self.blas_func(1,a,x,1,y,trans=1,incy=3) - assert(0) + assert_(0) except: pass @@ -396,15 +440,18 @@ dtype = float32 except AttributeError: class TestSgemv: pass + class TestDgemv(TestCase, BaseGemv): blas_func = fblas.dgemv dtype = float64 + try: class TestCgemv(TestCase, BaseGemv): blas_func = fblas.cgemv dtype = complex64 except AttributeError: class TestCgemv: pass + class TestZgemv(TestCase, BaseGemv): blas_func = fblas.zgemv dtype = complex128 From scipy-svn at scipy.org Mon Sep 13 15:53:39 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 13 Sep 2010 14:53:39 -0500 (CDT) Subject: [Scipy-svn] r6804 - trunk Message-ID: <20100913195339.44DAB39CD02@scipy.org> Author: ptvirtan Date: 2010-09-13 14:53:39 -0500 (Mon, 13 Sep 2010) New Revision: 6804 Modified: trunk/setup.py Log: 3K: setup.py: fix svn_version on Python 3 Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2010-09-12 22:11:24 UTC (rev 6803) +++ trunk/setup.py 2010-09-13 19:53:39 UTC (rev 6804) @@ -54,6 +54,8 @@ # Return the svn version as a string, raise a ValueError otherwise def svn_version(): + from numpy.compat import asstr + env = os.environ.copy() env['LC_ALL'] = 'C' try: @@ -65,7 +67,7 @@ r = re.compile('Revision: ([0-9]+)') svnver = None - for line in out.split('\n'): + for line in asstr(out).split('\n'): m = r.match(line) if m: svnver = m.group(1) From scipy-svn at scipy.org Mon Sep 13 17:20:07 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 13 Sep 2010 16:20:07 -0500 (CDT) Subject: [Scipy-svn] r6805 - in trunk/scipy: cluster/tests fftpack/tests linalg/tests ndimage/tests signal/tests spatial/tests stats/tests weave/tests Message-ID: <20100913212007.E89F139CD2F@scipy.org> Author: charris Date: 2010-09-13 16:20:07 -0500 (Mon, 13 Sep 2010) New Revision: 6805 Modified: trunk/scipy/cluster/tests/test_hierarchy.py trunk/scipy/fftpack/tests/test_basic.py trunk/scipy/fftpack/tests/test_real_transforms.py trunk/scipy/linalg/tests/test_build.py trunk/scipy/ndimage/tests/test_ndimage.py trunk/scipy/signal/tests/test_signaltools.py trunk/scipy/spatial/tests/test_distance.py trunk/scipy/stats/tests/test_distributions.py trunk/scipy/weave/tests/test_size_check.py Log: PY3: Replace deprecated testfunctions. Modified: trunk/scipy/cluster/tests/test_hierarchy.py =================================================================== --- trunk/scipy/cluster/tests/test_hierarchy.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/cluster/tests/test_hierarchy.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -107,7 +107,7 @@ def test_linkage_empty_distance_matrix(self): "Tests linkage(Y) where Y is a 0x4 linkage matrix. Exception expected." y = np.zeros((0,)) - self.failUnlessRaises(ValueError, linkage, y) + self.assertRaises(ValueError, linkage, y) ################### linkage def test_linkage_single_tdist(self): @@ -116,7 +116,7 @@ Zmlab = eo['linkage-single-tdist'] eps = 1e-10 expectedZ = from_mlab_linkage(Zmlab) - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_complete_tdist(self): "Tests linkage(Y, 'complete') on the tdist data set." @@ -124,7 +124,7 @@ Zmlab = eo['linkage-complete-tdist'] eps = 1e-10 expectedZ = from_mlab_linkage(Zmlab) - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_average_tdist(self): "Tests linkage(Y, 'average') on the tdist data set." @@ -133,7 +133,7 @@ eps = 1e-05 expectedZ = from_mlab_linkage(Zmlab) #print Z, expectedZ, np.abs(Z - expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_weighted_tdist(self): "Tests linkage(Y, 'weighted') on the tdist data set." @@ -142,7 +142,7 @@ eps = 1e-10 expectedZ = from_mlab_linkage(Zmlab) #print Z, expectedZ, np.abs(Z - expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) ################### linkage on Q def test_linkage_single_q(self): @@ -153,7 +153,7 @@ eps = 1e-06 expectedZ = from_mlab_linkage(Zmlab) #print abs(Z-expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_complete_q(self): "Tests linkage(Y, 'complete') on the Q data set." @@ -163,7 +163,7 @@ eps = 1e-07 expectedZ = from_mlab_linkage(Zmlab) #print abs(Z-expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_centroid_q(self): "Tests linkage(Y, 'centroid') on the Q data set." @@ -173,7 +173,7 @@ eps = 1e-07 expectedZ = from_mlab_linkage(Zmlab) #print abs(Z-expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) def test_linkage_weighted_q(self): "Tests linkage(Y, 'weighted') on the Q data set." @@ -183,7 +183,7 @@ eps = 1e-07 expectedZ = from_mlab_linkage(Zmlab) #print abs(Z-expectedZ).max() - self.failUnless(within_tol(Z, expectedZ, eps)) + self.assertTrue(within_tol(Z, expectedZ, eps)) class TestInconsistent(TestCase): @@ -195,7 +195,7 @@ Rright = eo['inconsistent-single-tdist-depth-1'] eps = 1e-15 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_tdist_2(self): "Tests inconsistency matrix calculation (depth=2) on a single linkage." @@ -205,7 +205,7 @@ Rright = eo['inconsistent-single-tdist-depth-2'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_tdist_3(self): "Tests inconsistency matrix calculation (depth=3) on a single linkage." @@ -215,7 +215,7 @@ Rright = eo['inconsistent-single-tdist-depth-3'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_tdist_4(self): "Tests inconsistency matrix calculation (depth=4) on a single linkage." @@ -225,7 +225,7 @@ Rright = eo['inconsistent-single-tdist-depth-4'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) # with complete linkage... @@ -237,7 +237,7 @@ Rright = eo['inconsistent-complete-tdist-depth-1'] eps = 1e-15 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_complete_inconsistent_tdist_2(self): "Tests inconsistency matrix calculation (depth=2) on a complete linkage." @@ -247,7 +247,7 @@ Rright = eo['inconsistent-complete-tdist-depth-2'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_complete_inconsistent_tdist_3(self): "Tests inconsistency matrix calculation (depth=3) on a complete linkage." @@ -257,7 +257,7 @@ Rright = eo['inconsistent-complete-tdist-depth-3'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_complete_inconsistent_tdist_4(self): "Tests inconsistency matrix calculation (depth=4) on a complete linkage." @@ -267,7 +267,7 @@ Rright = eo['inconsistent-complete-tdist-depth-4'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) # with single linkage and Q data set @@ -279,7 +279,7 @@ Rright = eo['inconsistent-Q-single-1'] eps = 1e-06 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_Q_2(self): "Tests inconsistency matrix calculation (depth=2, dataset=Q) with single linkage." @@ -289,7 +289,7 @@ Rright = eo['inconsistent-Q-single-2'] eps = 1e-06 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_Q_3(self): "Tests inconsistency matrix calculation (depth=3, dataset=Q) with single linkage." @@ -299,7 +299,7 @@ Rright = eo['inconsistent-Q-single-3'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) def test_single_inconsistent_Q_4(self): "Tests inconsistency matrix calculation (depth=4, dataset=Q) with single linkage." @@ -309,7 +309,7 @@ Rright = eo['inconsistent-Q-single-4'] eps = 1e-05 #print np.abs(R - Rright).max() - self.failUnless(within_tol(R, Rright, eps)) + self.assertTrue(within_tol(R, Rright, eps)) class TestCopheneticDistance(TestCase): @@ -319,7 +319,7 @@ Z = linkage(_ytdist, 'single') M = cophenet(Z) eps = 1e-10 - self.failUnless(within_tol(M, expectedM, eps)) + self.assertTrue(within_tol(M, expectedM, eps)) def test_linkage_cophenet_tdist_Z_Y(self): "Tests cophenet(Z, Y) on tdist data set." @@ -328,8 +328,8 @@ expectedM = np.array([268, 295, 255, 255, 295, 295, 268, 268, 295, 295, 295, 138, 219, 295, 295]); expectedc = 0.639931296433393415057366837573 eps = 1e-10 - self.failUnless(np.abs(c - expectedc) <= eps) - self.failUnless(within_tol(M, expectedM, eps)) + self.assertTrue(np.abs(c - expectedc) <= eps) + self.assertTrue(within_tol(M, expectedM, eps)) class TestFromMLabLinkage(TestCase): @@ -337,14 +337,14 @@ "Tests from_mlab_linkage on empty linkage array." X = np.asarray([]) R = from_mlab_linkage([]) - self.failUnless((R == X).all()) + self.assertTrue((R == X).all()) def test_from_mlab_linkage_single_row(self): "Tests from_mlab_linkage on linkage array with single row." expectedZP = np.asarray([[ 0., 1., 3., 2.]]) Z = [[1,2,3]] ZP = from_mlab_linkage(Z) - return self.failUnless((ZP == expectedZP).all()) + return self.assertTrue((ZP == expectedZP).all()) def test_from_mlab_linkage_multiple_rows(self): "Tests from_mlab_linkage on linkage array with multiple rows." @@ -358,7 +358,7 @@ dtype=np.double) ZS = from_mlab_linkage(Z) #print expectedZS, ZS - self.failUnless((expectedZS == ZS).all()) + self.assertTrue((expectedZS == ZS).all()) class TestToMLabLinkage(TestCase): @@ -367,14 +367,14 @@ "Tests to_mlab_linkage on empty linkage array." X = np.asarray([]) R = to_mlab_linkage([]) - self.failUnless((R == X).all()) + self.assertTrue((R == X).all()) def test_to_mlab_linkage_single_row(self): "Tests to_mlab_linkage on linkage array with single row." Z = np.asarray([[ 0., 1., 3., 2.]]) expectedZP = np.asarray([[1,2,3]]) ZP = to_mlab_linkage(Z) - return self.failUnless((ZP == expectedZP).all()) + return self.assertTrue((ZP == expectedZP).all()) def test_from_mlab_linkage_multiple_rows(self): "Tests to_mlab_linkage on linkage array with multiple rows." @@ -388,7 +388,7 @@ dtype=np.double) ZM = to_mlab_linkage(Z) #print expectedZM, ZM - self.failUnless((expectedZM == ZM).all()) + self.assertTrue((expectedZM == ZM).all()) class TestFcluster(TestCase): @@ -397,21 +397,21 @@ expectedT = np.int_(eo['fclusterdata-maxclusts-2']) X = eo['Q-X'] T = fclusterdata(X, criterion='maxclust', t=2) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) def test_fclusterdata_maxclusts_3(self): "Tests fclusterdata(X, criterion='maxclust', t=3) on a random 3-cluster data set." expectedT = np.int_(eo['fclusterdata-maxclusts-3']) X = eo['Q-X'] T = fclusterdata(X, criterion='maxclust', t=3) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) def test_fclusterdata_maxclusts_4(self): "Tests fclusterdata(X, criterion='maxclust', t=4) on a random 3-cluster data set." expectedT = np.int_(eo['fclusterdata-maxclusts-4']) X = eo['Q-X'] T = fclusterdata(X, criterion='maxclust', t=4) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) def test_fcluster_maxclusts_2(self): "Tests fcluster(Z, criterion='maxclust', t=2) on a random 3-cluster data set." @@ -420,7 +420,7 @@ Y = pdist(X) Z = linkage(Y) T = fcluster(Z, criterion='maxclust', t=2) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) def test_fcluster_maxclusts_3(self): "Tests fcluster(Z, criterion='maxclust', t=3) on a random 3-cluster data set." @@ -429,7 +429,7 @@ Y = pdist(X) Z = linkage(Y) T = fcluster(Z, criterion='maxclust', t=3) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) def test_fcluster_maxclusts_4(self): "Tests fcluster(Z, criterion='maxclust', t=4) on a random 3-cluster data set." @@ -438,7 +438,7 @@ Y = pdist(X) Z = linkage(Y) T = fcluster(Z, criterion='maxclust', t=4) - self.failUnless(is_isomorphic(T, expectedT)) + self.assertTrue(is_isomorphic(T, expectedT)) class TestLeaders(TestCase): @@ -451,7 +451,7 @@ Lright = (np.array([53, 55, 56]), np.array([2, 3, 1])) L = leaders(Z, T) #print L, Lright, T - self.failUnless((L[0] == Lright[0]).all() and (L[1] == Lright[1]).all()) + self.assertTrue((L[0] == Lright[0]).all() and (L[1] == Lright[1]).all()) class TestIsIsomorphic(TestCase): @@ -459,42 +459,42 @@ "Tests is_isomorphic on test case #1 (one flat cluster, different labellings)" a = [1, 1, 1] b = [2, 2, 2] - self.failUnless(is_isomorphic(a, b) == True) - self.failUnless(is_isomorphic(b, a) == True) + self.assertTrue(is_isomorphic(a, b) == True) + self.assertTrue(is_isomorphic(b, a) == True) def test_is_isomorphic_2(self): "Tests is_isomorphic on test case #2 (two flat clusters, different labelings)" a = [1, 7, 1] b = [2, 3, 2] - self.failUnless(is_isomorphic(a, b) == True) - self.failUnless(is_isomorphic(b, a) == True) + self.assertTrue(is_isomorphic(a, b) == True) + self.assertTrue(is_isomorphic(b, a) == True) def test_is_isomorphic_3(self): "Tests is_isomorphic on test case #3 (no flat clusters)" a = [] b = [] - self.failUnless(is_isomorphic(a, b) == True) + self.assertTrue(is_isomorphic(a, b) == True) def test_is_isomorphic_4A(self): "Tests is_isomorphic on test case #4A (3 flat clusters, different labelings, isomorphic)" a = [1, 2, 3] b = [1, 3, 2] - self.failUnless(is_isomorphic(a, b) == True) - self.failUnless(is_isomorphic(b, a) == True) + self.assertTrue(is_isomorphic(a, b) == True) + self.assertTrue(is_isomorphic(b, a) == True) def test_is_isomorphic_4B(self): "Tests is_isomorphic on test case #4B (3 flat clusters, different labelings, nonisomorphic)" a = [1, 2, 3, 3] b = [1, 3, 2, 3] - self.failUnless(is_isomorphic(a, b) == False) - self.failUnless(is_isomorphic(b, a) == False) + self.assertTrue(is_isomorphic(a, b) == False) + self.assertTrue(is_isomorphic(b, a) == False) def test_is_isomorphic_4C(self): "Tests is_isomorphic on test case #4C (3 flat clusters, different labelings, isomorphic)" a = [7, 2, 3] b = [6, 3, 2] - self.failUnless(is_isomorphic(a, b) == True) - self.failUnless(is_isomorphic(b, a) == True) + self.assertTrue(is_isomorphic(a, b) == True) + self.assertTrue(is_isomorphic(b, a) == True) def test_is_isomorphic_5A(self): "Tests is_isomorphic on test case #5A (1000 observations, 2 random clusters, random permutation of the labeling). Run 3 times." @@ -537,8 +537,8 @@ Q = np.random.permutation(nobs) b[Q[0:nerrors]] += 1 b[Q[0:nerrors]] %= nclusters - self.failUnless(is_isomorphic(a, b) == (not noniso)) - self.failUnless(is_isomorphic(b, a) == (not noniso)) + self.assertTrue(is_isomorphic(a, b) == (not noniso)) + self.assertTrue(is_isomorphic(b, a) == (not noniso)) class TestIsValidLinkage(TestCase): @@ -546,46 +546,46 @@ "Tests is_valid_linkage(Z) with integer type." Z = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.int) - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(TypeError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(TypeError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_5_columns(self): "Tests is_valid_linkage(Z) with 5 columns." Z = np.asarray([[0, 1, 3.0, 2, 5], [3, 2, 4.0, 3, 3]], dtype=np.double) - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_3_columns(self): "Tests is_valid_linkage(Z) with 3 columns." Z = np.asarray([[0, 1, 3.0], [3, 2, 4.0]], dtype=np.double) - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_empty(self): "Tests is_valid_linkage(Z) with empty linkage." Z = np.zeros((0, 4), dtype=np.double) - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_1x4(self): "Tests is_valid_linkage(Z) on linkage over 2 observations." Z = np.asarray([[0, 1, 3.0, 2]], dtype=np.double) - self.failUnless(is_valid_linkage(Z) == True) + self.assertTrue(is_valid_linkage(Z) == True) def test_is_valid_linkage_2x4(self): "Tests is_valid_linkage(Z) on linkage over 3 observations." Z = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.double) - self.failUnless(is_valid_linkage(Z) == True) + self.assertTrue(is_valid_linkage(Z) == True) def test_is_valid_linkage_4_and_up(self): "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3)." for i in xrange(4, 15, 3): y = np.random.rand(i*(i-1)/2) Z = linkage(y) - self.failUnless(is_valid_linkage(Z) == True) + self.assertTrue(is_valid_linkage(Z) == True) def test_is_valid_linkage_4_and_up_neg_index_left(self): "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative indices (left)." @@ -593,8 +593,8 @@ y = np.random.rand(i*(i-1)/2) Z = linkage(y) Z[int(i/2),0] = -2 - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_4_and_up_neg_index_right(self): "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative indices (right)." @@ -602,8 +602,8 @@ y = np.random.rand(i*(i-1)/2) Z = linkage(y) Z[int(i/2),1] = -2 - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_4_and_up_neg_dist(self): "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative distances." @@ -611,8 +611,8 @@ y = np.random.rand(i*(i-1)/2) Z = linkage(y) Z[int(i/2),2] = -0.5 - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) def test_is_valid_linkage_4_and_up_neg_counts(self): "Tests is_valid_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3) with negative counts." @@ -620,8 +620,8 @@ y = np.random.rand(i*(i-1)/2) Z = linkage(y) Z[int(i/2),3] = -2 - self.failUnless(is_valid_linkage(Z) == False) - self.failUnlessRaises(ValueError, is_valid_linkage, Z, throw=True) + self.assertTrue(is_valid_linkage(Z) == False) + self.assertRaises(ValueError, is_valid_linkage, Z, throw=True) class TestIsValidInconsistent(TestCase): @@ -629,39 +629,39 @@ "Tests is_valid_im(R) with integer type." R = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.int) - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(TypeError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(TypeError, is_valid_im, R, throw=True) def test_is_valid_im_5_columns(self): "Tests is_valid_im(R) with 5 columns." R = np.asarray([[0, 1, 3.0, 2, 5], [3, 2, 4.0, 3, 3]], dtype=np.double) - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) def test_is_valid_im_3_columns(self): "Tests is_valid_im(R) with 3 columns." R = np.asarray([[0, 1, 3.0], [3, 2, 4.0]], dtype=np.double) - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) def test_is_valid_im_empty(self): "Tests is_valid_im(R) with empty inconsistency matrix." R = np.zeros((0, 4), dtype=np.double) - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) def test_is_valid_im_1x4(self): "Tests is_valid_im(R) on im over 2 observations." R = np.asarray([[0, 1, 3.0, 2]], dtype=np.double) - self.failUnless(is_valid_im(R) == True) + self.assertTrue(is_valid_im(R) == True) def test_is_valid_im_2x4(self): "Tests is_valid_im(R) on im over 3 observations." R = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.double) - self.failUnless(is_valid_im(R) == True) + self.assertTrue(is_valid_im(R) == True) def test_is_valid_im_4_and_up(self): "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3)." @@ -669,7 +669,7 @@ y = np.random.rand(i*(i-1)/2) Z = linkage(y) R = inconsistent(Z) - self.failUnless(is_valid_im(R) == True) + self.assertTrue(is_valid_im(R) == True) def test_is_valid_im_4_and_up_neg_index_left(self): "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link height means." @@ -678,8 +678,8 @@ Z = linkage(y) R = inconsistent(Z) R[int(i/2),0] = -2.0 - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) def test_is_valid_im_4_and_up_neg_index_right(self): "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link height standard deviations." @@ -688,8 +688,8 @@ Z = linkage(y) R = inconsistent(Z) R[int(i/2),1] = -2.0 - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) def test_is_valid_im_4_and_up_neg_dist(self): "Tests is_valid_im(R) on im on observation sets between sizes 4 and 15 (step size 3) with negative link counts." @@ -698,33 +698,33 @@ Z = linkage(y) R = inconsistent(Z) R[int(i/2),2] = -0.5 - self.failUnless(is_valid_im(R) == False) - self.failUnlessRaises(ValueError, is_valid_im, R, throw=True) + self.assertTrue(is_valid_im(R) == False) + self.assertRaises(ValueError, is_valid_im, R, throw=True) class TestNumObsLinkage(TestCase): def test_num_obs_linkage_empty(self): "Tests num_obs_linkage(Z) with empty linkage." Z = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, num_obs_linkage, Z) + self.assertRaises(ValueError, num_obs_linkage, Z) def test_num_obs_linkage_1x4(self): "Tests num_obs_linkage(Z) on linkage over 2 observations." Z = np.asarray([[0, 1, 3.0, 2]], dtype=np.double) - self.failUnless(num_obs_linkage(Z) == 2) + self.assertTrue(num_obs_linkage(Z) == 2) def test_num_obs_linkage_2x4(self): "Tests num_obs_linkage(Z) on linkage over 3 observations." Z = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.double) - self.failUnless(num_obs_linkage(Z) == 3) + self.assertTrue(num_obs_linkage(Z) == 3) def test_num_obs_linkage_4_and_up(self): "Tests num_obs_linkage(Z) on linkage on observation sets between sizes 4 and 15 (step size 3)." for i in xrange(4, 15, 3): y = np.random.rand(i*(i-1)/2) Z = linkage(y) - self.failUnless(num_obs_linkage(Z) == i) + self.assertTrue(num_obs_linkage(Z) == i) class TestLeavesList(TestCase): @@ -732,14 +732,14 @@ "Tests leaves_list(Z) on a 1x4 linkage." Z = np.asarray([[0, 1, 3.0, 2]], dtype=np.double) node = to_tree(Z) - self.failUnless((leaves_list(Z) == [0, 1]).all()) + self.assertTrue((leaves_list(Z) == [0, 1]).all()) def test_leaves_list_2x4(self): "Tests leaves_list(Z) on a 2x4 linkage." Z = np.asarray([[0, 1, 3.0, 2], [3, 2, 4.0, 3]], dtype=np.double) node = to_tree(Z) - self.failUnless((leaves_list(Z) == [0, 1, 2]).all()) + self.assertTrue((leaves_list(Z) == [0, 1, 2]).all()) def test_leaves_list_iris_single(self): "Tests leaves_list(Z) on the Iris data set using single linkage." @@ -747,7 +747,7 @@ Y = pdist(X) Z = linkage(X, 'single') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) def test_leaves_list_iris_complete(self): "Tests leaves_list(Z) on the Iris data set using complete linkage." @@ -755,7 +755,7 @@ Y = pdist(X) Z = linkage(X, 'complete') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) def test_leaves_list_iris_centroid(self): "Tests leaves_list(Z) on the Iris data set using centroid linkage." @@ -763,7 +763,7 @@ Y = pdist(X) Z = linkage(X, 'centroid') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) def test_leaves_list_iris_median(self): "Tests leaves_list(Z) on the Iris data set using median linkage." @@ -771,7 +771,7 @@ Y = pdist(X) Z = linkage(X, 'median') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) def test_leaves_list_iris_ward(self): "Tests leaves_list(Z) on the Iris data set using ward linkage." @@ -779,7 +779,7 @@ Y = pdist(X) Z = linkage(X, 'ward') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) def test_leaves_list_iris_average(self): "Tests leaves_list(Z) on the Iris data set using average linkage." @@ -787,7 +787,7 @@ Y = pdist(X) Z = linkage(X, 'average') node = to_tree(Z) - self.failUnless((node.pre_order() == leaves_list(Z)).all()) + self.assertTrue((node.pre_order() == leaves_list(Z)).all()) class TestCorrespond(TestCase): @@ -795,18 +795,18 @@ "Tests correspond(Z, y) with empty linkage and condensed distance matrix." y = np.zeros((0,)) Z = np.zeros((0,4)) - self.failUnlessRaises(ValueError, correspond, Z, y) + self.assertRaises(ValueError, correspond, Z, y) def test_correspond_2_and_up(self): "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes." for i in xrange(2, 4): y = np.random.rand(i*(i-1)/2) Z = linkage(y) - self.failUnless(correspond(Z, y)) + self.assertTrue(correspond(Z, y)) for i in xrange(4, 15, 3): y = np.random.rand(i*(i-1)/2) Z = linkage(y) - self.failUnless(correspond(Z, y)) + self.assertTrue(correspond(Z, y)) def test_correspond_4_and_up(self): "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes. Correspondance should be false." @@ -815,8 +815,8 @@ y2 = np.random.rand(j*(j-1)/2) Z = linkage(y) Z2 = linkage(y2) - self.failUnless(correspond(Z, y2) == False) - self.failUnless(correspond(Z2, y) == False) + self.assertTrue(correspond(Z, y2) == False) + self.assertTrue(correspond(Z2, y) == False) def test_correspond_4_and_up_2(self): "Tests correspond(Z, y) on linkage and CDMs over observation sets of different sizes. Correspondance should be false." @@ -825,8 +825,8 @@ y2 = np.random.rand(j*(j-1)/2) Z = linkage(y) Z2 = linkage(y2) - self.failUnless(correspond(Z, y2) == False) - self.failUnless(correspond(Z2, y) == False) + self.assertTrue(correspond(Z, y2) == False) + self.assertTrue(correspond(Z2, y) == False) def test_num_obs_linkage_multi_matrix(self): "Tests num_obs_linkage with observation matrices of multiple sizes." @@ -836,84 +836,84 @@ Z = linkage(Y) #print Z #print A.shape, Y.shape, Yr.shape - self.failUnless(num_obs_linkage(Z) == n) + self.assertTrue(num_obs_linkage(Z) == n) class TestIsMonotonic(TestCase): def test_is_monotonic_empty(self): "Tests is_monotonic(Z) on an empty linkage." Z = np.zeros((0, 4)) - self.failUnlessRaises(ValueError, is_monotonic, Z) + self.assertRaises(ValueError, is_monotonic, Z) def test_is_monotonic_1x4(self): "Tests is_monotonic(Z) on 1x4 linkage. Expecting True." Z = np.asarray([[0, 1, 0.3, 2]], dtype=np.double); - self.failUnless(is_monotonic(Z) == True) + self.assertTrue(is_monotonic(Z) == True) def test_is_monotonic_2x4_T(self): "Tests is_monotonic(Z) on 2x4 linkage. Expecting True." Z = np.asarray([[0, 1, 0.3, 2], [2, 3, 0.4, 3]], dtype=np.double) - self.failUnless(is_monotonic(Z) == True) + self.assertTrue(is_monotonic(Z) == True) def test_is_monotonic_2x4_F(self): "Tests is_monotonic(Z) on 2x4 linkage. Expecting False." Z = np.asarray([[0, 1, 0.4, 2], [2, 3, 0.3, 3]], dtype=np.double) - self.failUnless(is_monotonic(Z) == False) + self.assertTrue(is_monotonic(Z) == False) def test_is_monotonic_3x4_T(self): "Tests is_monotonic(Z) on 3x4 linkage. Expecting True." Z = np.asarray([[0, 1, 0.3, 2], [2, 3, 0.4, 2], [4, 5, 0.6, 4]], dtype=np.double) - self.failUnless(is_monotonic(Z) == True) + self.assertTrue(is_monotonic(Z) == True) def test_is_monotonic_3x4_F1(self): "Tests is_monotonic(Z) on 3x4 linkage (case 1). Expecting False." Z = np.asarray([[0, 1, 0.3, 2], [2, 3, 0.2, 2], [4, 5, 0.6, 4]], dtype=np.double) - self.failUnless(is_monotonic(Z) == False) + self.assertTrue(is_monotonic(Z) == False) def test_is_monotonic_3x4_F2(self): "Tests is_monotonic(Z) on 3x4 linkage (case 2). Expecting False." Z = np.asarray([[0, 1, 0.8, 2], [2, 3, 0.4, 2], [4, 5, 0.6, 4]], dtype=np.double) - self.failUnless(is_monotonic(Z) == False) + self.assertTrue(is_monotonic(Z) == False) def test_is_monotonic_3x4_F3(self): "Tests is_monotonic(Z) on 3x4 linkage (case 3). Expecting False" Z = np.asarray([[0, 1, 0.3, 2], [2, 3, 0.4, 2], [4, 5, 0.2, 4]], dtype=np.double) - self.failUnless(is_monotonic(Z) == False) + self.assertTrue(is_monotonic(Z) == False) def test_is_monotonic_tdist_linkage(self): "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Expecting True." Z = linkage(_ytdist, 'single') - self.failUnless(is_monotonic(Z) == True) + self.assertTrue(is_monotonic(Z) == True) def test_is_monotonic_tdist_linkage(self): "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Perturbing. Expecting False." Z = linkage(_ytdist, 'single') Z[2,2]=0.0 - self.failUnless(is_monotonic(Z) == False) + self.assertTrue(is_monotonic(Z) == False) def test_is_monotonic_iris_linkage(self): "Tests is_monotonic(Z) on clustering generated by single linkage on Iris data set. Expecting True." X = eo['iris'] Y = pdist(X) Z = linkage(X, 'single') - self.failUnless(is_monotonic(Z) == True) + self.assertTrue(is_monotonic(Z) == True) class TestMaxDists(TestCase): def test_maxdists_empty_linkage(self): "Tests maxdists(Z) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxdists, Z) + self.assertRaises(ValueError, maxdists, Z) def test_maxdists_one_cluster_linkage(self): "Tests maxdists(Z) on linkage with one cluster." @@ -921,7 +921,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxdists_Q_linkage_single(self): "Tests maxdists(Z) on the Q data set using single linkage." @@ -931,7 +931,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxdists_Q_linkage_complete(self): "Tests maxdists(Z) on the Q data set using complete linkage." @@ -941,7 +941,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxdists_Q_linkage_ward(self): "Tests maxdists(Z) on the Q data set using Ward linkage." @@ -951,7 +951,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxdists_Q_linkage_centroid(self): "Tests maxdists(Z) on the Q data set using centroid linkage." @@ -961,7 +961,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxdists_Q_linkage_median(self): "Tests maxdists(Z) on the Q data set using median linkage." @@ -971,7 +971,7 @@ MD = maxdists(Z) eps = 1e-15 expectedMD = calculate_maximum_distances(Z) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) class TestMaxInconsts(TestCase): @@ -979,13 +979,13 @@ "Tests maxinconsts(Z, R) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) R = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxinconsts, Z, R) + self.assertRaises(ValueError, maxinconsts, Z, R) def test_maxinconsts_difrow_linkage(self): "Tests maxinconsts(Z, R) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.random.rand(2, 4) - self.failUnlessRaises(ValueError, maxinconsts, Z, R) + self.assertRaises(ValueError, maxinconsts, Z, R) def test_maxinconsts_one_cluster_linkage(self): "Tests maxinconsts(Z, R) on linkage with one cluster." @@ -994,7 +994,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxinconsts_Q_linkage_single(self): "Tests maxinconsts(Z, R) on the Q data set using single linkage." @@ -1005,7 +1005,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxinconsts_Q_linkage_complete(self): "Tests maxinconsts(Z, R) on the Q data set using complete linkage." @@ -1016,7 +1016,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxinconsts_Q_linkage_ward(self): "Tests maxinconsts(Z, R) on the Q data set using Ward linkage." @@ -1027,7 +1027,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxinconsts_Q_linkage_centroid(self): "Tests maxinconsts(Z, R) on the Q data set using centroid linkage." @@ -1038,7 +1038,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxinconsts_Q_linkage_median(self): "Tests maxinconsts(Z, R) on the Q data set using median linkage." @@ -1049,7 +1049,7 @@ MD = maxinconsts(Z, R) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) class TestMaxRStat(TestCase): @@ -1057,31 +1057,31 @@ "Tests maxRstat(Z, R, 3.3). Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double) - self.failUnlessRaises(TypeError, maxRstat, Z, R, 3.3) + self.assertRaises(TypeError, maxRstat, Z, R, 3.3) def test_maxRstat_neg_index(self): "Tests maxRstat(Z, R, -1). Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, -1) + self.assertRaises(ValueError, maxRstat, Z, R, -1) def test_maxRstat_oob_pos_index(self): "Tests maxRstat(Z, R, 4). Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.asarray([[0, 0, 0, 0.3]], dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 4) + self.assertRaises(ValueError, maxRstat, Z, R, 4) def test_maxRstat_0_empty_linkage(self): "Tests maxRstat(Z, R, 0) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) R = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 0) + self.assertRaises(ValueError, maxRstat, Z, R, 0) def test_maxRstat_0_difrow_linkage(self): "Tests maxRstat(Z, R, 0) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.random.rand(2, 4) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 0) + self.assertRaises(ValueError, maxRstat, Z, R, 0) def test_maxRstat_0_one_cluster_linkage(self): "Tests maxRstat(Z, R, 0) on linkage with one cluster." @@ -1090,7 +1090,7 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_0_Q_linkage_single(self): "Tests maxRstat(Z, R, 0) on the Q data set using single linkage." @@ -1101,7 +1101,7 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_0_Q_linkage_complete(self): "Tests maxRstat(Z, R, 0) on the Q data set using complete linkage." @@ -1112,7 +1112,7 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_0_Q_linkage_ward(self): "Tests maxRstat(Z, R, 0) on the Q data set using Ward linkage." @@ -1123,7 +1123,7 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_0_Q_linkage_centroid(self): "Tests maxRstat(Z, R, 0) on the Q data set using centroid linkage." @@ -1134,7 +1134,7 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_0_Q_linkage_median(self): "Tests maxRstat(Z, R, 0) on the Q data set using median linkage." @@ -1145,19 +1145,19 @@ MD = maxRstat(Z, R, 0) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 0) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_empty_linkage(self): "Tests maxRstat(Z, R, 1) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) R = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 0) + self.assertRaises(ValueError, maxRstat, Z, R, 0) def test_maxRstat_1_difrow_linkage(self): "Tests maxRstat(Z, R, 1) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.random.rand(2, 4) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 0) + self.assertRaises(ValueError, maxRstat, Z, R, 0) def test_maxRstat_1_one_cluster_linkage(self): "Tests maxRstat(Z, R, 1) on linkage with one cluster." @@ -1166,7 +1166,7 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_Q_linkage_single(self): "Tests maxRstat(Z, R, 1) on the Q data set using single linkage." @@ -1177,7 +1177,7 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_Q_linkage_complete(self): "Tests maxRstat(Z, R, 1) on the Q data set using complete linkage." @@ -1188,7 +1188,7 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_Q_linkage_ward(self): "Tests maxRstat(Z, R, 1) on the Q data set using Ward linkage." @@ -1199,7 +1199,7 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_Q_linkage_centroid(self): "Tests maxRstat(Z, R, 1) on the Q data set using centroid linkage." @@ -1210,7 +1210,7 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_1_Q_linkage_median(self): "Tests maxRstat(Z, R, 1) on the Q data set using median linkage." @@ -1221,19 +1221,19 @@ MD = maxRstat(Z, R, 1) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 1) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_empty_linkage(self): "Tests maxRstat(Z, R, 2) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) R = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 2) + self.assertRaises(ValueError, maxRstat, Z, R, 2) def test_maxRstat_2_difrow_linkage(self): "Tests maxRstat(Z, R, 2) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.random.rand(2, 4) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 2) + self.assertRaises(ValueError, maxRstat, Z, R, 2) def test_maxRstat_2_one_cluster_linkage(self): "Tests maxRstat(Z, R, 2) on linkage with one cluster." @@ -1242,7 +1242,7 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_Q_linkage_single(self): "Tests maxRstat(Z, R, 2) on the Q data set using single linkage." @@ -1253,7 +1253,7 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_Q_linkage_complete(self): "Tests maxRstat(Z, R, 2) on the Q data set using complete linkage." @@ -1264,7 +1264,7 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_Q_linkage_ward(self): "Tests maxRstat(Z, R, 2) on the Q data set using Ward linkage." @@ -1275,7 +1275,7 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_Q_linkage_centroid(self): "Tests maxRstat(Z, R, 2) on the Q data set using centroid linkage." @@ -1286,7 +1286,7 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_2_Q_linkage_median(self): "Tests maxRstat(Z, R, 2) on the Q data set using median linkage." @@ -1297,19 +1297,19 @@ MD = maxRstat(Z, R, 2) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 2) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_empty_linkage(self): "Tests maxRstat(Z, R, 3) on empty linkage. Expecting exception." Z = np.zeros((0, 4), dtype=np.double) R = np.zeros((0, 4), dtype=np.double) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 3) + self.assertRaises(ValueError, maxRstat, Z, R, 3) def test_maxRstat_3_difrow_linkage(self): "Tests maxRstat(Z, R, 3) on linkage and inconsistency matrices with different numbers of clusters. Expecting exception." Z = np.asarray([[0, 1, 0.3, 4]], dtype=np.double) R = np.random.rand(2, 4) - self.failUnlessRaises(ValueError, maxRstat, Z, R, 3) + self.assertRaises(ValueError, maxRstat, Z, R, 3) def test_maxRstat_3_one_cluster_linkage(self): "Tests maxRstat(Z, R, 3) on linkage with one cluster." @@ -1318,7 +1318,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_Q_linkage_single(self): "Tests maxRstat(Z, R, 3) on the Q data set using single linkage." @@ -1329,7 +1329,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_Q_linkage_complete(self): "Tests maxRstat(Z, R, 3) on the Q data set using complete linkage." @@ -1340,7 +1340,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_Q_linkage_ward(self): "Tests maxRstat(Z, R, 3) on the Q data set using Ward linkage." @@ -1351,7 +1351,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_Q_linkage_centroid(self): "Tests maxRstat(Z, R, 3) on the Q data set using centroid linkage." @@ -1362,7 +1362,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def test_maxRstat_3_Q_linkage_median(self): "Tests maxRstat(Z, R, 3) on the Q data set using median linkage." @@ -1373,7 +1373,7 @@ MD = maxRstat(Z, R, 3) eps = 1e-15 expectedMD = calculate_maximum_inconsistencies(Z, R, 3) - self.failUnless(within_tol(MD, expectedMD, eps)) + self.assertTrue(within_tol(MD, expectedMD, eps)) def calculate_maximum_distances(Z): "Used for testing correctness of maxdists. Very slow." Modified: trunk/scipy/fftpack/tests/test_basic.py =================================================================== --- trunk/scipy/fftpack/tests/test_basic.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/fftpack/tests/test_basic.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -99,7 +99,7 @@ def test_definition(self): x = np.array([1,2,3,4+1j,1,2,3,4+2j], dtype = self.cdt) y = fft(x) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) y1 = direct_dft(x) assert_array_almost_equal(y,y1) @@ -110,7 +110,7 @@ x1 = np.array([1,2,3,4], dtype=self.rdt) x2 = np.array([1,2,3,4], dtype=self.rdt) y = fft([x1,x2],n=4) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) assert_equal(y.shape,(2,4)) assert_array_almost_equal(y[0],direct_dft(x1)) @@ -120,7 +120,7 @@ x1 = np.array([1,2,3,4+1j], dtype=self.cdt) x2 = np.array([1,2,3,4+1j], dtype=self.cdt) y = fft([x1,x2],n=4) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) assert_equal(y.shape,(2,4)) assert_array_almost_equal(y[0],direct_dft(x1)) @@ -155,7 +155,7 @@ x = np.array([1,2,3,4+1j,1,2,3,4+2j], self.cdt) y = ifft(x) y1 = direct_idft(x) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) assert_array_almost_equal(y,y1) @@ -165,13 +165,13 @@ def test_definition_real(self): x = np.array([1,2,3,4,1,2,3,4], self.rdt) y = ifft(x) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) y1 = direct_idft(x) assert_array_almost_equal(y,y1) x = np.array([1,2,3,4,5], dtype=self.rdt) - self.failUnless(y.dtype == self.cdt, + self.assertTrue(y.dtype == self.cdt, "Output dtype is %s, expected %s" % (y.dtype, self.cdt)) assert_array_almost_equal(ifft(x),direct_idft(x)) @@ -191,9 +191,9 @@ x = random([size]).astype(self.cdt) +1j*x y1 = ifft(fft(x)) y2 = fft(ifft(x)) - self.failUnless(y1.dtype == self.cdt, + self.assertTrue(y1.dtype == self.cdt, "Output dtype is %s, expected %s" % (y1.dtype, self.cdt)) - self.failUnless(y2.dtype == self.cdt, + self.assertTrue(y2.dtype == self.cdt, "Output dtype is %s, expected %s" % (y2.dtype, self.cdt)) assert_array_almost_equal (y1, x) assert_array_almost_equal (y2, x) @@ -203,9 +203,9 @@ x = random([size]).astype(self.rdt) y1 = ifft(fft(x)) y2 = fft(ifft(x)) - self.failUnless(y1.dtype == self.cdt, + self.assertTrue(y1.dtype == self.cdt, "Output dtype is %s, expected %s" % (y1.dtype, self.cdt)) - self.failUnless(y2.dtype == self.cdt, + self.assertTrue(y2.dtype == self.cdt, "Output dtype is %s, expected %s" % (y2.dtype, self.cdt)) assert_array_almost_equal (y1, x) assert_array_almost_equal (y2, x) @@ -230,7 +230,7 @@ y = rfft(x) y1 = direct_rdft(x) assert_array_almost_equal(y,y1) - self.failUnless(y.dtype == self.rdt, + self.assertTrue(y.dtype == self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt)) def test_djbfft(self): @@ -271,7 +271,7 @@ def _test(x, xr): y = irfft(np.array(x, dtype=self.rdt)) y1 = direct_irdft(x) - self.failUnless(y.dtype == self.rdt, + self.assertTrue(y.dtype == self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt)) assert_array_almost_equal(y,y1, decimal=self.ndec) assert_array_almost_equal(y,ifft(xr), decimal=self.ndec) @@ -299,9 +299,9 @@ x = random([size]).astype(self.rdt) y1 = irfft(rfft(x)) y2 = rfft(irfft(x)) - self.failUnless(y1.dtype == self.rdt, + self.assertTrue(y1.dtype == self.rdt, "Output dtype is %s, expected %s" % (y1.dtype, self.rdt)) - self.failUnless(y2.dtype == self.rdt, + self.assertTrue(y2.dtype == self.rdt, "Output dtype is %s, expected %s" % (y2.dtype, self.rdt)) assert_array_almost_equal (y1, x, decimal=self.ndec) assert_array_almost_equal (y2, x, decimal=self.ndec) Modified: trunk/scipy/fftpack/tests/test_real_transforms.py =================================================================== --- trunk/scipy/fftpack/tests/test_real_transforms.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/fftpack/tests/test_real_transforms.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -42,7 +42,7 @@ for i in FFTWDATA_SIZES: x, yr = fftw_ref(self.type, i, self.rdt) y = dct(x, type=self.type) - self.failUnless(y.dtype == self.rdt, + self.assertTrue(y.dtype == self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt)) # XXX: we divide by np.max(y) because the tests fail otherwise. We # should really use something like assert_array_approx_equal. The @@ -73,7 +73,7 @@ x = np.array(X[i], dtype=self.rdt) yr = Y[i] y = dct(x, norm="ortho", type=2) - self.failUnless(y.dtype == self.rdt, + self.assertTrue(y.dtype == self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt)) assert_array_almost_equal(y, yr, decimal=self.dec) @@ -84,7 +84,7 @@ x = np.array(X[i], dtype=self.rdt) y = dct(x, norm='ortho', type=2) xi = dct(y, norm="ortho", type=3) - self.failUnless(xi.dtype == self.rdt, + self.assertTrue(xi.dtype == self.rdt, "Output dtype is %s, expected %s" % (xi.dtype, self.rdt)) assert_array_almost_equal(xi, x, decimal=self.dec) @@ -139,7 +139,7 @@ x /= 2 * (i-1) else: x /= 2 * i - self.failUnless(x.dtype == self.rdt, + self.assertTrue(x.dtype == self.rdt, "Output dtype is %s, expected %s" % (x.dtype, self.rdt)) # XXX: we divide by np.max(y) because the tests fail otherwise. We # should really use something like assert_array_approx_equal. The Modified: trunk/scipy/linalg/tests/test_build.py =================================================================== --- trunk/scipy/linalg/tests/test_build.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/linalg/tests/test_build.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -45,7 +45,7 @@ f = FindDependenciesLdd() deps = f.grep_dependencies(flapack.__file__, ['libg2c', 'libgfortran']) - self.failIf(len(deps) > 1, + self.assertFalse(len(deps) > 1, """Both g77 and gfortran runtimes linked in scipy.linalg.flapack ! This is likely to cause random crashes and wrong results. See numpy INSTALL.txt for more information.""") Modified: trunk/scipy/ndimage/tests/test_ndimage.py =================================================================== --- trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/ndimage/tests/test_ndimage.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -79,26 +79,26 @@ weights = numpy.array([2]) true = [2, 4] output = ndimage.correlate(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate02(self): "correlation 2" array = numpy.array([1, 2, 3]) kernel = numpy.array([1]) output = ndimage.correlate(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.correlate1d(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.convolve1d(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_correlate03(self): "correlation 3" @@ -106,13 +106,13 @@ weights = numpy.array([1, 1]) true = [2] output = ndimage.correlate(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate04(self): "correlation 4" @@ -121,13 +121,13 @@ tcov = [3, 4] weights = numpy.array([1, 1]) output = ndimage.correlate(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) def test_correlate05(self): "correlation 5" @@ -136,13 +136,13 @@ tcov = [3, 5, 6] kernel = numpy.array([1, 1]) output = ndimage.correlate(array, kernel) - self.failUnless(diff(tcor, output) < eps) + self.assertTrue(diff(tcor, output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff(tcov, output) < eps) + self.assertTrue(diff(tcov, output) < eps) output = ndimage.correlate1d(array, kernel) - self.failUnless(diff(tcor, output) < eps) + self.assertTrue(diff(tcor, output) < eps) output = ndimage.convolve1d(array, kernel) - self.failUnless(diff(tcov, output) < eps) + self.assertTrue(diff(tcov, output) < eps) def test_correlate06(self): "correlation 6" @@ -151,13 +151,13 @@ tcov = [7, 10, 15] weights = numpy.array([1, 2, 3]) output = ndimage.correlate(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) def test_correlate07(self): "correlation 7" @@ -165,13 +165,13 @@ true = [5, 8, 11] weights = numpy.array([1, 2, 1]) output = ndimage.correlate(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate08(self): "correlation 8" @@ -180,35 +180,35 @@ tcov = [3, 6, 7] weights = numpy.array([1, 2, -1]) output = ndimage.correlate(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) output = ndimage.correlate1d(array, weights) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) output = ndimage.convolve1d(array, weights) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) def test_correlate09(self): "correlation 9" array = [] kernel = numpy.array([1, 1]) output = ndimage.correlate(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.correlate1d(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.convolve1d(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_correlate10(self): "correlation 10" array = [[]] kernel = numpy.array([[1, 1]]) output = ndimage.correlate(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_correlate11(self): "correlation 11" @@ -217,9 +217,9 @@ kernel = numpy.array([[1, 1], [1, 1]]) output = ndimage.correlate(array, kernel) - self.failUnless(diff([[4, 6, 10], [10, 12, 16]], output) < eps) + self.assertTrue(diff([[4, 6, 10], [10, 12, 16]], output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff([[12, 16, 18], [18, 22, 24]], output) < eps) + self.assertTrue(diff([[12, 16, 18], [18, 22, 24]], output) < eps) def test_correlate12(self): "correlation 12" @@ -228,9 +228,9 @@ kernel = numpy.array([[1, 0], [0, 1]]) output = ndimage.correlate(array, kernel) - self.failUnless(diff([[2, 3, 5], [5, 6, 8]], output) < eps) + self.assertTrue(diff([[2, 3, 5], [5, 6, 8]], output) < eps) output = ndimage.convolve(array, kernel) - self.failUnless(diff([[6, 8, 9], [9, 11, 12]], output) < eps) + self.assertTrue(diff([[6, 8, 9], [9, 11, 12]], output) < eps) def test_correlate13(self): "correlation 13" @@ -243,11 +243,11 @@ output = ndimage.correlate(array, kernel, output = type2) error = diff([[2, 3, 5], [5, 6, 8]], output) - self.failUnless(error < eps and output.dtype.type == type2) + self.assertTrue(error < eps and output.dtype.type == type2) output = ndimage.convolve(array, kernel, output = type2) error = diff([[6, 8, 9], [9, 11, 12]], output) - self.failUnless(error < eps and output.dtype.type == type2) + self.assertTrue(error < eps and output.dtype.type == type2) def test_correlate14(self): "correlation 14" @@ -261,10 +261,10 @@ ndimage.correlate(array, kernel, output = output) error = diff([[2, 3, 5], [5, 6, 8]], output) - self.failUnless(error < eps and output.dtype.type == type2) + self.assertTrue(error < eps and output.dtype.type == type2) ndimage.convolve(array, kernel, output = output) error = diff([[6, 8, 9], [9, 11, 12]], output) - self.failUnless(error < eps and output.dtype.type == type2) + self.assertTrue(error < eps and output.dtype.type == type2) def test_correlate15(self): "correlation 15" @@ -276,12 +276,12 @@ output = ndimage.correlate(array, kernel, output = numpy.float32) error = diff([[2, 3, 5], [5, 6, 8]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) output = ndimage.convolve(array, kernel, output = numpy.float32) error = diff([[6, 8, 9], [9, 11, 12]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) def test_correlate16(self): @@ -294,12 +294,12 @@ output = ndimage.correlate(array, kernel, output = numpy.float32) error = diff([[1, 1.5, 2.5], [2.5, 3, 4]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) output = ndimage.convolve(array, kernel, output = numpy.float32) error = diff([[3, 4, 4.5], [4.5, 5.5, 6]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) def test_correlate17(self): @@ -309,13 +309,13 @@ tcov = [2, 3, 5] kernel = numpy.array([1, 1]) output = ndimage.correlate(array, kernel, origin = -1) - self.failUnless(diff(tcor, output) < eps) + self.assertTrue(diff(tcor, output) < eps) output = ndimage.convolve(array, kernel, origin = -1) - self.failUnless(diff(tcov, output) < eps) + self.assertTrue(diff(tcov, output) < eps) output = ndimage.correlate1d(array, kernel, origin = -1) - self.failUnless(diff(tcor, output) < eps) + self.assertTrue(diff(tcor, output) < eps) output = ndimage.convolve1d(array, kernel, origin = -1) - self.failUnless(diff(tcov, output) < eps) + self.assertTrue(diff(tcov, output) < eps) def test_correlate18(self): "correlation 18" @@ -328,12 +328,12 @@ output = numpy.float32, mode = 'nearest', origin = -1) error = diff([[6, 8, 9], [9, 11, 12]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) output = ndimage.convolve(array, kernel, output = numpy.float32, mode = 'nearest', origin = -1) error = diff([[2, 3, 5], [5, 6, 8]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) def test_correlate19(self): @@ -347,13 +347,13 @@ output = numpy.float32, mode = 'nearest', origin = [-1, 0]) error = diff([[5, 6, 8], [8, 9, 11]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) output = ndimage.convolve(array, kernel, output = numpy.float32, mode = 'nearest', origin = [-1, 0]) error = diff([[3, 5, 6], [6, 8, 9]], output) - self.failUnless(error < eps and + self.assertTrue(error < eps and output.dtype.type == numpy.float32) def test_correlate20(self): @@ -367,10 +367,10 @@ output = numpy.zeros((2, 3), type2) ndimage.correlate1d(array, weights, axis = 0, output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) ndimage.convolve1d(array, weights, axis = 0, output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate21(self): "correlation 21" @@ -379,9 +379,9 @@ true = [[5, 10, 15], [7, 14, 21]] weights = numpy.array([1, 2, 1]) output = ndimage.correlate1d(array, weights, axis = 0) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) output = ndimage.convolve1d(array, weights, axis = 0) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate22(self): "correlation 22" @@ -394,10 +394,10 @@ output = numpy.zeros((2, 3), type2) ndimage.correlate1d(array, weights, axis = 0, mode = 'wrap', output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) ndimage.convolve1d(array, weights, axis = 0, mode = 'wrap', output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate23(self): "correlation 23" @@ -410,10 +410,10 @@ output = numpy.zeros((2, 3), type2) ndimage.correlate1d(array, weights, axis = 0, mode = 'nearest', output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) ndimage.convolve1d(array, weights, axis = 0, mode = 'nearest', output = output) - self.failUnless(diff(output, true) < eps) + self.assertTrue(diff(output, true) < eps) def test_correlate24(self): "correlation 24" @@ -427,10 +427,10 @@ output = numpy.zeros((2, 3), type2) ndimage.correlate1d(array, weights, axis = 0, mode = 'nearest', output = output, origin = -1) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) ndimage.convolve1d(array, weights, axis = 0, mode = 'nearest', output = output, origin = -1) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) def test_correlate25(self): "correlation 25" @@ -444,24 +444,24 @@ output = numpy.zeros((2, 3), type2) ndimage.correlate1d(array, weights, axis = 0, mode = 'nearest', output = output, origin = 1) - self.failUnless(diff(output, tcor) < eps) + self.assertTrue(diff(output, tcor) < eps) ndimage.convolve1d(array, weights, axis = 0, mode = 'nearest', output = output, origin = 1) - self.failUnless(diff(output, tcov) < eps) + self.assertTrue(diff(output, tcov) < eps) def test_gauss01(self): "gaussian filter 1" input = numpy.array([[1, 2, 3], [2, 4, 6]], numpy.float32) output = ndimage.gaussian_filter(input, 0) - self.failUnless(diff(output, input) < eps) + self.assertTrue(diff(output, input) < eps) def test_gauss02(self): "gaussian filter 2" input = numpy.array([[1, 2, 3], [2, 4, 6]], numpy.float32) output = ndimage.gaussian_filter(input, 1.0) - self.failUnless(input.dtype == output.dtype and + self.assertTrue(input.dtype == output.dtype and input.shape == output.shape) def test_gauss03(self): @@ -470,7 +470,7 @@ input.shape = (100, 100) output = ndimage.gaussian_filter(input, [1.0, 1.0]) - self.failUnless(input.dtype == output.dtype and + self.assertTrue(input.dtype == output.dtype and input.shape == output.shape and output.sum(dtype='d') - input.sum(dtype='d') < eps and diff(input, output) > 1.0) @@ -482,7 +482,7 @@ otype = numpy.float64 output = ndimage.gaussian_filter(input, [1.0, 1.0], output = otype) - self.failUnless(output.dtype.type == numpy.float64 and + self.assertTrue(output.dtype.type == numpy.float64 and input.shape == output.shape and diff(input, output) > 1.0) @@ -493,7 +493,7 @@ otype = numpy.float64 output = ndimage.gaussian_filter(input, [1.0, 1.0], order = 1, output = otype) - self.failUnless(output.dtype.type == numpy.float64 and + self.assertTrue(output.dtype.type == numpy.float64 and input.shape == output.shape and diff(input, output) > 1.0) @@ -506,7 +506,7 @@ output = otype) output2 = ndimage.gaussian_filter(input, 1.0, output = otype) - self.failUnless(diff(output1, output2) < eps) + self.assertTrue(diff(output1, output2) < eps) def test_prewitt01(self): "prewitt filter 1" @@ -517,7 +517,7 @@ t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 0) t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 1) output = ndimage.prewitt(array, 0) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_prewitt02(self): @@ -530,7 +530,7 @@ t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 1) output = numpy.zeros(array.shape, type) ndimage.prewitt(array, 0, output) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_prewitt03(self): "prewitt filter 3" @@ -541,7 +541,7 @@ t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 1) t = ndimage.correlate1d(t, [1.0, 1.0, 1.0], 0) output = ndimage.prewitt(array, 1) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_prewitt04(self): "prewitt filter 4" @@ -551,7 +551,7 @@ [5, 6, 9, 3, 5]], type) t = ndimage.prewitt(array, -1) output = ndimage.prewitt(array, 1) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_sobel01(self): "sobel filter 1" @@ -562,7 +562,7 @@ t = ndimage.correlate1d(array, [-1.0, 0.0, 1.0], 0) t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 1) output = ndimage.sobel(array, 0) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_sobel02(self): "sobel filter 2" @@ -574,7 +574,7 @@ t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 1) output = numpy.zeros(array.shape, type) ndimage.sobel(array, 0, output) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_sobel03(self): "sobel filter 3" @@ -586,7 +586,7 @@ t = ndimage.correlate1d(t, [1.0, 2.0, 1.0], 0) output = numpy.zeros(array.shape, type) output = ndimage.sobel(array, 1) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_sobel04(self): "sobel filter 4" @@ -596,7 +596,7 @@ [5, 6, 9, 3, 5]], type) t = ndimage.sobel(array, -1) output = ndimage.sobel(array, 1) - self.failUnless(diff(t, output) < eps) + self.assertTrue(diff(t, output) < eps) def test_laplace01(self): "laplace filter 1" @@ -607,7 +607,7 @@ tmp1 = ndimage.correlate1d(array, [1, -2, 1], 0) tmp2 = ndimage.correlate1d(array, [1, -2, 1], 1) output = ndimage.laplace(array) - self.failUnless(diff(tmp1 + tmp2, output) < eps) + self.assertTrue(diff(tmp1 + tmp2, output) < eps) def test_laplace02(self): "laplace filter 2" @@ -619,7 +619,7 @@ tmp2 = ndimage.correlate1d(array, [1, -2, 1], 1) output = numpy.zeros(array.shape, type) ndimage.laplace(array, output = output) - self.failUnless(diff(tmp1 + tmp2, output) < eps) + self.assertTrue(diff(tmp1 + tmp2, output) < eps) def test_gaussian_laplace01(self): "gaussian laplace filter 1" @@ -630,7 +630,7 @@ tmp1 = ndimage.gaussian_filter(array, 1.0, [2, 0]) tmp2 = ndimage.gaussian_filter(array, 1.0, [0, 2]) output = ndimage.gaussian_laplace(array, 1.0) - self.failUnless(diff(tmp1 + tmp2, output) < eps) + self.assertTrue(diff(tmp1 + tmp2, output) < eps) def test_gaussian_laplace02(self): "gaussian laplace filter 2" @@ -642,7 +642,7 @@ tmp2 = ndimage.gaussian_filter(array, 1.0, [0, 2]) output = numpy.zeros(array.shape, type) ndimage.gaussian_laplace(array, 1.0, output) - self.failUnless(diff(tmp1 + tmp2, output) < eps) + self.assertTrue(diff(tmp1 + tmp2, output) < eps) def test_generic_laplace01(self): "generic laplace filter 1" @@ -661,7 +661,7 @@ tmp = ndimage.generic_laplace(array, derivative2, extra_arguments = (1.0,), extra_keywords = {'b': 2.0}) ndimage.gaussian_laplace(array, 1.0, output) - self.failUnless(diff(tmp, output) < eps) + self.assertTrue(diff(tmp, output) < eps) def test_gaussian_gradient_magnitude01(self): "gaussian gradient magnitude filter 1" @@ -675,7 +675,7 @@ 1.0) true = tmp1 * tmp1 + tmp2 * tmp2 numpy.sqrt(true, true) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_gaussian_gradient_magnitude02(self): "gaussian gradient magnitude filter 2" @@ -690,7 +690,7 @@ output) true = tmp1 * tmp1 + tmp2 * tmp2 numpy.sqrt(true, true) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_generic_gradient_magnitude01(self): "generic gradient magnitude 1" @@ -708,7 +708,7 @@ tmp2 = ndimage.generic_gradient_magnitude(array, derivative, extra_arguments = (1.0,), extra_keywords = {'b': 2.0}) - self.failUnless(diff(tmp1, tmp2) < eps) + self.assertTrue(diff(tmp1, tmp2) < eps) def test_uniform01(self): "uniform filter 1" @@ -716,35 +716,35 @@ size = 2 output = ndimage.uniform_filter1d(array, size, origin = -1) - self.failUnless(diff([3, 5, 6], output) < eps) + self.assertTrue(diff([3, 5, 6], output) < eps) def test_uniform02(self): "uniform filter 2" array = numpy.array([1, 2, 3]) filter_shape = [0] output = ndimage.uniform_filter(array, filter_shape) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_uniform03(self): "uniform filter 3" array = numpy.array([1, 2, 3]) filter_shape = [1] output = ndimage.uniform_filter(array, filter_shape) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_uniform04(self): "uniform filter 4" array = numpy.array([2, 4, 6]) filter_shape = [2] output = ndimage.uniform_filter(array, filter_shape) - self.failUnless(diff([2, 3, 5], output) < eps) + self.assertTrue(diff([2, 3, 5], output) < eps) def test_uniform05(self): "uniform filter 5" array = [] filter_shape = [1] output = ndimage.uniform_filter(array, filter_shape) - self.failUnless(diff([], output) < eps) + self.assertTrue(diff([], output) < eps) def test_uniform06(self): "uniform filter 6" @@ -756,35 +756,35 @@ output = ndimage.uniform_filter(array, filter_shape, output = type2) error = diff([[4, 6, 10], [10, 12, 16]], output) - self.failUnless(error < eps and output.dtype.type == type2) + self.assertTrue(error < eps and output.dtype.type == type2) def test_minimum_filter01(self): "minimum filter 1" array = numpy.array([1, 2, 3, 4, 5]) filter_shape = numpy.array([2]) output = ndimage.minimum_filter(array, filter_shape) - self.failUnless(diff([1, 1, 2, 3, 4], output) < eps) + self.assertTrue(diff([1, 1, 2, 3, 4], output) < eps) def test_minimum_filter02(self): "minimum filter 2" array = numpy.array([1, 2, 3, 4, 5]) filter_shape = numpy.array([3]) output = ndimage.minimum_filter(array, filter_shape) - self.failUnless(diff([1, 1, 2, 3, 4], output) < eps) + self.assertTrue(diff([1, 1, 2, 3, 4], output) < eps) def test_minimum_filter03(self): "minimum filter 3" array = numpy.array([3, 2, 5, 1, 4]) filter_shape = numpy.array([2]) output = ndimage.minimum_filter(array, filter_shape) - self.failUnless(diff([3, 2, 2, 1, 1], output) < eps) + self.assertTrue(diff([3, 2, 2, 1, 1], output) < eps) def test_minimum_filter04(self): "minimum filter 4" array = numpy.array([3, 2, 5, 1, 4]) filter_shape = numpy.array([3]) output = ndimage.minimum_filter(array, filter_shape) - self.failUnless(diff([2, 2, 1, 1, 1], output) < eps) + self.assertTrue(diff([2, 2, 1, 1, 1], output) < eps) def test_minimum_filter05(self): "minimum filter 5" @@ -793,7 +793,7 @@ [5, 8, 3, 7, 1]]) filter_shape = numpy.array([2, 3]) output = ndimage.minimum_filter(array, filter_shape) - self.failUnless(diff([[2, 2, 1, 1, 1], + self.assertTrue(diff([[2, 2, 1, 1, 1], [2, 2, 1, 1, 1], [5, 3, 3, 1, 1]], output) < eps) @@ -805,7 +805,7 @@ footprint = [[1, 1, 1], [1, 1, 1]] output = ndimage.minimum_filter(array, footprint = footprint) - self.failUnless(diff([[2, 2, 1, 1, 1], + self.assertTrue(diff([[2, 2, 1, 1, 1], [2, 2, 1, 1, 1], [5, 3, 3, 1, 1]], output) < eps) @@ -817,7 +817,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.minimum_filter(array, footprint = footprint) - self.failUnless(diff([[2, 2, 1, 1, 1], + self.assertTrue(diff([[2, 2, 1, 1, 1], [2, 3, 1, 3, 1], [5, 5, 3, 3, 1]], output) < eps) @@ -829,7 +829,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.minimum_filter(array, footprint = footprint, origin = -1) - self.failUnless(diff([[3, 1, 3, 1, 1], + self.assertTrue(diff([[3, 1, 3, 1, 1], [5, 3, 3, 1, 1], [3, 3, 1, 1, 1]], output) < eps) @@ -841,7 +841,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.minimum_filter(array, footprint = footprint, origin = [-1, 0]) - self.failUnless(diff([[2, 3, 1, 3, 1], + self.assertTrue(diff([[2, 3, 1, 3, 1], [5, 5, 3, 3, 1], [5, 3, 3, 1, 1]], output) < eps) @@ -850,28 +850,28 @@ array = numpy.array([1, 2, 3, 4, 5]) filter_shape = numpy.array([2]) output = ndimage.maximum_filter(array, filter_shape) - self.failUnless(diff([1, 2, 3, 4, 5], output) < eps) + self.assertTrue(diff([1, 2, 3, 4, 5], output) < eps) def test_maximum_filter02(self): "maximum filter 2" array = numpy.array([1, 2, 3, 4, 5]) filter_shape = numpy.array([3]) output = ndimage.maximum_filter(array, filter_shape) - self.failUnless(diff([2, 3, 4, 5, 5], output) < eps) + self.assertTrue(diff([2, 3, 4, 5, 5], output) < eps) def test_maximum_filter03(self): "maximum filter 3" array = numpy.array([3, 2, 5, 1, 4]) filter_shape = numpy.array([2]) output = ndimage.maximum_filter(array, filter_shape) - self.failUnless(diff([3, 3, 5, 5, 4], output) < eps) + self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps) def test_maximum_filter04(self): "maximum filter 4" array = numpy.array([3, 2, 5, 1, 4]) filter_shape = numpy.array([3]) output = ndimage.maximum_filter(array, filter_shape) - self.failUnless(diff([3, 5, 5, 5, 4], output) < eps) + self.assertTrue(diff([3, 5, 5, 5, 4], output) < eps) def test_maximum_filter05(self): "maximum filter 5" @@ -880,7 +880,7 @@ [5, 8, 3, 7, 1]]) filter_shape = numpy.array([2, 3]) output = ndimage.maximum_filter(array, filter_shape) - self.failUnless(diff([[3, 5, 5, 5, 4], + self.assertTrue(diff([[3, 5, 5, 5, 4], [7, 9, 9, 9, 5], [8, 9, 9, 9, 7]], output) < eps) @@ -892,7 +892,7 @@ footprint = [[1, 1, 1], [1, 1, 1]] output = ndimage.maximum_filter(array, footprint = footprint) - self.failUnless(diff([[3, 5, 5, 5, 4], + self.assertTrue(diff([[3, 5, 5, 5, 4], [7, 9, 9, 9, 5], [8, 9, 9, 9, 7]], output) < eps) @@ -904,7 +904,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.maximum_filter(array, footprint = footprint) - self.failUnless(diff([[3, 5, 5, 5, 4], + self.assertTrue(diff([[3, 5, 5, 5, 4], [7, 7, 9, 9, 5], [7, 9, 8, 9, 7]], output) < eps) @@ -916,7 +916,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.maximum_filter(array, footprint = footprint, origin = -1) - self.failUnless(diff([[7, 9, 9, 5, 5], + self.assertTrue(diff([[7, 9, 9, 5, 5], [9, 8, 9, 7, 5], [8, 8, 7, 7, 7]], output) < eps) @@ -928,7 +928,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.maximum_filter(array, footprint = footprint, origin = [-1, 0]) - self.failUnless(diff([[7, 7, 9, 9, 5], + self.assertTrue(diff([[7, 7, 9, 9, 5], [7, 9, 8, 9, 7], [8, 8, 8, 7, 7]], output) < eps) @@ -936,47 +936,47 @@ "rank filter 1" array = numpy.array([1, 2, 3, 4, 5]) output = ndimage.rank_filter(array, 1, size = 2) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.percentile_filter(array, 100, size = 2) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.median_filter(array, 2) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_rank02(self): "rank filter 2" array = numpy.array([1, 2, 3, 4, 5]) output = ndimage.rank_filter(array, 1, size = [3]) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.percentile_filter(array, 50, size = 3) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) output = ndimage.median_filter(array, (3,)) - self.failUnless(diff(array, output) < eps) + self.assertTrue(diff(array, output) < eps) def test_rank03(self): "rank filter 3" array = numpy.array([3, 2, 5, 1, 4]) output = ndimage.rank_filter(array, 1, size = [2]) - self.failUnless(diff([3, 3, 5, 5, 4], output) < eps) + self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps) output = ndimage.percentile_filter(array, 100, size = 2) - self.failUnless(diff([3, 3, 5, 5, 4], output) < eps) + self.assertTrue(diff([3, 3, 5, 5, 4], output) < eps) def test_rank04(self): "rank filter 4" array = numpy.array([3, 2, 5, 1, 4]) true = [3, 3, 2, 4, 4] output = ndimage.rank_filter(array, 1, size = 3) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 50, size = 3) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.median_filter(array, size = 3) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank05(self): "rank filter 5" array = numpy.array([3, 2, 5, 1, 4]) true = [3, 3, 2, 4, 4] output = ndimage.rank_filter(array, -2, size = 3) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank06(self): "rank filter 6" @@ -987,10 +987,10 @@ [3, 3, 2, 1, 1], [5, 5, 3, 3, 1]] output = ndimage.rank_filter(array, 1, size = [2, 3]) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 17, size = (2, 3)) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank07(self): "rank filter 7" @@ -1001,7 +1001,7 @@ [5, 5, 7, 5, 4], [6, 8, 8, 7, 5]] output = ndimage.rank_filter(array, -2, size = [2, 3]) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank08(self): "median filter 8" @@ -1014,11 +1014,11 @@ kernel = numpy.array([2, 3]) output = ndimage.percentile_filter(array, 50.0, size = (2, 3)) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.rank_filter(array, 3, size = (2, 3)) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.median_filter(array, size = (2, 3)) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank09(self): "rank filter 9" @@ -1032,10 +1032,10 @@ [5, 6, 9, 3, 5]], type) output = ndimage.rank_filter(array, 1, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 35, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank10(self): "rank filter 10" @@ -1048,10 +1048,10 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.rank_filter(array, 0, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 0.0, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank11(self): "rank filter 11" @@ -1064,10 +1064,10 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.rank_filter(array, -1, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 100.0, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank12(self): @@ -1082,13 +1082,13 @@ [5, 6, 9, 3, 5]], type) output = ndimage.rank_filter(array, 1, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.percentile_filter(array, 50.0, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) output = ndimage.median_filter(array, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank13(self): "rank filter 13" @@ -1102,7 +1102,7 @@ [5, 6, 9, 3, 5]], type) output = ndimage.rank_filter(array, 1, footprint = footprint, origin = -1) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_rank14(self): "rank filter 14" @@ -1116,7 +1116,7 @@ [5, 6, 9, 3, 5]], type) output = ndimage.rank_filter(array, 1, footprint = footprint, origin = [-1, 0]) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_generic_filter1d01(self): "generic 1d filter 1" @@ -1135,7 +1135,7 @@ r2 = ndimage.generic_filter1d(a, _filter_func, 3, axis = 0, origin = -1, extra_arguments = (weights,), extra_keywords = {'total': weights.sum()}) - self.failUnless(diff(r1, r2) < eps) + self.assertTrue(diff(r1, r2) < eps) def test_generic_filter01(self): "generic filter 1" @@ -1153,7 +1153,7 @@ r2 = ndimage.generic_filter(a, _filter_func, footprint = footprint, extra_arguments = (cf,), extra_keywords = {'total': cf.sum()}) - self.failUnless(diff(r1, r2) < eps, + self.assertTrue(diff(r1, r2) < eps, "%r\n%r" % (r1, r2)) def test_extend01(self): @@ -1352,7 +1352,7 @@ shape[0], 0) a = fft.ifft(a, shape[1], 1) a = fft.irfft(a, shape[0], 0) - self.failUnless(diff(ndimage.sum(a), 1.0) < eps) + self.assertTrue(diff(ndimage.sum(a), 1.0) < eps) def test_fourier_gaussian_complex01(self): "gaussian fourier filter for complex transforms 1" @@ -1367,7 +1367,7 @@ a = fft.ifft(a, shape[1], 1) a = fft.ifft(a, shape[0], 0) error = diff(ndimage.sum(a.real), 1.0) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_fourier_uniform_real01(self): "uniform fourier filter for real transforms 1" @@ -1381,7 +1381,7 @@ shape[0], 0) a = fft.ifft(a, shape[1], 1) a = fft.irfft(a, shape[0], 0) - self.failUnless(diff(ndimage.sum(a), 1.0) < eps) + self.assertTrue(diff(ndimage.sum(a), 1.0) < eps) def test_fourier_uniform_complex01(self): "uniform fourier filter for complex transforms 1" @@ -1395,7 +1395,7 @@ a = fft.ifft(a, shape[1], 1) a = fft.ifft(a, shape[0], 0) error = diff(ndimage.sum(a.real), 1.0) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_fourier_shift_real01(self): "shift filter for real transforms 1" @@ -1410,7 +1410,7 @@ a = fft.irfft(a, shape[0], 0) error1 = diff(a[1:, 1:], true[:-1, :-1]) error2 = diff(a.imag, numpy.zeros(shape)) - self.failUnless(error1 < 1e-10 and error2 < 1e-10) + self.assertTrue(error1 < 1e-10 and error2 < 1e-10) def test_fourier_shift_complex01(self): "shift filter for complex transforms 1" @@ -1426,7 +1426,7 @@ a = fft.ifft(a, shape[0], 0) error1 = diff(a.real[1:, 1:], true[:-1, :-1]) error2 = diff(a.imag, numpy.zeros(shape)) - self.failUnless(error1 < 1e-10 and error2 < 1e-10) + self.assertTrue(error1 < 1e-10 and error2 < 1e-10) def test_fourier_ellipsoid_real01(self): "ellipsoid fourier filter for real transforms 1" @@ -1440,7 +1440,7 @@ shape[0], 0) a = fft.ifft(a, shape[1], 1) a = fft.irfft(a, shape[0], 0) - self.failUnless(diff(ndimage.sum(a), 1.0) < eps) + self.assertTrue(diff(ndimage.sum(a), 1.0) < eps) def test_fourier_ellipsoid_complex01(self): "ellipsoid fourier filter for complex transforms 1" @@ -1455,7 +1455,7 @@ a = fft.ifft(a, shape[1], 1) a = fft.ifft(a, shape[0], 0) error = diff(ndimage.sum(a.real), 1.0) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_spline01(self): "spline filter 1" @@ -1463,7 +1463,7 @@ data = numpy.ones([], type) for order in range(2, 6): out = ndimage.spline_filter(data, order = order) - self.failUnless(diff(out, 1)< eps and + self.assertTrue(diff(out, 1)< eps and out.dtype.type == numpy.float64) def test_spline02(self): @@ -1472,7 +1472,7 @@ data = numpy.array([1]) for order in range(2, 6): out = ndimage.spline_filter(data, order = order) - self.failUnless(diff(out, [1]) < eps and + self.assertTrue(diff(out, [1]) < eps and out.dtype.type == numpy.float64) def test_spline03(self): @@ -1482,7 +1482,7 @@ for order in range(2, 6): out = ndimage.spline_filter(data, order, output = type) - self.failUnless(diff(out, 1) < eps and + self.assertTrue(diff(out, 1) < eps and out.dtype.type == type) def test_spline04(self): @@ -1491,7 +1491,7 @@ data = numpy.ones([4], type) for order in range(2, 6): out = ndimage.spline_filter(data, order) - self.failUnless(diff(out, [1, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 1]) < eps) def test_spline05(self): "spline filter 5" @@ -1499,7 +1499,7 @@ data = numpy.ones([4, 4], type) for order in range(2, 6): out = ndimage.spline_filter(data, order = order) - self.failUnless(diff(out, [[1, 1, 1, 1], + self.assertTrue(diff(out, [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) < eps) @@ -1513,7 +1513,7 @@ out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [1]) < eps) + self.assertTrue(diff(out, [1]) < eps) def test_geometric_transform02(self): "geometric transform 2" @@ -1523,7 +1523,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [1, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 1]) < eps) def test_geometric_transform03(self): "geometric transform 3" @@ -1533,7 +1533,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [0, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [0, 1, 1, 1]) < eps) def test_geometric_transform04(self): "geometric transform 4" @@ -1543,7 +1543,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [0, 4, 1, 3]) < eps) + self.assertTrue(diff(out, [0, 4, 1, 3]) < eps) def test_geometric_transform05(self): "geometric transform 5" @@ -1555,7 +1555,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [[0, 1, 1, 1], + self.assertTrue(diff(out, [[0, 1, 1, 1], [0, 1, 1, 1], [0, 1, 1, 1]]) < eps) @@ -1569,7 +1569,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [[0, 4, 1, 3], + self.assertTrue(diff(out, [[0, 4, 1, 3], [0, 7, 6, 8], [0, 3, 5, 3]]) < eps) @@ -1583,7 +1583,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [4, 1, 3, 2], [7, 6, 8, 5]]) < eps) @@ -1597,7 +1597,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, data.shape, order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -1616,7 +1616,7 @@ filtered = data out = ndimage.geometric_transform(filtered, mapping, data.shape, order=order, prefilter = False) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -1628,7 +1628,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, [4], order=order) - self.failUnless(diff(out, [1, 1, 1, 1]) < eps, + self.assertTrue(diff(out, [1, 1, 1, 1]) < eps, "%r" % out) def test_geometric_transform14(self): @@ -1639,7 +1639,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, [4], order=order) - self.failUnless(diff(out, [1, 2, 3, 4]) < eps) + self.assertTrue(diff(out, [1, 2, 3, 4]) < eps) def test_geometric_transform15(self): "geometric transform 15" @@ -1649,7 +1649,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, [8], order=order) - self.failUnless(diff(out[::2], [1, 2, 3, 4]) < eps) + self.assertTrue(diff(out[::2], [1, 2, 3, 4]) < eps) def test_geometric_transform16(self): "geometric transform 16" @@ -1661,7 +1661,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (3, 2), order=order) - self.failUnless(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps) + self.assertTrue(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps) def test_geometric_transform17(self): "geometric transform 17" @@ -1673,7 +1673,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (1, 4), order=order) - self.failUnless(diff(out, [[1, 2, 3, 4]]) < eps) + self.assertTrue(diff(out, [[1, 2, 3, 4]]) < eps) def test_geometric_transform18(self): "geometric transform 18" @@ -1685,7 +1685,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (1, 2), order=order) - self.failUnless(diff(out, [[1, 3]]) < eps) + self.assertTrue(diff(out, [[1, 3]]) < eps) def test_geometric_transform19(self): "geometric transform 19" @@ -1697,7 +1697,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (3, 8), order=order) - self.failUnless(diff(out[..., ::2], data) < eps) + self.assertTrue(diff(out[..., ::2], data) < eps) def test_geometric_transform20(self): "geometric transform 20" @@ -1709,7 +1709,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (6, 4), order=order) - self.failUnless(diff(out[::2, ...], data) < eps) + self.assertTrue(diff(out[::2, ...], data) < eps) def test_geometric_transform21(self): "geometric transform 21" @@ -1721,7 +1721,7 @@ for order in range(0, 6): out = ndimage.geometric_transform(data, mapping, (6, 8), order=order) - self.failUnless(diff(out[::2, ::2], data) < eps) + self.assertTrue(diff(out[::2, ::2], data) < eps) def test_geometric_transform22(self): @@ -1739,7 +1739,7 @@ out = ndimage.geometric_transform(out, mapping2, (3, 4), order=order) error = diff(out, data) - self.failUnless(diff(out, data) < eps) + self.assertTrue(diff(out, data) < eps) def test_geometric_transform23(self): "geometric transform 23" @@ -1752,7 +1752,7 @@ out = ndimage.geometric_transform(data, mapping, (2,), order=order) out = out.astype(numpy.int32) - self.failUnless(diff(out, [5, 7]) < eps) + self.assertTrue(diff(out, [5, 7]) < eps) def test_geometric_transform24(self): "geometric transform 24" @@ -1765,7 +1765,7 @@ out = ndimage.geometric_transform(data, mapping, (2,), order=order, extra_arguments = (1,), extra_keywords = {'b': 2}) - self.failUnless(diff(out, [5, 7]) < eps) + self.assertTrue(diff(out, [5, 7]) < eps) def test_map_coordinates01(self): "map coordinates 1" @@ -1776,7 +1776,7 @@ idx -= 1 for order in range(0, 6): out = ndimage.map_coordinates(data, idx, order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -1791,7 +1791,7 @@ out1 = ndimage.shift(data, 0.5, order=order) out2 = ndimage.map_coordinates(data, idx, order=order) - self.failUnless(diff(out1, out2) < eps) + self.assertTrue(diff(out1, out2) < eps) def test_affine_transform01(self): "affine_transform 1" @@ -1799,7 +1799,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[1]], order=order) - self.failUnless(diff(out, [1]) < eps) + self.assertTrue(diff(out, [1]) < eps) def test_affine_transform02(self): "affine transform 2" @@ -1807,7 +1807,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[1]], order=order) - self.failUnless(diff(out, [1, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 1]) < eps) def test_affine_transform03(self): "affine transform 3" @@ -1815,7 +1815,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[1]], -1, order=order) - self.failUnless(diff(out, [0, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [0, 1, 1, 1]) < eps) def test_affine_transform04(self): "affine transform 4" @@ -1823,7 +1823,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[1]], -1, order=order) - self.failUnless(diff(out, [0, 4, 1, 3]) < eps) + self.assertTrue(diff(out, [0, 4, 1, 3]) < eps) def test_affine_transform05(self): "affine transform 5" @@ -1834,7 +1834,7 @@ out = ndimage.affine_transform(data, [[1, 0], [0, 1]], [0, -1], order=order) - self.failUnless(diff(out, [[0, 1, 1, 1], + self.assertTrue(diff(out, [[0, 1, 1, 1], [0, 1, 1, 1], [0, 1, 1, 1]]) < eps) @@ -1847,7 +1847,7 @@ out = ndimage.affine_transform(data, [[1, 0], [0, 1]], [0, -1], order=order) - self.failUnless(diff(out, [[0, 4, 1, 3], + self.assertTrue(diff(out, [[0, 4, 1, 3], [0, 7, 6, 8], [0, 3, 5, 3]]) < eps) @@ -1860,7 +1860,7 @@ out = ndimage.affine_transform(data, [[1, 0], [0, 1]], [-1, 0], order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [4, 1, 3, 2], [7, 6, 8, 5]]) < eps) @@ -1873,7 +1873,7 @@ out = ndimage.affine_transform(data, [[1, 0], [0, 1]], [-1, -1], order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -1891,7 +1891,7 @@ out = ndimage.affine_transform(filtered,[[1, 0], [0, 1]], [-1, -1], order=order, prefilter = False) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -1901,7 +1901,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[0.5]], output_shape = (4,), order=order) - self.failUnless(diff(out, [1, 1, 1, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 0]) < eps) def test_affine_transform11(self): "affine transform 11" @@ -1909,7 +1909,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[2]], 0, (4,), order=order) - self.failUnless(diff(out, [1, 2, 3, 4]) < eps) + self.assertTrue(diff(out, [1, 2, 3, 4]) < eps) def test_affine_transform12(self): "affine transform 12" @@ -1917,7 +1917,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[0.5]], 0, (8,), order=order) - self.failUnless(diff(out[::2], [1, 2, 3, 4]) < eps) + self.assertTrue(diff(out[::2], [1, 2, 3, 4]) < eps) def test_affine_transform13(self): "affine transform 13" @@ -1928,7 +1928,7 @@ out = ndimage.affine_transform(data, [[1, 0], [0, 2]], 0, (3, 2), order=order) - self.failUnless(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps) + self.assertTrue(diff(out, [[1, 3], [5, 7], [9, 11]]) < eps) def test_affine_transform14(self): "affine transform 14" @@ -1939,7 +1939,7 @@ out = ndimage.affine_transform(data, [[2, 0], [0, 1]], 0, (1, 4), order=order) - self.failUnless(diff(out, [[1, 2, 3, 4]]) < eps) + self.assertTrue(diff(out, [[1, 2, 3, 4]]) < eps) def test_affine_transform15(self): "affine transform 15" @@ -1950,7 +1950,7 @@ out = ndimage.affine_transform(data, [[2, 0], [0, 2]], 0, (1, 2), order=order) - self.failUnless(diff(out, [[1, 3]]) < eps) + self.assertTrue(diff(out, [[1, 3]]) < eps) def test_affine_transform16(self): "affine transform 16" @@ -1961,7 +1961,7 @@ out = ndimage.affine_transform(data, [[1, 0.0], [0, 0.5]], 0, (3, 8), order=order) - self.failUnless(diff(out[..., ::2], data) < eps) + self.assertTrue(diff(out[..., ::2], data) < eps) def test_affine_transform17(self): "affine transform 17" @@ -1972,7 +1972,7 @@ out = ndimage.affine_transform(data, [[0.5, 0], [0, 1]], 0, (6, 4), order=order) - self.failUnless(diff(out[::2, ...], data) < eps) + self.assertTrue(diff(out[::2, ...], data) < eps) def test_affine_transform18(self): "affine transform 18" @@ -1984,7 +1984,7 @@ [[0.5, 0], [0, 0.5]], 0, (6, 8), order=order) - self.failUnless(diff(out[::2, ::2], data) < eps) + self.assertTrue(diff(out[::2, ::2], data) < eps) def test_affine_transform19(self): "affine transform 19" @@ -2000,7 +2000,7 @@ [[2.0, 0], [0, 2.0]], 0, (3, 4), order=order) - self.failUnless(diff(out, data) < eps) + self.assertTrue(diff(out, data) < eps) def test_affine_transform20(self): "affine transform 20" @@ -2010,7 +2010,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[0], [2]], 0, (2,), order=order) - self.failUnless(diff(out, [1, 3]) < eps) + self.assertTrue(diff(out, [1, 3]) < eps) def test_affine_transform21(self): "affine transform 21" @@ -2020,35 +2020,35 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [[2], [0]], 0, (2,), order=order) - self.failUnless(diff(out, [1, 9]) < eps) + self.assertTrue(diff(out, [1, 9]) < eps) def test_shift01(self): "shift 1" data = numpy.array([1]) for order in range(0, 6): out = ndimage.shift(data, [1], order=order) - self.failUnless(diff(out, [0]) < eps) + self.assertTrue(diff(out, [0]) < eps) def test_shift02(self): "shift 2" data = numpy.ones([4]) for order in range(0, 6): out = ndimage.shift(data, [1], order=order) - self.failUnless(diff(out, [0, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [0, 1, 1, 1]) < eps) def test_shift03(self): "shift 3" data = numpy.ones([4]) for order in range(0, 6): out = ndimage.shift(data, -1, order=order) - self.failUnless(diff(out, [1, 1, 1, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 0]) < eps) def test_shift04(self): "shift 4" data = numpy.array([4, 1, 3, 2]) for order in range(0, 6): out = ndimage.shift(data, 1, order=order) - self.failUnless(diff(out, [0, 4, 1, 3]) < eps) + self.assertTrue(diff(out, [0, 4, 1, 3]) < eps) def test_shift05(self): "shift 5" @@ -2057,7 +2057,7 @@ [1, 1, 1, 1]]) for order in range(0, 6): out = ndimage.shift(data, [0, 1], order=order) - self.failUnless(diff(out, [[0, 1, 1, 1], + self.assertTrue(diff(out, [[0, 1, 1, 1], [0, 1, 1, 1], [0, 1, 1, 1]]) < eps) @@ -2068,7 +2068,7 @@ [3, 5, 3, 6]]) for order in range(0, 6): out = ndimage.shift(data, [0, 1], order=order) - self.failUnless(diff(out, [[0, 4, 1, 3], + self.assertTrue(diff(out, [[0, 4, 1, 3], [0, 7, 6, 8], [0, 3, 5, 3]]) < eps) @@ -2079,7 +2079,7 @@ [3, 5, 3, 6]]) for order in range(0, 6): out = ndimage.shift(data, [1, 0], order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [4, 1, 3, 2], [7, 6, 8, 5]]) < eps) @@ -2091,7 +2091,7 @@ [3, 5, 3, 6]]) for order in range(0, 6): out = ndimage.shift(data, [1, 1], order=order) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -2108,7 +2108,7 @@ filtered = data out = ndimage.shift(filtered, [1, 1], order=order, prefilter = False) - self.failUnless(diff(out, [[0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0], [0, 4, 1, 3], [0, 7, 6, 8]]) < eps) @@ -2139,7 +2139,7 @@ for order in range(0, 6): out = ndimage.affine_transform(data, [0.5, 0.5], 0, (6, 8), order=order) - self.failUnless(diff(out[::2, ::2], data) < eps) + self.assertTrue(diff(out[::2, ::2], data) < eps) def test_rotate01(self): "rotate 1" @@ -2148,7 +2148,7 @@ [0, 0, 0, 0]], dtype = numpy.float64) for order in range(0, 6): out = ndimage.rotate(data, 0) - self.failUnless(diff(out, data) < eps) + self.assertTrue(diff(out, data) < eps) def test_rotate02(self): "rotate 2" @@ -2161,7 +2161,7 @@ [0, 0, 0]], dtype = numpy.float64) for order in range(0, 6): out = ndimage.rotate(data, 90) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_rotate03(self): "rotate 3" @@ -2175,7 +2175,7 @@ [0, 0, 0]], dtype = numpy.float64) for order in range(0, 6): out = ndimage.rotate(data, 90) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_rotate04(self): "rotate 4" @@ -2187,7 +2187,7 @@ [0, 0, 1, 0, 0]], dtype = numpy.float64) for order in range(0, 6): out = ndimage.rotate(data, 90, reshape = False) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_rotate05(self): "rotate 5" @@ -2205,7 +2205,7 @@ for order in range(0, 6): out = ndimage.rotate(data, 90) for i in range(3): - self.failUnless(diff(out[:,:,i], true) < eps) + self.assertTrue(diff(out[:,:,i], true) < eps) def test_rotate06(self): "rotate 6" @@ -2223,7 +2223,7 @@ for order in range(0, 6): out = ndimage.rotate(data, 90) for i in range(3): - self.failUnless(diff(out[:,:,i], true) < eps) + self.assertTrue(diff(out[:,:,i], true) < eps) def test_rotate07(self): "rotate 7" @@ -2241,7 +2241,7 @@ for order in range(0, 6): out = ndimage.rotate(data, 90, axes = (0, 1)) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_rotate08(self): "rotate 8" @@ -2258,7 +2258,7 @@ for order in range(0, 6): out = ndimage.rotate(data, 90, axes = (0, 1), reshape = False) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_watershed_ift01(self): "watershed_ift 1" @@ -2291,7 +2291,7 @@ [-1, 1, 1, 1, 1, 1, -1], [-1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift02(self): "watershed_ift 2" @@ -2321,7 +2321,7 @@ [-1, -1, 1, 1, 1, -1, -1], [-1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift03(self): "watershed_ift 3" @@ -2348,7 +2348,7 @@ [-1, 2, 2, 3, 3, 3, -1], [-1, -1, 2, -1, 3, -1, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift04(self): "watershed_ift 4" @@ -2378,7 +2378,7 @@ [-1, 2, 2, 3, 3, 3, -1], [-1, 2, 2, 3, 3, 3, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift05(self): "watershed_ift 5" @@ -2408,7 +2408,7 @@ [-1, 3, 3, 2, 2, 2, -1], [-1, 3, 3, 2, 2, 2, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift06(self): "watershed_ift 6" @@ -2435,7 +2435,7 @@ [-1, 1, 1, 1, 1, 1, -1], [-1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_watershed_ift07(self): "watershed_ift 7" @@ -2468,43 +2468,43 @@ [-1, 1, 1, 1, 1, 1, -1], [-1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1]], out) - self.failUnless(error < eps) + self.assertTrue(error < eps) def test_label01(self): "label 1" data = numpy.ones([]) out, n = ndimage.label(data) - self.failUnless(diff(out, 1) < eps and n == 1) + self.assertTrue(diff(out, 1) < eps and n == 1) def test_label02(self): "label 2" data = numpy.zeros([]) out, n = ndimage.label(data) - self.failUnless(diff(out, 0) < eps and n == 0) + self.assertTrue(diff(out, 0) < eps and n == 0) def test_label03(self): "label 3" data = numpy.ones([1]) out, n = ndimage.label(data) - self.failUnless(diff(out, [1]) < eps and n == 1) + self.assertTrue(diff(out, [1]) < eps and n == 1) def test_label04(self): "label 4" data = numpy.zeros([1]) out, n = ndimage.label(data) - self.failUnless(diff(out, [0]) < eps and n == 0) + self.assertTrue(diff(out, [0]) < eps and n == 0) def test_label05(self): "label 5" data = numpy.ones([5]) out, n = ndimage.label(data) - self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps and n == 1) + self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps and n == 1) def test_label06(self): "label 6" data = numpy.array([1, 0, 1, 1, 0, 1]) out, n = ndimage.label(data) - self.failUnless(diff(out, [1, 0, 2, 2, 0, 3]) < eps and n == 3) + self.assertTrue(diff(out, [1, 0, 2, 2, 0, 3]) < eps and n == 3) def test_label07(self): "label 7" @@ -2515,7 +2515,7 @@ [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) out, n = ndimage.label(data) - self.failUnless(diff(out, [[0, 0, 0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], @@ -2531,7 +2531,7 @@ [1, 1, 0, 0, 0, 0], [0, 0, 0, 1, 1, 0]]) out, n = ndimage.label(data) - self.failUnless(diff(out, [[1, 0, 0, 0, 0, 0], + self.assertTrue(diff(out, [[1, 0, 0, 0, 0, 0], [0, 0, 2, 2, 0, 0], [0, 0, 2, 2, 2, 0], [3, 3, 0, 0, 0, 0], @@ -2548,7 +2548,7 @@ [0, 0, 0, 1, 1, 0]]) struct = ndimage.generate_binary_structure(2, 2) out, n = ndimage.label(data, struct) - self.failUnless(diff(out, [[1, 0, 0, 0, 0, 0], + self.assertTrue(diff(out, [[1, 0, 0, 0, 0, 0], [0, 0, 2, 2, 0, 0], [0, 0, 2, 2, 2, 0], [2, 2, 0, 0, 0, 0], @@ -2563,7 +2563,7 @@ [0, 0, 0, 0, 0, 0]]) struct = ndimage.generate_binary_structure(2, 2) out, n = ndimage.label(data, struct) - self.failUnless(diff(out, [[0, 0, 0, 0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]]) < eps and n == 1) @@ -2584,7 +2584,7 @@ [3, 3, 0, 0, 0, 0], [3, 3, 0, 0, 0, 0], [0, 0, 0, 4, 4, 0]]) - self.failUnless(error < eps and n == 4) + self.assertTrue(error < eps and n == 4) def test_label12(self): "label 12" @@ -2600,7 +2600,7 @@ [0, 0, 1, 0, 1, 1], [0, 0, 1, 1, 1, 1], [0, 0, 0, 1, 1, 0]]) - self.failUnless(error < eps and n == 1) + self.assertTrue(error < eps and n == 1) def test_label13(self): "label 13" @@ -2615,43 +2615,43 @@ [1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]) - self.failUnless(error < eps and n == 1) + self.assertTrue(error < eps and n == 1) def test_find_objects01(self): "find_objects 1" data = numpy.ones([], dtype=int) out = ndimage.find_objects(data) - self.failUnless(out == [()]) + self.assertTrue(out == [()]) def test_find_objects02(self): "find_objects 2" data = numpy.zeros([], dtype=int) out = ndimage.find_objects(data) - self.failUnless(out == []) + self.assertTrue(out == []) def test_find_objects03(self): "find_objects 3" data = numpy.ones([1], dtype=int) out = ndimage.find_objects(data) - self.failUnless(out == [(slice(0, 1, None),)]) + self.assertTrue(out == [(slice(0, 1, None),)]) def test_find_objects04(self): "find_objects 4" data = numpy.zeros([1], dtype=int) out = ndimage.find_objects(data) - self.failUnless(out == []) + self.assertTrue(out == []) def test_find_objects05(self): "find_objects 5" data = numpy.ones([5], dtype=int) out = ndimage.find_objects(data) - self.failUnless(out == [(slice(0, 5, None),)]) + self.assertTrue(out == [(slice(0, 5, None),)]) def test_find_objects06(self): "find_objects 6" data = numpy.array([1, 0, 2, 2, 0, 3]) out = ndimage.find_objects(data) - self.failUnless(out == [(slice(0, 1, None),), + self.assertTrue(out == [(slice(0, 1, None),), (slice(2, 4, None),), (slice(5, 6, None),)]) @@ -2664,7 +2664,7 @@ [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]) out = ndimage.find_objects(data) - self.failUnless(out == []), + self.assertTrue(out == []), def test_find_objects08(self): "find_objects 8" @@ -2675,7 +2675,7 @@ [3, 3, 0, 0, 0, 0], [0, 0, 0, 4, 4, 0]]) out = ndimage.find_objects(data) - self.failUnless(out == [(slice(0, 1, None), slice(0, 1, None)), + self.assertTrue(out == [(slice(0, 1, None), slice(0, 1, None)), (slice(1, 3, None), slice(2, 5, None)), (slice(3, 5, None), slice(0, 2, None)), (slice(5, 6, None), slice(3, 5, None))]) @@ -2689,7 +2689,7 @@ [0, 0, 0, 0, 0, 0], [0, 0, 0, 4, 4, 0]]) out = ndimage.find_objects(data) - self.failUnless(out == [(slice(0, 1, None), slice(0, 1, None)), + self.assertTrue(out == [(slice(0, 1, None), slice(0, 1, None)), (slice(1, 3, None), slice(2, 5, None)), None, (slice(5, 6, None), slice(3, 5, None))]) @@ -2699,35 +2699,35 @@ for type in self.types: input = numpy.array([], type) output = ndimage.sum(input) - self.failUnless(output == 0.0) + self.assertTrue(output == 0.0) def test_sum02(self): "sum 2" for type in self.types: input = numpy.zeros([0, 4], type) output = ndimage.sum(input) - self.failUnless(output == 0.0) + self.assertTrue(output == 0.0) def test_sum03(self): "sum 3" for type in self.types: input = numpy.ones([], type) output = ndimage.sum(input) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_sum04(self): "sum 4" for type in self.types: input = numpy.array([1, 2], type) output = ndimage.sum(input) - self.failUnless(output == 3.0) + self.assertTrue(output == 3.0) def test_sum05(self): "sum 5" for type in self.types: input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.sum(input) - self.failUnless(output == 10.0) + self.assertTrue(output == 10.0) def test_sum06(self): "sum 6" @@ -2735,7 +2735,7 @@ for type in self.types: input = numpy.array([], type) output = ndimage.sum(input, labels = labels) - self.failUnless(output == 0.0) + self.assertTrue(output == 0.0) def test_sum07(self): "sum 7" @@ -2743,7 +2743,7 @@ for type in self.types: input = numpy.zeros([0, 4], type) output = ndimage.sum(input, labels = labels) - self.failUnless(output == 0.0) + self.assertTrue(output == 0.0) def test_sum08(self): "sum 8" @@ -2751,7 +2751,7 @@ for type in self.types: input = numpy.array([1, 2], type) output = ndimage.sum(input, labels = labels) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_sum09(self): "sum 9" @@ -2759,14 +2759,14 @@ for type in self.types: input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.sum(input, labels = labels) - self.failUnless(output == 4.0) + self.assertTrue(output == 4.0) def test_sum10(self): "sum 10" labels = numpy.array([1, 0], bool) input = numpy.array([[1, 2], [3, 4]], bool) output = ndimage.sum(input, labels = labels) - self.failUnless(output == 2.0) + self.assertTrue(output == 2.0) def test_sum11(self): "sum 11" @@ -2775,7 +2775,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.sum(input, labels = labels, index = 2) - self.failUnless(output == 6.0) + self.assertTrue(output == 6.0) def test_sum12(self): "sum 12" @@ -2784,7 +2784,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.sum(input, labels = labels, index = [4, 8, 2]) - self.failUnless(numpy.all(output == [4.0, 0.0, 5.0])) + self.assertTrue(numpy.all(output == [4.0, 0.0, 5.0])) def test_mean01(self): "mean 1" @@ -2792,14 +2792,14 @@ for type in self.types: input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.mean(input, labels = labels) - self.failUnless(output == 2.0) + self.assertTrue(output == 2.0) def test_mean02(self): "mean 2" labels = numpy.array([1, 0], bool) input = numpy.array([[1, 2], [3, 4]], bool) output = ndimage.mean(input, labels = labels) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_mean03(self): "mean 3" @@ -2808,7 +2808,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.mean(input, labels = labels, index = 2) - self.failUnless(output == 3.0) + self.assertTrue(output == 3.0) def test_mean04(self): "mean 4" @@ -2817,7 +2817,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.mean(input, labels = labels, index = [4, 8, 2]) - self.failUnless(numpy.all(output[[0,2]] == [4.0, 2.5]) and + self.assertTrue(numpy.all(output[[0,2]] == [4.0, 2.5]) and numpy.isnan(output[1])) def test_minimum01(self): @@ -2826,14 +2826,14 @@ for type in self.types: input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.minimum(input, labels = labels) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_minimum02(self): "minimum 2" labels = numpy.array([1, 0], bool) input = numpy.array([[2, 2], [2, 4]], bool) output = ndimage.minimum(input, labels = labels) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_minimum03(self): "minimum 3" @@ -2842,7 +2842,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.minimum(input, labels = labels, index = 2) - self.failUnless(output == 2.0) + self.assertTrue(output == 2.0) def test_minimum04(self): "minimum 4" @@ -2851,7 +2851,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.minimum(input, labels = labels, index = [2, 3, 8]) - self.failUnless(numpy.all(output == [2.0, 4.0, 0.0])) + self.assertTrue(numpy.all(output == [2.0, 4.0, 0.0])) def test_maximum01(self): "maximum 1" @@ -2859,14 +2859,14 @@ for type in self.types: input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.maximum(input, labels = labels) - self.failUnless(output == 3.0) + self.assertTrue(output == 3.0) def test_maximum02(self): "maximum 2" labels = numpy.array([1, 0], bool) input = numpy.array([[2, 2], [2, 4]], bool) output = ndimage.maximum(input, labels = labels) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_maximum03(self): "maximum 3" @@ -2875,7 +2875,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.maximum(input, labels = labels, index = 2) - self.failUnless(output == 4.0) + self.assertTrue(output == 4.0) def test_maximum04(self): "maximum 4" @@ -2884,7 +2884,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.maximum(input, labels = labels, index = [2, 3, 8]) - self.failUnless(numpy.all(output == [3.0, 4.0, 0.0])) + self.assertTrue(numpy.all(output == [3.0, 4.0, 0.0])) def test_maximum05(self): "Ticket #501" @@ -2896,27 +2896,27 @@ for type in self.types: input = numpy.array([], type) output = ndimage.variance(input) - self.failUnless(numpy.isnan(output)) + self.assertTrue(numpy.isnan(output)) def test_variance02(self): "variance 2" for type in self.types: input = numpy.array([1], type) output = ndimage.variance(input) - self.failUnless(float(output) == 0.0) + self.assertTrue(float(output) == 0.0) def test_variance03(self): "variance 3" for type in self.types: input = numpy.array([1, 3], type) output = ndimage.variance(input) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_variance04(self): "variance 4" input = numpy.array([1, 0], bool) output = ndimage.variance(input) - self.failUnless(output == 0.25) + self.assertTrue(output == 0.25) def test_variance05(self): "variance 5" @@ -2924,7 +2924,7 @@ for type in self.types: input = numpy.array([1, 3, 8], type) output = ndimage.variance(input, labels, 2) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_variance06(self): "variance 6" @@ -2932,34 +2932,34 @@ for type in self.types: input = numpy.array([1, 3, 8, 10, 8], type) output = ndimage.variance(input, labels, [2, 3, 4]) - self.failUnless(numpy.all(output == [1.0, 1.0, 0.0])) + self.assertTrue(numpy.all(output == [1.0, 1.0, 0.0])) def test_standard_deviation01(self): "standard deviation 1" for type in self.types: input = numpy.array([], type) output = ndimage.standard_deviation(input) - self.failUnless(numpy.isnan(output)) + self.assertTrue(numpy.isnan(output)) def test_standard_deviation02(self): "standard deviation 2" for type in self.types: input = numpy.array([1], type) output = ndimage.standard_deviation(input) - self.failUnless(float(output) == 0.0) + self.assertTrue(float(output) == 0.0) def test_standard_deviation03(self): "standard deviation 3" for type in self.types: input = numpy.array([1, 3], type) output = ndimage.standard_deviation(input) - self.failUnless(output == math.sqrt(1.0)) + self.assertTrue(output == math.sqrt(1.0)) def test_standard_deviation04(self): "standard deviation 4" input = numpy.array([1, 0], bool) output = ndimage.standard_deviation(input) - self.failUnless(output == 0.5) + self.assertTrue(output == 0.5) def test_standard_deviation05(self): "standard deviation 5" @@ -2967,7 +2967,7 @@ for type in self.types: input = numpy.array([1, 3, 8], type) output = ndimage.standard_deviation(input, labels, 2) - self.failUnless(output == 1.0) + self.assertTrue(output == 1.0) def test_standard_deviation06(self): "standard deviation 6" @@ -2976,7 +2976,7 @@ input = numpy.array([1, 3, 8, 10, 8], type) output = ndimage.standard_deviation(input, labels, [2, 3, 4]) - self.failUnless(np.all(output == [1.0, 1.0, 0.0])) + self.assertTrue(np.all(output == [1.0, 1.0, 0.0])) def test_minimum_position01(self): "minimum position 1" @@ -2985,7 +2985,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.minimum_position(input, labels = labels) - self.failUnless(output == (0, 0)) + self.assertTrue(output == (0, 0)) def test_minimum_position02(self): "minimum position 2" @@ -2994,7 +2994,7 @@ [3, 7, 0, 2], [1, 5, 1, 1]], type) output = ndimage.minimum_position(input) - self.failUnless(output == (1, 2)) + self.assertTrue(output == (1, 2)) def test_minimum_position03(self): "minimum position 3" @@ -3002,7 +3002,7 @@ [3, 7, 0, 2], [1, 5, 1, 1]], bool) output = ndimage.minimum_position(input) - self.failUnless(output == (1, 2)) + self.assertTrue(output == (1, 2)) def test_minimum_position04(self): "minimum position 4" @@ -3010,7 +3010,7 @@ [3, 7, 1, 2], [1, 5, 1, 1]], bool) output = ndimage.minimum_position(input) - self.failUnless(output == (0, 0)) + self.assertTrue(output == (0, 0)) def test_minimum_position05(self): "minimum position 5" @@ -3020,7 +3020,7 @@ [3, 7, 0, 2], [1, 5, 2, 3]], type) output = ndimage.minimum_position(input, labels) - self.failUnless(output == (2, 0)) + self.assertTrue(output == (2, 0)) def test_minimum_position06(self): "minimum position 6" @@ -3030,7 +3030,7 @@ [3, 7, 0, 2], [1, 5, 1, 1]], type) output = ndimage.minimum_position(input, labels, 2) - self.failUnless(output == (0, 1)) + self.assertTrue(output == (0, 1)) def test_minimum_position07(self): "minimum position 7" @@ -3041,7 +3041,7 @@ [1, 5, 1, 1]], type) output = ndimage.minimum_position(input, labels, [2, 3]) - self.failUnless(output[0] == (0, 1) and output[1] == (1, 2)) + self.assertTrue(output[0] == (0, 1) and output[1] == (1, 2)) def test_maximum_position01(self): "maximum position 1" @@ -3050,7 +3050,7 @@ input = numpy.array([[1, 2], [3, 4]], type) output = ndimage.maximum_position(input, labels = labels) - self.failUnless(output == (1, 0)) + self.assertTrue(output == (1, 0)) def test_maximum_position02(self): "maximum position 2" @@ -3059,7 +3059,7 @@ [3, 7, 8, 2], [1, 5, 1, 1]], type) output = ndimage.maximum_position(input) - self.failUnless(output == (1, 2)) + self.assertTrue(output == (1, 2)) def test_maximum_position03(self): "maximum position 3" @@ -3067,7 +3067,7 @@ [3, 7, 8, 2], [1, 5, 1, 1]], bool) output = ndimage.maximum_position(input) - self.failUnless(output == (0, 0)) + self.assertTrue(output == (0, 0)) def test_maximum_position04(self): "maximum position 4" @@ -3077,7 +3077,7 @@ [3, 7, 8, 2], [1, 5, 1, 1]], type) output = ndimage.maximum_position(input, labels) - self.failUnless(output == (1, 1)) + self.assertTrue(output == (1, 1)) def test_maximum_position05(self): "maximum position 5" @@ -3087,7 +3087,7 @@ [3, 7, 8, 2], [1, 5, 1, 1]], type) output = ndimage.maximum_position(input, labels, 1) - self.failUnless(output == (0, 0)) + self.assertTrue(output == (0, 0)) def test_maximum_position06(self): "maximum position 6" @@ -3098,7 +3098,7 @@ [1, 5, 1, 1]], type) output = ndimage.maximum_position(input, labels, [1, 2]) - self.failUnless(output[0] == (0, 0) and output[1] == (1, 1)) + self.assertTrue(output[0] == (0, 0) and output[1] == (1, 1)) def test_extrema01(self): "extrema 1" @@ -3112,7 +3112,7 @@ labels = labels) output5 = ndimage.maximum_position(input, labels = labels) - self.failUnless(output1 == (output2, output3, output4, + self.assertTrue(output1 == (output2, output3, output4, output5)) def test_extrema02(self): @@ -3130,7 +3130,7 @@ labels = labels, index = 2) output5 = ndimage.maximum_position(input, labels = labels, index = 2) - self.failUnless(output1 == (output2, output3, output4, + self.assertTrue(output1 == (output2, output3, output4, output5)) def test_extrema03(self): @@ -3148,10 +3148,10 @@ labels = labels, index = [2, 3, 8]) output5 = ndimage.maximum_position(input, labels = labels, index = [2, 3, 8]) - self.failUnless(numpy.all(output1[0] == output2)) - self.failUnless(numpy.all(output1[1] == output3)) - self.failUnless(numpy.all(output1[2] == output4)) - self.failUnless(numpy.all(output1[3] == output5)) + self.assertTrue(numpy.all(output1[0] == output2)) + self.assertTrue(numpy.all(output1[1] == output3)) + self.assertTrue(numpy.all(output1[2] == output4)) + self.assertTrue(numpy.all(output1[3] == output5)) def test_extrema04(self): "extrema 4" @@ -3167,10 +3167,10 @@ [1, 2]) output5 = ndimage.maximum_position(input, labels, [1, 2]) - self.failUnless(numpy.all(output1[0] == output2)) - self.failUnless(numpy.all(output1[1] == output3)) - self.failUnless(numpy.all(output1[2] == output4)) - self.failUnless(numpy.all(output1[3] == output5)) + self.assertTrue(numpy.all(output1[0] == output2)) + self.assertTrue(numpy.all(output1[1] == output3)) + self.assertTrue(numpy.all(output1[2] == output4)) + self.assertTrue(numpy.all(output1[3] == output5)) def test_center_of_mass01(self): "center of mass 1" @@ -3179,7 +3179,7 @@ input = numpy.array([[1, 0], [0, 0]], type) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass02(self): "center of mass 2" @@ -3188,7 +3188,7 @@ input = numpy.array([[0, 0], [1, 0]], type) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass03(self): "center of mass 3" @@ -3197,7 +3197,7 @@ input = numpy.array([[0, 1], [0, 0]], type) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass04(self): "center of mass 4" @@ -3206,7 +3206,7 @@ input = numpy.array([[0, 0], [0, 1]], type) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass05(self): "center of mass 5" @@ -3215,7 +3215,7 @@ input = numpy.array([[1, 1], [1, 1]], type) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass06(self): "center of mass 6" @@ -3223,7 +3223,7 @@ input = numpy.array([[1, 2], [3, 1]], bool) output = ndimage.center_of_mass(input) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass07(self): "center of mass 7" @@ -3232,7 +3232,7 @@ input = numpy.array([[1, 2], [3, 1]], bool) output = ndimage.center_of_mass(input, labels) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass08(self): "center of mass 8" @@ -3241,7 +3241,7 @@ input = numpy.array([[5, 2], [3, 1]], bool) output = ndimage.center_of_mass(input, labels, 2) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_center_of_mass09(self): @@ -3251,7 +3251,7 @@ input = numpy.array([[1, 2], [1, 1]], bool) output = ndimage.center_of_mass(input, labels, [1, 2]) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_histogram01(self): "histogram 1" @@ -3259,7 +3259,7 @@ input = numpy.arange(10) output = ndimage.histogram(input, 0, 10, 10) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_histogram02(self): "histogram 2" @@ -3268,7 +3268,7 @@ input = numpy.array([1, 1, 3, 4, 3, 3, 3, 3]) output = ndimage.histogram(input, 0, 4, 5, labels, 1) e = diff(true, output) - self.failUnless(e < eps) + self.assertTrue(e < eps) def test_histogram03(self): "histogram 3" @@ -3279,7 +3279,7 @@ output = ndimage.histogram(input, 0, 4, 5, labels, (1,2)) e1 = diff(true1, output[0]) e2 = diff(true2, output[1]) - self.failUnless(e1 < eps and e2 < eps) + self.assertTrue(e1 < eps and e2 < eps) def test_distance_transform_bf01(self): "brute force distance transform 1" @@ -3323,7 +3323,7 @@ [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_bf02(self): "brute force distance transform 2" @@ -3366,7 +3366,7 @@ [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_bf03(self): "brute force distance transform 3" @@ -3409,7 +3409,7 @@ [0, 1, 2, 4, 5, 6, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_bf04(self): "brute force distance transform 4" @@ -3458,9 +3458,9 @@ dts.append(dt) fts.append(ft) for dt in dts: - self.failUnless(diff(tdt, dt) < eps) + self.assertTrue(diff(tdt, dt) < eps) for ft in fts: - self.failUnless(diff(tft, ft) < eps) + self.assertTrue(diff(tft, ft) < eps) def test_distance_transform_bf05(self): "brute force distance transform 5" @@ -3503,7 +3503,7 @@ [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_bf06(self): "brute force distance transform 6" @@ -3546,8 +3546,8 @@ [0, 1, 2, 2, 4, 6, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]]], ft) - self.failUnless(error1 < eps and error2 < eps) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_cdt01(self): "chamfer type distance transform 1" @@ -3583,7 +3583,7 @@ [0, 1, 2, 2, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8],]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_cdt02(self): "chamfer type distance transform 2" @@ -3619,7 +3619,7 @@ [0, 1, 2, 2, 5, 6, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8],]], ft) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_cdt03(self): "chamfer type distance transform 3" @@ -3668,9 +3668,9 @@ dts.append(dt) fts.append(ft) for dt in dts: - self.failUnless(diff(tdt, dt) < eps) + self.assertTrue(diff(tdt, dt) < eps) for ft in fts: - self.failUnless(diff(tft, ft) < eps) + self.assertTrue(diff(tft, ft) < eps) def test_distance_transform_edt01(self): "euclidean distance transform 1" @@ -3695,7 +3695,7 @@ dt = numpy.add.reduce(dt, axis = 0) numpy.sqrt(dt, dt) error2 = diff(bf, dt) - self.failUnless(error1 < eps and error2 < eps) + self.assertTrue(error1 < eps and error2 < eps) def test_distance_transform_edt02(self): "euclidean distance transform 2" @@ -3744,9 +3744,9 @@ dts.append(dt) fts.append(ft) for dt in dts: - self.failUnless(diff(tdt, dt) < eps) + self.assertTrue(diff(tdt, dt) < eps) for ft in fts: - self.failUnless(diff(tft, ft) < eps) + self.assertTrue(diff(tft, ft) < eps) def test_distance_transform_edt03(self): "euclidean distance transform 3" @@ -3764,7 +3764,7 @@ sampling = [2, 2]) out = ndimage.distance_transform_edt(data, sampling = [2, 2]) - self.failUnless(diff(ref, out) < eps) + self.assertTrue(diff(ref, out) < eps) def test_distance_transform_edt4(self): @@ -3783,29 +3783,29 @@ sampling = [2, 1]) out = ndimage.distance_transform_edt(data, sampling = [2, 1]) - self.failUnless(diff(ref, out) < eps) + self.assertTrue(diff(ref, out) < eps) def test_generate_structure01(self): "generation of a binary structure 1" struct = ndimage.generate_binary_structure(0, 1) - self.failUnless(diff(struct, 1) < eps) + self.assertTrue(diff(struct, 1) < eps) def test_generate_structure02(self): "generation of a binary structure 2" struct = ndimage.generate_binary_structure(1, 1) - self.failUnless(diff(struct, [1, 1, 1]) < eps) + self.assertTrue(diff(struct, [1, 1, 1]) < eps) def test_generate_structure03(self): "generation of a binary structure 3" struct = ndimage.generate_binary_structure(2, 1) - self.failUnless(diff(struct, [[0, 1, 0], + self.assertTrue(diff(struct, [[0, 1, 0], [1, 1, 1], [0, 1, 0]]) < eps) def test_generate_structure04(self): "generation of a binary structure 4" struct = ndimage.generate_binary_structure(2, 2) - self.failUnless(diff(struct, [[1, 1, 1], + self.assertTrue(diff(struct, [[1, 1, 1], [1, 1, 1], [1, 1, 1]]) < eps) @@ -3815,7 +3815,7 @@ [1, 1, 1], [0, 1, 0]] out = ndimage.iterate_structure(struct, 2) - self.failUnless(diff(out, [[0, 0, 1, 0, 0], + self.assertTrue(diff(out, [[0, 0, 1, 0, 0], [0, 1, 1, 1, 0], [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], @@ -3827,7 +3827,7 @@ [1, 1], [0, 1]] out = ndimage.iterate_structure(struct, 2) - self.failUnless(diff(out, [[0, 0, 1], + self.assertTrue(diff(out, [[0, 0, 1], [0, 1, 1], [1, 1, 1], [0, 1, 1], @@ -3844,63 +3844,63 @@ [1, 1, 1, 1, 1], [0, 1, 1, 1, 0], [0, 0, 1, 0, 0]]) - self.failUnless(error < eps and out[1] == [2, 2]) + self.assertTrue(error < eps and out[1] == [2, 2]) def test_binary_erosion01(self): "binary erosion 1" for type in self.types: data = numpy.ones([], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, 1) < eps) + self.assertTrue(diff(out, 1) < eps) def test_binary_erosion02(self): "binary erosion 2" for type in self.types: data = numpy.ones([], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, 1) < eps) + self.assertTrue(diff(out, 1) < eps) def test_binary_erosion03(self): "binary erosion 3" for type in self.types: data = numpy.ones([1], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [0]) < eps) + self.assertTrue(diff(out, [0]) < eps) def test_binary_erosion04(self): "binary erosion 4" for type in self.types: data = numpy.ones([1], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [1]) < eps) + self.assertTrue(diff(out, [1]) < eps) def test_binary_erosion05(self): "binary erosion 5" for type in self.types: data = numpy.ones([3], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [0, 1, 0]) < eps) + self.assertTrue(diff(out, [0, 1, 0]) < eps) def test_binary_erosion06(self): "binary erosion 6" for type in self.types: data = numpy.ones([3], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1]) < eps) def test_binary_erosion07(self): "binary erosion 7" for type in self.types: data = numpy.ones([5], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [0, 1, 1, 1, 0]) < eps) + self.assertTrue(diff(out, [0, 1, 1, 1, 0]) < eps) def test_binary_erosion08(self): "binary erosion 8" for type in self.types: data = numpy.ones([5], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps) def test_binary_erosion09(self): "binary erosion 9" @@ -3908,7 +3908,7 @@ data = numpy.ones([5], type) data[2] = 0 out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [0, 0, 0, 0, 0]) < eps) + self.assertTrue(diff(out, [0, 0, 0, 0, 0]) < eps) def test_binary_erosion10(self): "binary erosion 10" @@ -3916,7 +3916,7 @@ data = numpy.ones([5], type) data[2] = 0 out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [1, 0, 0, 0, 1]) < eps) + self.assertTrue(diff(out, [1, 0, 0, 0, 1]) < eps) def test_binary_erosion11(self): "binary erosion 11" @@ -3926,7 +3926,7 @@ struct = [1, 0, 1] out = ndimage.binary_erosion(data, struct, border_value = 1) - self.failUnless(diff(out, [1, 0, 1, 0, 1]) < eps) + self.assertTrue(diff(out, [1, 0, 1, 0, 1]) < eps) def test_binary_erosion12(self): "binary erosion 12" @@ -3937,7 +3937,7 @@ out = ndimage.binary_erosion(data, struct, border_value = 1, origin = -1) - self.failUnless(diff(out, [0, 1, 0, 1, 1]) < eps) + self.assertTrue(diff(out, [0, 1, 0, 1, 1]) < eps) def test_binary_erosion13(self): "binary erosion 13" @@ -3948,7 +3948,7 @@ out = ndimage.binary_erosion(data, struct, border_value = 1, origin = 1) - self.failUnless(diff(out, [1, 1, 0, 1, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 0, 1, 0]) < eps) def test_binary_erosion14(self): "binary erosion 14" @@ -3958,7 +3958,7 @@ struct = [1, 1] out = ndimage.binary_erosion(data, struct, border_value = 1) - self.failUnless(diff(out, [1, 1, 0, 0, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 0, 0, 1]) < eps) def test_binary_erosion15(self): "binary erosion 15" @@ -3969,42 +3969,42 @@ out = ndimage.binary_erosion(data, struct, border_value = 1, origin = -1) - self.failUnless(diff(out, [1, 0, 0, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 0, 0, 1, 1]) < eps) def test_binary_erosion16(self): "binary erosion 16" for type in self.types: data = numpy.ones([1, 1], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [[1]]) < eps) + self.assertTrue(diff(out, [[1]]) < eps) def test_binary_erosion17(self): "binary erosion 17" for type in self.types: data = numpy.ones([1, 1], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [[0]]) < eps) + self.assertTrue(diff(out, [[0]]) < eps) def test_binary_erosion18(self): "binary erosion 18" for type in self.types: data = numpy.ones([1, 3], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [[0, 0, 0]]) < eps) + self.assertTrue(diff(out, [[0, 0, 0]]) < eps) def test_binary_erosion19(self): "binary erosion 19" for type in self.types: data = numpy.ones([1, 3], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [[1, 1, 1]]) < eps) + self.assertTrue(diff(out, [[1, 1, 1]]) < eps) def test_binary_erosion20(self): "binary erosion 20" for type in self.types: data = numpy.ones([3, 3], type) out = ndimage.binary_erosion(data) - self.failUnless(diff(out, [[0, 0, 0], + self.assertTrue(diff(out, [[0, 0, 0], [0, 1, 0], [0, 0, 0]]) < eps) @@ -4013,7 +4013,7 @@ for type in self.types: data = numpy.ones([3, 3], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, [[1, 1, 1], + self.assertTrue(diff(out, [[1, 1, 1], [1, 1, 1], [1, 1, 1]]) < eps) @@ -4037,7 +4037,7 @@ [0, 1, 1, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_erosion(data, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion23(self): "binary erosion 23" @@ -4061,7 +4061,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_erosion(data, struct, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion24(self): "binary erosion 24" @@ -4086,7 +4086,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_erosion(data, struct, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion25(self): "binary erosion 25" @@ -4112,7 +4112,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_erosion(data, struct, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion26(self): "binary erosion 26" @@ -4138,7 +4138,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_erosion(data, struct, border_value = 1, origin = (-1, -1)) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion27(self): "binary erosion 27" @@ -4161,7 +4161,7 @@ [0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_erosion(data, struct, border_value = 1, iterations = 2) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion28(self): "binary erosion 28" @@ -4185,7 +4185,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_erosion(data, struct, border_value = 1, iterations = 2, output = out) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion29(self): "binary erosion 29" @@ -4208,7 +4208,7 @@ [0, 0, 0, 1, 0, 0, 0]], bool) out = ndimage.binary_erosion(data, struct, border_value = 1, iterations = 3) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion30(self): "binary erosion 30" @@ -4232,7 +4232,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_erosion(data, struct, border_value = 1, iterations = 3, output = out) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion31(self): "binary erosion 31" @@ -4256,7 +4256,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_erosion(data, struct, border_value = 1, iterations = 1, output = out, origin = (-1, -1)) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion32(self): "binary erosion 32" @@ -4279,7 +4279,7 @@ [0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_erosion(data, struct, border_value = 1, iterations = 2) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion33(self): "binary erosion 33" @@ -4309,7 +4309,7 @@ [0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_erosion(data, struct, border_value = 1, mask = mask, iterations = -1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion34(self): "binary erosion 34" @@ -4339,7 +4339,7 @@ [0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_erosion(data, struct, border_value = 1, mask = mask) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion35(self): "binary erosion 35" @@ -4374,7 +4374,7 @@ ndimage.binary_erosion(data, struct, border_value = 1, iterations = 1, output = out, origin = (-1, -1), mask = mask) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_erosion36(self): "binary erosion 36" @@ -4410,49 +4410,49 @@ true = numpy.logical_or(true, tmp) out = ndimage.binary_erosion(data, struct, mask = mask, border_value = 1, origin = (-1, -1)) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation01(self): "binary dilation 1" for type in self.types: data = numpy.ones([], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, 1) < eps) + self.assertTrue(diff(out, 1) < eps) def test_binary_dilation02(self): "binary dilation 2" for type in self.types: data = numpy.zeros([], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, 0) < eps) + self.assertTrue(diff(out, 0) < eps) def test_binary_dilation03(self): "binary dilation 3" for type in self.types: data = numpy.ones([1], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [1]) < eps) + self.assertTrue(diff(out, [1]) < eps) def test_binary_dilation04(self): "binary dilation 4" for type in self.types: data = numpy.zeros([1], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [0]) < eps) + self.assertTrue(diff(out, [0]) < eps) def test_binary_dilation05(self): "binary dilation 5" for type in self.types: data = numpy.ones([3], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1]) < eps) def test_binary_dilation06(self): "binary dilation 6" for type in self.types: data = numpy.zeros([3], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [0, 0, 0]) < eps) + self.assertTrue(diff(out, [0, 0, 0]) < eps) def test_binary_dilation07(self): "binary dilation 7" @@ -4461,7 +4461,7 @@ data = numpy.zeros([3], type) data[1] = 1 out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1]) < eps) def test_binary_dilation08(self): "binary dilation 8" @@ -4470,7 +4470,7 @@ data[1] = 1 data[3] = 1 out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [1, 1, 1, 1, 1]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 1, 1]) < eps) def test_binary_dilation09(self): "binary dilation 9" @@ -4478,7 +4478,7 @@ data = numpy.zeros([5], type) data[1] = 1 out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [1, 1, 1, 0, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 1, 0, 0]) < eps) def test_binary_dilation10(self): "binary dilation 10" @@ -4486,7 +4486,7 @@ data = numpy.zeros([5], type) data[1] = 1 out = ndimage.binary_dilation(data, origin = -1) - self.failUnless(diff(out, [0, 1, 1, 1, 0]) < eps) + self.assertTrue(diff(out, [0, 1, 1, 1, 0]) < eps) def test_binary_dilation11(self): "binary dilation 11" @@ -4494,7 +4494,7 @@ data = numpy.zeros([5], type) data[1] = 1 out = ndimage.binary_dilation(data, origin = 1) - self.failUnless(diff(out, [1, 1, 0, 0, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 0, 0, 0]) < eps) def test_binary_dilation12(self): "binary dilation 12" @@ -4503,7 +4503,7 @@ data[1] = 1 struct = [1, 0, 1] out = ndimage.binary_dilation(data, struct) - self.failUnless(diff(out, [1, 0, 1, 0, 0]) < eps) + self.assertTrue(diff(out, [1, 0, 1, 0, 0]) < eps) def test_binary_dilation13(self): "binary dilation 13" @@ -4513,7 +4513,7 @@ struct = [1, 0, 1] out = ndimage.binary_dilation(data, struct, border_value = 1) - self.failUnless(diff(out, [1, 0, 1, 0, 1]) < eps) + self.assertTrue(diff(out, [1, 0, 1, 0, 1]) < eps) def test_binary_dilation14(self): "binary dilation 14" @@ -4523,7 +4523,7 @@ struct = [1, 0, 1] out = ndimage.binary_dilation(data, struct, origin = -1) - self.failUnless(diff(out, [0, 1, 0, 1, 0]) < eps) + self.assertTrue(diff(out, [0, 1, 0, 1, 0]) < eps) def test_binary_dilation15(self): "binary dilation 15" @@ -4533,35 +4533,35 @@ struct = [1, 0, 1] out = ndimage.binary_dilation(data, struct, origin = -1, border_value = 1) - self.failUnless(diff(out, [1, 1, 0, 1, 0]) < eps) + self.assertTrue(diff(out, [1, 1, 0, 1, 0]) < eps) def test_binary_dilation16(self): "binary dilation 16" for type in self.types: data = numpy.ones([1, 1], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [[1]]) < eps) + self.assertTrue(diff(out, [[1]]) < eps) def test_binary_dilation17(self): "binary dilation 17" for type in self.types: data = numpy.zeros([1, 1], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [[0]]) < eps) + self.assertTrue(diff(out, [[0]]) < eps) def test_binary_dilation18(self): "binary dilation 18" for type in self.types: data = numpy.ones([1, 3], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [[1, 1, 1]]) < eps) + self.assertTrue(diff(out, [[1, 1, 1]]) < eps) def test_binary_dilation19(self): "binary dilation 19" for type in self.types: data = numpy.ones([3, 3], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [[1, 1, 1], + self.assertTrue(diff(out, [[1, 1, 1], [1, 1, 1], [1, 1, 1]]) < eps) @@ -4571,7 +4571,7 @@ data = numpy.zeros([3, 3], type) data[1, 1] = 1 out = ndimage.binary_dilation(data) - self.failUnless(diff(out, [[0, 1, 0], + self.assertTrue(diff(out, [[0, 1, 0], [1, 1, 1], [0, 1, 0]]) < eps) @@ -4582,7 +4582,7 @@ data = numpy.zeros([3, 3], type) data[1, 1] = 1 out = ndimage.binary_dilation(data, struct) - self.failUnless(diff(out, [[1, 1, 1], + self.assertTrue(diff(out, [[1, 1, 1], [1, 1, 1], [1, 1, 1]]) < eps) @@ -4607,7 +4607,7 @@ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation23(self): "binary dilation 23" @@ -4630,7 +4630,7 @@ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation24(self): "binary dilation 24" @@ -4653,7 +4653,7 @@ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, origin = (1, 1)) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation25(self): "binary dilation 25" @@ -4677,7 +4677,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, origin = (1, 1), border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation26(self): "binary dilation 26" @@ -4701,7 +4701,7 @@ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, struct) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation27(self): "binary dilation 27" @@ -4726,7 +4726,7 @@ [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, struct) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation28(self): "binary dilation 28" @@ -4741,7 +4741,7 @@ [0, 0, 0, 0], [0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation29(self): "binary dilation 29" @@ -4760,7 +4760,7 @@ [0, 0, 0, 0, 0]], bool) out = ndimage.binary_dilation(data, struct, iterations = 2) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation30(self): "binary dilation 30" @@ -4780,7 +4780,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_dilation(data, struct, iterations = 2, output = out) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation31(self): "binary dilation 31" @@ -4799,7 +4799,7 @@ [0, 0, 0, 0, 0]], bool) out = ndimage.binary_dilation(data, struct, iterations = 3) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation32(self): "binary dilation 32" @@ -4819,7 +4819,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_dilation(data, struct, iterations = 3, output = out) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation33(self): "binary dilation 33" @@ -4853,7 +4853,7 @@ out = ndimage.binary_dilation(data, struct, iterations = -1, mask = mask, border_value = 0) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation34(self): "binary dilation 34" @@ -4879,7 +4879,7 @@ data = numpy.zeros(mask.shape, bool) out = ndimage.binary_dilation(data, struct, iterations = -1, mask = mask, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_dilation35(self): "binary dilation 35" @@ -4921,7 +4921,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_dilation(data, mask = mask, origin = (1, 1), border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_propagation01(self): "binary propagation 1" @@ -4955,7 +4955,7 @@ out = ndimage.binary_propagation(data, struct, mask = mask, border_value = 0) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_propagation02(self): "binary propagation 2" @@ -4981,7 +4981,7 @@ data = numpy.zeros(mask.shape, bool) out = ndimage.binary_propagation(data, struct, mask = mask, border_value = 1) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_opening01(self): "binary opening 1" @@ -5003,7 +5003,7 @@ [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_opening(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_opening02(self): "binary opening 2" @@ -5026,7 +5026,7 @@ [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_opening(data, struct) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_closing01(self): "binary closing 1" @@ -5048,7 +5048,7 @@ [0, 0, 1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_closing(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_closing02(self): "binary closing 2" @@ -5071,7 +5071,7 @@ [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_closing(data, struct) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_fill_holes01(self): "binary fill holes 1" @@ -5090,7 +5090,7 @@ [0, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_fill_holes(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_fill_holes02(self): "binary fill holes 2" @@ -5109,7 +5109,7 @@ [0, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_fill_holes(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_binary_fill_holes03(self): "binary fill holes 3" @@ -5128,7 +5128,7 @@ [0, 0, 1, 0, 0, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0]], bool) out = ndimage.binary_fill_holes(data) - self.failUnless(diff(out, true) < eps) + self.assertTrue(diff(out, true) < eps) def test_grey_erosion01(self): "grey erosion 1" @@ -5138,7 +5138,7 @@ footprint = [[1, 0, 1], [1, 1, 0]] output = ndimage.grey_erosion(array, footprint = footprint) - self.failUnless(diff([[2, 2, 1, 1, 1], + self.assertTrue(diff([[2, 2, 1, 1, 1], [2, 3, 1, 3, 1], [5, 5, 3, 3, 1]], output) < eps) @@ -5151,7 +5151,7 @@ structure = [[0, 0, 0], [0, 0, 0]] output = ndimage.grey_erosion(array, footprint = footprint, structure = structure) - self.failUnless(diff([[2, 2, 1, 1, 1], + self.assertTrue(diff([[2, 2, 1, 1, 1], [2, 3, 1, 3, 1], [5, 5, 3, 3, 1]], output) < eps) @@ -5164,7 +5164,7 @@ structure = [[1, 1, 1], [1, 1, 1]] output = ndimage.grey_erosion(array, footprint = footprint, structure = structure) - self.failUnless(diff([[1, 1, 0, 0, 0], + self.assertTrue(diff([[1, 1, 0, 0, 0], [1, 2, 0, 2, 0], [4, 4, 2, 2, 0]], output) < eps) @@ -5176,7 +5176,7 @@ footprint = [[0, 1, 1], [1, 0, 1]] output = ndimage.grey_dilation(array, footprint = footprint) - self.failUnless(diff([[7, 7, 9, 9, 5], + self.assertTrue(diff([[7, 7, 9, 9, 5], [7, 9, 8, 9, 7], [8, 8, 8, 7, 7]], output) < eps) @@ -5189,7 +5189,7 @@ structure = [[0, 0, 0], [0, 0, 0]] output = ndimage.grey_dilation(array, footprint = footprint, structure = structure) - self.failUnless(diff([[7, 7, 9, 9, 5], + self.assertTrue(diff([[7, 7, 9, 9, 5], [7, 9, 8, 9, 7], [8, 8, 8, 7, 7]], output) < eps) @@ -5202,7 +5202,7 @@ structure = [[1, 1, 1], [1, 1, 1]] output = ndimage.grey_dilation(array, footprint = footprint, structure = structure) - self.failUnless(diff([[8, 8, 10, 10, 6], + self.assertTrue(diff([[8, 8, 10, 10, 6], [8, 10, 9, 10, 8], [9, 9, 9, 8, 8]], output) < eps) @@ -5216,7 +5216,7 @@ true = ndimage.grey_dilation(tmp, footprint = footprint) output = ndimage.grey_opening(array, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_grey_opening02(self): @@ -5232,7 +5232,7 @@ structure = structure) output = ndimage.grey_opening(array, footprint = footprint, structure = structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_grey_closing01(self): "grey closing 1" @@ -5244,7 +5244,7 @@ true = ndimage.grey_erosion(tmp, footprint = footprint) output = ndimage.grey_closing(array, footprint = footprint) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_grey_closing02(self): "grey closing 2" @@ -5259,7 +5259,7 @@ structure = structure) output = ndimage.grey_closing(array, footprint = footprint, structure = structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_morphological_gradient01(self): "morphological gradient 1" @@ -5276,7 +5276,7 @@ output = numpy.zeros(array.shape, array.dtype) ndimage.morphological_gradient(array, footprint=footprint, structure=structure, output = output) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_morphological_gradient02(self): "morphological gradient 2" @@ -5292,7 +5292,7 @@ true = tmp1 - tmp2 output =ndimage.morphological_gradient(array, footprint=footprint, structure=structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_morphological_laplace01(self): "morphological laplace 1" @@ -5309,7 +5309,7 @@ output = numpy.zeros(array.shape, array.dtype) ndimage.morphological_laplace(array, footprint=footprint, structure=structure, output = output) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_morphological_laplace02(self): "morphological laplace 2" @@ -5325,7 +5325,7 @@ true = tmp1 + tmp2 - 2 * array output = ndimage.morphological_laplace(array, footprint=footprint, structure=structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_white_tophat01(self): "white tophat 1" @@ -5340,7 +5340,7 @@ output = numpy.zeros(array.shape, array.dtype) ndimage.white_tophat(array, footprint=footprint, structure=structure, output = output) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_white_tophat02(self): "white tophat 2" @@ -5354,7 +5354,7 @@ true = array - tmp output = ndimage.white_tophat(array, footprint=footprint, structure=structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_black_tophat01(self): "black tophat 1" @@ -5369,7 +5369,7 @@ output = numpy.zeros(array.shape, array.dtype) ndimage.black_tophat(array, footprint=footprint, structure=structure, output = output) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_black_tophat02(self): "black tophat 2" @@ -5383,7 +5383,7 @@ true = tmp - array output = ndimage.black_tophat(array, footprint=footprint, structure=structure) - self.failUnless(diff(true, output) < eps) + self.assertTrue(diff(true, output) < eps) def test_hit_or_miss01(self): "binary hit-or-miss transform 1" @@ -5410,7 +5410,7 @@ out = numpy.zeros(data.shape, bool) ndimage.binary_hit_or_miss(data, struct, output = out) - self.failUnless(diff(true, out) < eps) + self.assertTrue(diff(true, out) < eps) def test_hit_or_miss02(self): "binary hit-or-miss transform 2" @@ -5427,7 +5427,7 @@ [0, 1, 0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_hit_or_miss(data, struct) - self.failUnless(diff(true, out) < eps) + self.assertTrue(diff(true, out) < eps) def test_hit_or_miss03(self): "binary hit-or-miss transform 3" @@ -5456,7 +5456,7 @@ [0, 0, 0, 0, 0, 0, 0, 0]], type) out = ndimage.binary_hit_or_miss(data, struct1, struct2) - self.failUnless(diff(true, out) < eps) + self.assertTrue(diff(true, out) < eps) #class NDImageTestResult(unittest.TestResult): Modified: trunk/scipy/signal/tests/test_signaltools.py =================================================================== --- trunk/scipy/signal/tests/test_signaltools.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/signal/tests/test_signaltools.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -88,7 +88,7 @@ b = [2,3,4,5,3,4,2,2,1] def _test(): convolve(a,b,'valid',old_behavior=self.old_behavior) - self.failUnlessRaises(ValueError, _test) + self.assertRaises(ValueError, _test) def test_same_mode(self): a = [1,2,3,3,1,2] @@ -200,7 +200,7 @@ # f = [[2,3,4,5,6,7,8],[4,5,6,7,8,9,10]] # def _test(): # convolve2d(e,f,'valid',old_behavior=self.old_behavior) -# self.failUnlessRaises(ValueError, _test) +# self.assertRaises(ValueError, _test) class TestFFTConvolve(TestCase): def test_real(self): @@ -425,8 +425,8 @@ zi = np.ones(0).astype(self.dt) y, zf = lfilter(b, a, x, zi=zi) assert_array_almost_equal(y, x) - self.failUnless(zf.dtype == self.dt) - self.failUnless(zf.size == 0) + self.assertTrue(zf.dtype == self.dt) + self.assertTrue(zf.size == 0) class TestLinearFilterFloat32(_TestLinearFilter): dt = np.float32 @@ -463,19 +463,19 @@ a, b, y_r = self._setup_rank1() y = correlate(a, b, 'valid', old_behavior=False) assert_array_almost_equal(y, y_r[1:4]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank1_same(self): a, b, y_r = self._setup_rank1() y = correlate(a, b, 'same', old_behavior=False) assert_array_almost_equal(y, y_r[:-1]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank1_full(self): a, b, y_r = self._setup_rank1() y = correlate(a, b, 'full', old_behavior=False) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_valid_old(self): @@ -483,7 +483,7 @@ a, b, y_r = self._setup_rank1() y = correlate(b, a, 'valid') assert_array_almost_equal(y, y_r[1:4]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_same_old(self): @@ -491,7 +491,7 @@ a, b, y_r = self._setup_rank1() y = correlate(b, a, 'same') assert_array_almost_equal(y, y_r[:-1]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_full_old(self): @@ -499,7 +499,7 @@ a, b, y_r = self._setup_rank1() y = correlate(b, a, 'full') assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def _setup_rank3(self): a = np.linspace(0, 39, 40).reshape((2, 4, 5), order='F').astype(self.dt) @@ -533,40 +533,40 @@ a, b, y_r = self._setup_rank3() y = correlate(a, b, "valid", old_behavior=False) assert_array_almost_equal(y, y_r[1:2,2:4,3:5]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank3_same(self): a, b, y_r = self._setup_rank3() y = correlate(a, b, "same", old_behavior=False) assert_array_almost_equal(y, y_r[0:-1,1:-1,1:-2]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank3_all(self): a, b, y_r = self._setup_rank3() y = correlate(a, b, old_behavior=False) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank3_valid_old(self): a, b, y_r = self._setup_rank3() y = correlate(b, a, "valid") assert_array_almost_equal(y, y_r[1:2,2:4,3:5]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank3_same_old(self): a, b, y_r = self._setup_rank3() y = correlate(b, a, "same") assert_array_almost_equal(y, y_r[0:-1,1:-1,1:-2]) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank3_all_old(self): a, b, y_r = self._setup_rank3() y = correlate(b, a) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def _get_testcorrelate_class(i, base): class TestCorrelateX(base): @@ -598,19 +598,19 @@ a, b, y_r = self._setup_rank1('valid') y = correlate(a, b, 'valid', old_behavior=False) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank1_same(self): a, b, y_r = self._setup_rank1('same') y = correlate(a, b, 'same', old_behavior=False) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank1_full(self): a, b, y_r = self._setup_rank1('full') y = correlate(a, b, 'full', old_behavior=False) assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) def test_rank3(self): a = np.random.randn(10, 8, 6).astype(self.dt) @@ -625,28 +625,28 @@ y = correlate(a, b, 'full', old_behavior=False) assert_array_almost_equal(y, y_r, decimal=4) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_valid_old(self): a, b, y_r = self._setup_rank1('valid') y = correlate(b, a.conj(), 'valid') assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_same_old(self): a, b, y_r = self._setup_rank1('same') y = correlate(b, a.conj(), 'same') assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank1_full_old(self): a, b, y_r = self._setup_rank1('full') y = correlate(b, a.conj(), 'full') assert_array_almost_equal(y, y_r) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) @dec.deprecated() def test_rank3_old(self): @@ -662,7 +662,7 @@ y = correlate(b, a.conj(), 'full') assert_array_almost_equal(y, y_r, decimal=4) - self.failUnless(y.dtype == self.dt) + self.assertTrue(y.dtype == self.dt) for i in [np.csingle, np.cdouble, np.clongdouble]: cls = _get_testcorrelate_class(i, _TestCorrelateComplex) Modified: trunk/scipy/spatial/tests/test_distance.py =================================================================== --- trunk/scipy/spatial/tests/test_distance.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/spatial/tests/test_distance.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -114,7 +114,7 @@ Y2 = cdist(X1, X2, 'test_euclidean') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_euclidean_random_unicode(self): "Tests cdist(X, u'euclidean') using unicode metric string" @@ -126,7 +126,7 @@ Y2 = cdist(X1, X2, u'test_euclidean') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_sqeuclidean_random(self): "Tests cdist(X, 'sqeuclidean') on random data." @@ -138,7 +138,7 @@ Y2 = cdist(X1, X2, 'test_sqeuclidean') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_cityblock_random(self): "Tests cdist(X, 'cityblock') on random data." @@ -150,7 +150,7 @@ Y2 = cdist(X1, X2, 'test_cityblock') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_hamming_double_random(self): "Tests cdist(X, 'hamming') on random data." @@ -162,7 +162,7 @@ Y2 = cdist(X1, X2, 'test_hamming') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_hamming_bool_random(self): "Tests cdist(X, 'hamming') on random boolean data." @@ -174,7 +174,7 @@ Y2 = cdist(X1, X2, 'test_hamming') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_jaccard_double_random(self): "Tests cdist(X, 'jaccard') on random data." @@ -186,7 +186,7 @@ Y2 = cdist(X1, X2, 'test_jaccard') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_jaccard_bool_random(self): "Tests cdist(X, 'jaccard') on random boolean data." @@ -198,7 +198,7 @@ Y2 = cdist(X1, X2, 'test_jaccard') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_chebychev_random(self): "Tests cdist(X, 'chebychev') on random data." @@ -210,7 +210,7 @@ Y2 = cdist(X1, X2, 'test_chebychev') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_minkowski_random_p3d8(self): "Tests cdist(X, 'minkowski') on random data. (p=3.8)" @@ -222,7 +222,7 @@ Y2 = cdist(X1, X2, 'test_minkowski', p=3.8) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_minkowski_random_p4d6(self): "Tests cdist(X, 'minkowski') on random data. (p=4.6)" @@ -234,7 +234,7 @@ Y2 = cdist(X1, X2, 'test_minkowski', p=4.6) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_minkowski_random_p1d23(self): "Tests cdist(X, 'minkowski') on random data. (p=1.23)" @@ -246,7 +246,7 @@ Y2 = cdist(X1, X2, 'test_minkowski', p=1.23) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_wminkowski_random_p3d8(self): @@ -260,7 +260,7 @@ Y2 = cdist(X1, X2, 'test_wminkowski', p=3.8, w=w) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_wminkowski_random_p4d6(self): "Tests cdist(X, 'wminkowski') on random data. (p=4.6)" @@ -273,7 +273,7 @@ Y2 = cdist(X1, X2, 'test_wminkowski', p=4.6, w=w) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_wminkowski_random_p1d23(self): "Tests cdist(X, 'wminkowski') on random data. (p=1.23)" @@ -286,7 +286,7 @@ Y2 = cdist(X1, X2, 'test_wminkowski', p=1.23, w=w) if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_seuclidean_random(self): @@ -299,7 +299,7 @@ Y2 = cdist(X1, X2, 'test_seuclidean') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_cosine_random(self): @@ -312,7 +312,7 @@ Y2 = cdist(X1, X2, 'test_cosine') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_correlation_random(self): "Tests cdist(X, 'correlation') on random data." @@ -324,7 +324,7 @@ Y2 = cdist(X1, X2, 'test_correlation') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_mahalanobis_random(self): "Tests cdist(X, 'mahalanobis') on random data." @@ -336,7 +336,7 @@ Y2 = cdist(X1, X2, 'test_mahalanobis') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_canberra_random(self): "Tests cdist(X, 'canberra') on random data." @@ -348,7 +348,7 @@ Y2 = cdist(X1, X2, 'test_canberra') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_braycurtis_random(self): "Tests cdist(X, 'braycurtis') on random data." @@ -361,7 +361,7 @@ if verbose > 2: print Y1, Y2 print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_yule_random(self): "Tests cdist(X, 'yule') on random data." @@ -373,7 +373,7 @@ Y2 = cdist(X1, X2, 'test_yule') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_matching_random(self): "Tests cdist(X, 'matching') on random data." @@ -385,7 +385,7 @@ Y2 = cdist(X1, X2, 'test_matching') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_kulsinski_random(self): "Tests cdist(X, 'kulsinski') on random data." @@ -397,7 +397,7 @@ Y2 = cdist(X1, X2, 'test_kulsinski') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_dice_random(self): "Tests cdist(X, 'dice') on random data." @@ -409,7 +409,7 @@ Y2 = cdist(X1, X2, 'test_dice') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_rogerstanimoto_random(self): "Tests cdist(X, 'rogerstanimoto') on random data." @@ -421,7 +421,7 @@ Y2 = cdist(X1, X2, 'test_rogerstanimoto') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_russellrao_random(self): "Tests cdist(X, 'russellrao') on random data." @@ -433,7 +433,7 @@ Y2 = cdist(X1, X2, 'test_russellrao') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_sokalmichener_random(self): "Tests cdist(X, 'sokalmichener') on random data." @@ -445,7 +445,7 @@ Y2 = cdist(X1, X2, 'test_sokalmichener') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) def test_cdist_sokalsneath_random(self): "Tests cdist(X, 'sokalsneath') on random data." @@ -457,7 +457,7 @@ Y2 = cdist(X1, X2, 'test_sokalsneath') if verbose > 2: print (Y1-Y2).max() - self.failUnless(within_tol(Y1, Y2, eps)) + self.assertTrue(within_tol(Y1, Y2, eps)) class TestPdist(TestCase): """ @@ -473,7 +473,7 @@ Y_right = eo['pdist-euclidean'] Y_test1 = pdist(X, 'euclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_euclidean_random_u(self): "Tests pdist(X, 'euclidean') with unicode metric string" @@ -483,7 +483,7 @@ Y_right = eo['pdist-euclidean'] Y_test1 = pdist(X, u'euclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_euclidean_random_float32(self): "Tests pdist(X, 'euclidean') on random data (float32)." @@ -493,7 +493,7 @@ Y_right = eo['pdist-euclidean'] Y_test1 = pdist(X, 'euclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_euclidean_random_nonC(self): "Tests pdist(X, 'test_euclidean') [the non-C implementation] on random data." @@ -502,7 +502,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-euclidean'] Y_test2 = pdist(X, 'test_euclidean') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_euclidean_iris_double(self): "Tests pdist(X, 'euclidean') on the Iris data set." @@ -512,7 +512,7 @@ Y_right = eo['pdist-euclidean-iris'] Y_test1 = pdist(X, 'euclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_euclidean_iris_float32(self): "Tests pdist(X, 'euclidean') on the Iris data set. (float32)" @@ -524,7 +524,7 @@ Y_test1 = pdist(X, 'euclidean') if verbose > 2: print np.abs(Y_right - Y_test1).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_euclidean_iris_nonC(self): "Tests pdist(X, 'test_euclidean') [the non-C implementation] on the Iris data set." @@ -533,7 +533,7 @@ X = eo['iris'] Y_right = eo['pdist-euclidean-iris'] Y_test2 = pdist(X, 'test_euclidean') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: seuclidean def test_pdist_seuclidean_random(self): @@ -544,7 +544,7 @@ Y_right = eo['pdist-seuclidean'] Y_test1 = pdist(X, 'seuclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_seuclidean_random_float32(self): "Tests pdist(X, 'seuclidean') on random data (float32)." @@ -554,7 +554,7 @@ Y_right = eo['pdist-seuclidean'] Y_test1 = pdist(X, 'seuclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_seuclidean_random_nonC(self): "Tests pdist(X, 'test_sqeuclidean') [the non-C implementation] on random data." @@ -563,7 +563,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-seuclidean'] Y_test2 = pdist(X, 'test_sqeuclidean') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_seuclidean_iris(self): "Tests pdist(X, 'seuclidean') on the Iris data set." @@ -573,7 +573,7 @@ Y_right = eo['pdist-seuclidean-iris'] Y_test1 = pdist(X, 'seuclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_seuclidean_iris_float32(self): "Tests pdist(X, 'seuclidean') on the Iris data set (float32)." @@ -583,7 +583,7 @@ Y_right = eo['pdist-seuclidean-iris'] Y_test1 = pdist(X, 'seuclidean') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_seuclidean_iris_nonC(self): "Tests pdist(X, 'test_seuclidean') [the non-C implementation] on the Iris data set." @@ -592,7 +592,7 @@ X = eo['iris'] Y_right = eo['pdist-seuclidean-iris'] Y_test2 = pdist(X, 'test_sqeuclidean') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: cosine def test_pdist_cosine_random(self): @@ -602,7 +602,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-cosine'] Y_test1 = pdist(X, 'cosine') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_cosine_random_float32(self): "Tests pdist(X, 'cosine') on random data. (float32)" @@ -612,7 +612,7 @@ Y_right = eo['pdist-cosine'] Y_test1 = pdist(X, 'cosine') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_cosine_random_nonC(self): "Tests pdist(X, 'test_cosine') [the non-C implementation] on random data." @@ -621,7 +621,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-cosine'] Y_test2 = pdist(X, 'test_cosine') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_cosine_iris(self): "Tests pdist(X, 'cosine') on the Iris data set." @@ -631,7 +631,7 @@ Y_right = eo['pdist-cosine-iris'] Y_test1 = pdist(X, 'cosine') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) #print "cosine-iris", np.abs(Y_test1 - Y_right).max() def test_pdist_cosine_iris_float32(self): @@ -644,7 +644,7 @@ Y_test1 = pdist(X, 'cosine') if verbose > 2: print np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) #print "cosine-iris", np.abs(Y_test1 - Y_right).max() def test_pdist_cosine_iris_nonC(self): @@ -654,7 +654,7 @@ X = eo['iris'] Y_right = eo['pdist-cosine-iris'] Y_test2 = pdist(X, 'test_cosine') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: cityblock def test_pdist_cityblock_random(self): @@ -665,7 +665,7 @@ Y_right = eo['pdist-cityblock'] Y_test1 = pdist(X, 'cityblock') #print "cityblock", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_cityblock_random_float32(self): "Tests pdist(X, 'cityblock') on random data. (float32)" @@ -675,7 +675,7 @@ Y_right = eo['pdist-cityblock'] Y_test1 = pdist(X, 'cityblock') #print "cityblock", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_cityblock_random_nonC(self): "Tests pdist(X, 'test_cityblock') [the non-C implementation] on random data." @@ -684,7 +684,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-cityblock'] Y_test2 = pdist(X, 'test_cityblock') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_cityblock_iris(self): "Tests pdist(X, 'cityblock') on the Iris data set." @@ -694,7 +694,7 @@ Y_right = eo['pdist-cityblock-iris'] Y_test1 = pdist(X, 'cityblock') - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) #print "cityblock-iris", np.abs(Y_test1 - Y_right).max() def test_pdist_cityblock_iris_float32(self): @@ -707,7 +707,7 @@ Y_test1 = pdist(X, 'cityblock') if verbose > 2: print "cityblock-iris-float32", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_cityblock_iris_nonC(self): "Tests pdist(X, 'test_cityblock') [the non-C implementation] on the Iris data set." @@ -716,7 +716,7 @@ X = eo['iris'] Y_right = eo['pdist-cityblock-iris'] Y_test2 = pdist(X, 'test_cityblock') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: correlation def test_pdist_correlation_random(self): @@ -728,7 +728,7 @@ Y_test1 = pdist(X, 'correlation') #print "correlation", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_correlation_random_float32(self): "Tests pdist(X, 'correlation') on random data. (float32)" @@ -739,7 +739,7 @@ Y_test1 = pdist(X, 'correlation') #print "correlation", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_correlation_random_nonC(self): "Tests pdist(X, 'test_correlation') [the non-C implementation] on random data." @@ -748,7 +748,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-correlation'] Y_test2 = pdist(X, 'test_correlation') - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_correlation_iris(self): "Tests pdist(X, 'correlation') on the Iris data set." @@ -759,7 +759,7 @@ Y_test1 = pdist(X, 'correlation') #print "correlation-iris", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_correlation_iris_float32(self): "Tests pdist(X, 'correlation') on the Iris data set. (float32)" @@ -771,7 +771,7 @@ Y_test1 = pdist(X, 'correlation') if verbose > 2: print "correlation-iris", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_correlation_iris_nonC(self): "Tests pdist(X, 'test_correlation') [the non-C implementation] on the Iris data set." @@ -781,7 +781,7 @@ Y_right = eo['pdist-correlation-iris'] Y_test2 = pdist(X, 'test_correlation') #print "test-correlation-iris", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################# minkowski @@ -794,7 +794,7 @@ Y_test1 = pdist(X, 'minkowski', 3.2) #print "minkowski", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_random_float32(self): "Tests pdist(X, 'minkowski') on random data. (float32)" @@ -805,7 +805,7 @@ Y_test1 = pdist(X, 'minkowski', 3.2) #print "minkowski", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_random_nonC(self): "Tests pdist(X, 'test_minkowski') [the non-C implementation] on random data." @@ -814,7 +814,7 @@ X = eo['pdist-double-inp'] Y_right = eo['pdist-minkowski-3.2'] Y_test2 = pdist(X, 'test_minkowski', 3.2) - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_minkowski_3_2_iris(self): "Tests pdist(X, 'minkowski') on iris data." @@ -824,7 +824,7 @@ Y_right = eo['pdist-minkowski-3.2-iris'] Y_test1 = pdist(X, 'minkowski', 3.2) #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_3_2_iris_float32(self): "Tests pdist(X, 'minkowski') on iris data. (float32)" @@ -834,7 +834,7 @@ Y_right = eo['pdist-minkowski-3.2-iris'] Y_test1 = pdist(X, 'minkowski', 3.2) #print "minkowski-iris-3.2", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_3_2_iris_nonC(self): "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data." @@ -843,7 +843,7 @@ X = eo['iris'] Y_right = eo['pdist-minkowski-3.2-iris'] Y_test2 = pdist(X, 'test_minkowski', 3.2) - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_minkowski_5_8_iris(self): "Tests pdist(X, 'minkowski') on iris data." @@ -853,7 +853,7 @@ Y_right = eo['pdist-minkowski-5.8-iris'] Y_test1 = pdist(X, 'minkowski', 5.8) #print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_5_8_iris_float32(self): "Tests pdist(X, 'minkowski') on iris data. (float32)" @@ -865,7 +865,7 @@ Y_test1 = pdist(X, 'minkowski', 5.8) if verbose > 2: print "minkowski-iris-5.8", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_minkowski_5_8_iris_nonC(self): "Tests pdist(X, 'test_minkowski') [the non-C implementation] on iris data." @@ -874,7 +874,7 @@ X = eo['iris'] Y_right = eo['pdist-minkowski-5.8-iris'] Y_test2 = pdist(X, 'test_minkowski', 5.8) - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: hamming def test_pdist_hamming_random(self): @@ -886,7 +886,7 @@ Y_test1 = pdist(X, 'hamming') #print "hamming", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_hamming_random_float32(self): "Tests pdist(X, 'hamming') on random data." @@ -897,7 +897,7 @@ Y_test1 = pdist(X, 'hamming') #print "hamming", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_hamming_random_nonC(self): "Tests pdist(X, 'test_hamming') [the non-C implementation] on random data." @@ -907,7 +907,7 @@ Y_right = eo['pdist-hamming'] Y_test2 = pdist(X, 'test_hamming') #print "test-hamming", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: hamming (double) def test_pdist_dhamming_random(self): @@ -918,7 +918,7 @@ Y_right = eo['pdist-hamming'] Y_test1 = pdist(X, 'hamming') #print "hamming", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_dhamming_random_float32(self): "Tests pdist(X, 'hamming') on random data. (float32)" @@ -928,7 +928,7 @@ Y_right = eo['pdist-hamming'] Y_test1 = pdist(X, 'hamming') #print "hamming", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_dhamming_random_nonC(self): "Tests pdist(X, 'test_hamming') [the non-C implementation] on random data." @@ -938,7 +938,7 @@ Y_right = eo['pdist-hamming'] Y_test2 = pdist(X, 'test_hamming') #print "test-hamming", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: jaccard def test_pdist_jaccard_random(self): @@ -950,7 +950,7 @@ Y_test1 = pdist(X, 'jaccard') #print "jaccard", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_jaccard_random_float32(self): "Tests pdist(X, 'jaccard') on random data. (float32)" @@ -961,7 +961,7 @@ Y_test1 = pdist(X, 'jaccard') #print "jaccard", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_jaccard_random_nonC(self): "Tests pdist(X, 'test_jaccard') [the non-C implementation] on random data." @@ -971,7 +971,7 @@ Y_right = eo['pdist-jaccard'] Y_test2 = pdist(X, 'test_jaccard') #print "test-jaccard", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: jaccard (double) def test_pdist_djaccard_random(self): @@ -983,7 +983,7 @@ Y_test1 = pdist(X, 'jaccard') #print "jaccard", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_djaccard_random_float32(self): "Tests pdist(X, 'jaccard') on random data. (float32)" @@ -994,7 +994,7 @@ Y_test1 = pdist(X, 'jaccard') #print "jaccard", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_djaccard_random_nonC(self): "Tests pdist(X, 'test_jaccard') [the non-C implementation] on random data." @@ -1004,7 +1004,7 @@ Y_right = eo['pdist-jaccard'] Y_test2 = pdist(X, 'test_jaccard') #print "test-jaccard", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) ################### pdist: chebychev def test_pdist_chebychev_random(self): @@ -1016,7 +1016,7 @@ Y_test1 = pdist(X, 'chebychev') #print "chebychev", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_chebychev_random_float32(self): "Tests pdist(X, 'chebychev') on random data. (float32)" @@ -1028,7 +1028,7 @@ Y_test1 = pdist(X, 'chebychev') if verbose > 2: print "chebychev", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_chebychev_random_nonC(self): "Tests pdist(X, 'test_chebychev') [the non-C implementation] on random data." @@ -1038,7 +1038,7 @@ Y_right = eo['pdist-chebychev'] Y_test2 = pdist(X, 'test_chebychev') #print "test-chebychev", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_chebychev_iris(self): "Tests pdist(X, 'chebychev') on the Iris data set." @@ -1048,7 +1048,7 @@ Y_right = eo['pdist-chebychev-iris'] Y_test1 = pdist(X, 'chebychev') #print "chebychev-iris", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_chebychev_iris_float32(self): "Tests pdist(X, 'chebychev') on the Iris data set. (float32)" @@ -1059,7 +1059,7 @@ Y_test1 = pdist(X, 'chebychev') if verbose > 2: print "chebychev-iris", np.abs(Y_test1 - Y_right).max() - self.failUnless(within_tol(Y_test1, Y_right, eps)) + self.assertTrue(within_tol(Y_test1, Y_right, eps)) def test_pdist_chebychev_iris_nonC(self): "Tests pdist(X, 'test_chebychev') [the non-C implementation] on the Iris data set." @@ -1069,7 +1069,7 @@ Y_right = eo['pdist-chebychev-iris'] Y_test2 = pdist(X, 'test_chebychev') #print "test-chebychev-iris", np.abs(Y_test2 - Y_right).max() - self.failUnless(within_tol(Y_test2, Y_right, eps)) + self.assertTrue(within_tol(Y_test2, Y_right, eps)) def test_pdist_matching_mtica1(self): "Tests matching(*,*) with mtica example #1 (nums)." @@ -1077,8 +1077,8 @@ np.array([1, 1, 0, 1, 1])) m2 = matching(np.array([1, 0, 1, 1, 0], dtype=np.bool), np.array([1, 1, 0, 1, 1], dtype=np.bool)) - self.failUnless(np.abs(m - 0.6) <= 1e-10) - self.failUnless(np.abs(m2 - 0.6) <= 1e-10) + self.assertTrue(np.abs(m - 0.6) <= 1e-10) + self.assertTrue(np.abs(m2 - 0.6) <= 1e-10) def test_pdist_matching_mtica2(self): "Tests matching(*,*) with mtica example #2." @@ -1086,8 +1086,8 @@ np.array([1, 1, 0])) m2 = matching(np.array([1, 0, 1], dtype=np.bool), np.array([1, 1, 0], dtype=np.bool)) - self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10) def test_pdist_matching_match(self): "Tests pdist(X, 'matching') to see if the two implementations match on random boolean input data." @@ -1102,8 +1102,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y1-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_jaccard_mtica1(self): "Tests jaccard(*,*) with mtica example #1." @@ -1111,8 +1111,8 @@ np.array([1, 1, 0, 1, 1])) m2 = jaccard(np.array([1, 0, 1, 1, 0], dtype=np.bool), np.array([1, 1, 0, 1, 1], dtype=np.bool)) - self.failUnless(np.abs(m - 0.6) <= 1e-10) - self.failUnless(np.abs(m2 - 0.6) <= 1e-10) + self.assertTrue(np.abs(m - 0.6) <= 1e-10) + self.assertTrue(np.abs(m2 - 0.6) <= 1e-10) def test_pdist_jaccard_mtica2(self): "Tests jaccard(*,*) with mtica example #2." @@ -1120,8 +1120,8 @@ np.array([1, 1, 0])) m2 = jaccard(np.array([1, 0, 1], dtype=np.bool), np.array([1, 1, 0], dtype=np.bool)) - self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10) def test_pdist_jaccard_match(self): "Tests pdist(X, 'jaccard') to see if the two implementations match on random double input data." @@ -1135,8 +1135,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_yule_mtica1(self): "Tests yule(*,*) with mtica example #1." @@ -1146,8 +1146,8 @@ np.array([1, 1, 0, 1, 1], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - 2.0) <= 1e-10) - self.failUnless(np.abs(m2 - 2.0) <= 1e-10) + self.assertTrue(np.abs(m - 2.0) <= 1e-10) + self.assertTrue(np.abs(m2 - 2.0) <= 1e-10) def test_pdist_yule_mtica2(self): "Tests yule(*,*) with mtica example #2." @@ -1157,8 +1157,8 @@ np.array([1, 1, 0], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - 2.0) <= 1e-10) - self.failUnless(np.abs(m2 - 2.0) <= 1e-10) + self.assertTrue(np.abs(m - 2.0) <= 1e-10) + self.assertTrue(np.abs(m2 - 2.0) <= 1e-10) def test_pdist_yule_match(self): "Tests pdist(X, 'yule') to see if the two implementations match on random double input data." @@ -1172,8 +1172,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_dice_mtica1(self): "Tests dice(*,*) with mtica example #1." @@ -1183,8 +1183,8 @@ np.array([1, 1, 0, 1, 1], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (3.0/7.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (3.0/7.0)) <= 1e-10) + self.assertTrue(np.abs(m - (3.0/7.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (3.0/7.0)) <= 1e-10) def test_pdist_dice_mtica2(self): "Tests dice(*,*) with mtica example #2." @@ -1194,8 +1194,8 @@ np.array([1, 1, 0], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - 0.5) <= 1e-10) - self.failUnless(np.abs(m2 - 0.5) <= 1e-10) + self.assertTrue(np.abs(m - 0.5) <= 1e-10) + self.assertTrue(np.abs(m2 - 0.5) <= 1e-10) def test_pdist_dice_match(self): "Tests pdist(X, 'dice') to see if the two implementations match on random double input data." @@ -1209,8 +1209,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_sokalsneath_mtica1(self): "Tests sokalsneath(*,*) with mtica example #1." @@ -1220,8 +1220,8 @@ np.array([1, 1, 0, 1, 1], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (3.0/4.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (3.0/4.0)) <= 1e-10) + self.assertTrue(np.abs(m - (3.0/4.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (3.0/4.0)) <= 1e-10) def test_pdist_sokalsneath_mtica2(self): "Tests sokalsneath(*,*) with mtica example #2." @@ -1231,8 +1231,8 @@ np.array([1, 1, 0], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (4.0/5.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (4.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m - (4.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (4.0/5.0)) <= 1e-10) def test_pdist_sokalsneath_match(self): "Tests pdist(X, 'sokalsneath') to see if the two implementations match on random double input data." @@ -1246,8 +1246,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_rogerstanimoto_mtica1(self): "Tests rogerstanimoto(*,*) with mtica example #1." @@ -1257,8 +1257,8 @@ np.array([1, 1, 0, 1, 1], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (3.0/4.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (3.0/4.0)) <= 1e-10) + self.assertTrue(np.abs(m - (3.0/4.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (3.0/4.0)) <= 1e-10) def test_pdist_rogerstanimoto_mtica2(self): "Tests rogerstanimoto(*,*) with mtica example #2." @@ -1268,8 +1268,8 @@ np.array([1, 1, 0], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (4.0/5.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (4.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m - (4.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (4.0/5.0)) <= 1e-10) def test_pdist_rogerstanimoto_match(self): "Tests pdist(X, 'rogerstanimoto') to see if the two implementations match on random double input data." @@ -1283,8 +1283,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_russellrao_mtica1(self): "Tests russellrao(*,*) with mtica example #1." @@ -1294,8 +1294,8 @@ np.array([1, 1, 0, 1, 1], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (3.0/5.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (3.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m - (3.0/5.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (3.0/5.0)) <= 1e-10) def test_pdist_russellrao_mtica2(self): "Tests russellrao(*,*) with mtica example #2." @@ -1305,8 +1305,8 @@ np.array([1, 1, 0], dtype=np.bool)) if verbose > 2: print m - self.failUnless(np.abs(m - (2.0/3.0)) <= 1e-10) - self.failUnless(np.abs(m2 - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m - (2.0/3.0)) <= 1e-10) + self.assertTrue(np.abs(m2 - (2.0/3.0)) <= 1e-10) def test_pdist_russellrao_match(self): "Tests pdist(X, 'russellrao') to see if the two implementations match on random double input data." @@ -1320,8 +1320,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_sokalmichener_match(self): "Tests pdist(X, 'sokalmichener') to see if the two implementations match on random double input data." @@ -1335,8 +1335,8 @@ if verbose > 2: print np.abs(y1-y2).max() print np.abs(y2-y3).max() - self.failUnless(within_tol(y1, y2, eps)) - self.failUnless(within_tol(y2, y3, eps)) + self.assertTrue(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y2, y3, eps)) def test_pdist_kulsinski_match(self): "Tests pdist(X, 'kulsinski') to see if the two implementations match on random double input data." @@ -1349,7 +1349,7 @@ y3 = pdist(np.bool_(D), "test_kulsinski") if verbose > 2: print np.abs(y1-y2).max() - self.failUnless(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y1, y2, eps)) def test_pdist_canberra_match(self): "Tests pdist(X, 'canberra') to see if the two implementations match on the Iris data set." @@ -1361,7 +1361,7 @@ y2 = pdist(D, "test_canberra") if verbose > 2: print np.abs(y1-y2).max() - self.failUnless(within_tol(y1, y2, eps)) + self.assertTrue(within_tol(y1, y2, eps)) def test_pdist_canberra_ticket_711(self): "Tests pdist(X, 'canberra') to see if Canberra gives the right result as reported in Scipy bug report 711." @@ -1370,7 +1370,7 @@ right_y = 0.01492537 if verbose > 2: print np.abs(pdist_y-right_y).max() - self.failUnless(within_tol(pdist_y, right_y, eps)) + self.assertTrue(within_tol(pdist_y, right_y, eps)) def within_tol(a, b, tol): return np.abs(a - b).max() < tol @@ -1383,28 +1383,28 @@ "Tests squareform on an empty matrix." A = np.zeros((0,0)) rA = squareform(np.array(A, dtype='double')) - self.failUnless(rA.shape == (0,)) + self.assertTrue(rA.shape == (0,)) def test_squareform_empty_vector(self): "Tests squareform on an empty vector." v = np.zeros((0,)) rv = squareform(np.array(v, dtype='double')) - self.failUnless(rv.shape == (1,1)) - self.failUnless(rv[0, 0] == 0) + self.assertTrue(rv.shape == (1,1)) + self.assertTrue(rv[0, 0] == 0) def test_squareform_1by1_matrix(self): "Tests squareform on a 1x1 matrix." A = np.zeros((1,1)) rA = squareform(np.array(A, dtype='double')) - self.failUnless(rA.shape == (0,)) + self.assertTrue(rA.shape == (0,)) def test_squareform_one_vector(self): "Tests squareform on a 1-D array, length=1." v = np.ones((1,)) * 8.3 rv = squareform(np.array(v, dtype='double')) - self.failUnless(rv.shape == (2,2)) - self.failUnless(rv[0,1] == 8.3) - self.failUnless(rv[1,0] == 8.3) + self.assertTrue(rv.shape == (2,2)) + self.assertTrue(rv[0,1] == 8.3) + self.assertTrue(rv[1,0] == 8.3) def test_squareform_2by2_matrix(self): "Tests squareform on a 2x2 matrix." @@ -1412,8 +1412,8 @@ A[0,1]=0.8 A[1,0]=0.8 rA = squareform(np.array(A, dtype='double')) - self.failUnless(rA.shape == (1,)) - self.failUnless(rA[0] == 0.8) + self.assertTrue(rA.shape == (1,)) + self.assertTrue(rA[0] == 0.8) def test_squareform_multi_matrix(self): "Tests squareform on a square matrices of multiple sizes." @@ -1423,24 +1423,24 @@ def check_squareform_multi_matrix(self, n): X = np.random.rand(n, 4) Y = pdist(X) - self.failUnless(len(Y.shape) == 1) + self.assertTrue(len(Y.shape) == 1) A = squareform(Y) Yr = squareform(A) s = A.shape k = 0 if verbose >= 3: print A.shape, Y.shape, Yr.shape - self.failUnless(len(s) == 2) - self.failUnless(len(Yr.shape) == 1) - self.failUnless(s[0] == s[1]) + self.assertTrue(len(s) == 2) + self.assertTrue(len(Yr.shape) == 1) + self.assertTrue(s[0] == s[1]) for i in xrange(0, s[0]): for j in xrange(i+1, s[1]): if i != j: #print i, j, k, A[i, j], Y[k] - self.failUnless(A[i, j] == Y[k]) + self.assertTrue(A[i, j] == Y[k]) k += 1 else: - self.failUnless(A[i, j] == 0) + self.assertTrue(A[i, j] == 0) class TestNumObsY(TestCase): @@ -1450,23 +1450,23 @@ X = np.random.rand(n, 4) Y = pdist(X) #print A.shape, Y.shape, Yr.shape - self.failUnless(num_obs_y(Y) == n) + self.assertTrue(num_obs_y(Y) == n) def test_num_obs_y_1(self): "Tests num_obs_y(y) on a condensed distance matrix over 1 observations. Expecting exception." - self.failUnlessRaises(ValueError, self.check_y, 1) + self.assertRaises(ValueError, self.check_y, 1) def test_num_obs_y_2(self): "Tests num_obs_y(y) on a condensed distance matrix over 2 observations." - self.failUnless(self.check_y(2)) + self.assertTrue(self.check_y(2)) def test_num_obs_y_3(self): "Tests num_obs_y(y) on a condensed distance matrix over 3 observations." - self.failUnless(self.check_y(3)) + self.assertTrue(self.check_y(3)) def test_num_obs_y_4(self): "Tests num_obs_y(y) on a condensed distance matrix over 4 observations." - self.failUnless(self.check_y(4)) + self.assertTrue(self.check_y(4)) def test_num_obs_y_5_10(self): "Tests num_obs_y(y) on a condensed distance matrix between 5 and 15 observations." @@ -1480,10 +1480,10 @@ a.add(n*(n-1)/2) for i in xrange(5, 105): if i not in a: - self.failUnlessRaises(ValueError, self.bad_y, i) + self.assertRaises(ValueError, self.bad_y, i) def minit(self, n): - self.failUnless(self.check_y(n)) + self.assertTrue(self.check_y(n)) def bad_y(self, n): y = np.random.rand(n) @@ -1506,27 +1506,27 @@ A = squareform(Y) if verbose >= 3: print A.shape, Y.shape - self.failUnless(num_obs_dm(A) == n) + self.assertTrue(num_obs_dm(A) == n) def test_num_obs_dm_0(self): "Tests num_obs_dm(D) on a 0x0 distance matrix. Expecting exception." - self.failUnless(self.check_D(0)) + self.assertTrue(self.check_D(0)) def test_num_obs_dm_1(self): "Tests num_obs_dm(D) on a 1x1 distance matrix." - self.failUnless(self.check_D(1)) + self.assertTrue(self.check_D(1)) def test_num_obs_dm_2(self): "Tests num_obs_dm(D) on a 2x2 distance matrix." - self.failUnless(self.check_D(2)) + self.assertTrue(self.check_D(2)) def test_num_obs_dm_3(self): "Tests num_obs_dm(D) on a 3x3 distance matrix." - self.failUnless(self.check_D(2)) + self.assertTrue(self.check_D(2)) def test_num_obs_dm_4(self): "Tests num_obs_dm(D) on a 4x4 distance matrix." - self.failUnless(self.check_D(4)) + self.assertTrue(self.check_D(4)) def check_D(self, n): return num_obs_dm(self.make_D(n)) == n @@ -1542,32 +1542,32 @@ def test_is_valid_dm_int16_array_E(self): "Tests is_valid_dm(*) on an int16 array. Exception expected." D = np.zeros((5, 5), dtype='i') - self.failUnlessRaises(TypeError, is_valid_dm_throw, (D)) + self.assertRaises(TypeError, is_valid_dm_throw, (D)) def test_is_valid_dm_int16_array_F(self): "Tests is_valid_dm(*) on an int16 array. False expected." D = np.zeros((5, 5), dtype='i') - self.failUnless(is_valid_dm(D) == False) + self.assertTrue(is_valid_dm(D) == False) def test_is_valid_dm_improper_shape_1D_E(self): "Tests is_valid_dm(*) on a 1D array. Exception expected." D = np.zeros((5,), dtype=np.double) - self.failUnlessRaises(ValueError, is_valid_dm_throw, (D)) + self.assertRaises(ValueError, is_valid_dm_throw, (D)) def test_is_valid_dm_improper_shape_1D_F(self): "Tests is_valid_dm(*) on a 1D array. False expected." D = np.zeros((5,), dtype=np.double) - self.failUnless(is_valid_dm(D) == False) + self.assertTrue(is_valid_dm(D) == False) def test_is_valid_dm_improper_shape_3D_E(self): "Tests is_valid_dm(*) on a 3D array. Exception expected." D = np.zeros((3,3,3), dtype=np.double) - self.failUnlessRaises(ValueError, is_valid_dm_throw, (D)) + self.assertRaises(ValueError, is_valid_dm_throw, (D)) def test_is_valid_dm_improper_shape_3D_F(self): "Tests is_valid_dm(*) on a 3D array. False expected." D = np.zeros((3,3,3), dtype=np.double) - self.failUnless(is_valid_dm(D) == False) + self.assertTrue(is_valid_dm(D) == False) def test_is_valid_dm_nonzero_diagonal_E(self): "Tests is_valid_dm(*) on a distance matrix with a nonzero diagonal. Exception expected." @@ -1575,7 +1575,7 @@ D = squareform(y) for i in xrange(0, 5): D[i, i] = 2.0 - self.failUnlessRaises(ValueError, is_valid_dm_throw, (D)) + self.assertRaises(ValueError, is_valid_dm_throw, (D)) def test_is_valid_dm_nonzero_diagonal_F(self): "Tests is_valid_dm(*) on a distance matrix with a nonzero diagonal. False expected." @@ -1583,50 +1583,50 @@ D = squareform(y) for i in xrange(0, 5): D[i, i] = 2.0 - self.failUnless(is_valid_dm(D) == False) + self.assertTrue(is_valid_dm(D) == False) def test_is_valid_dm_assymetric_E(self): "Tests is_valid_dm(*) on an assymetric distance matrix. Exception expected." y = np.random.rand(10) D = squareform(y) D[1,3] = D[3,1] + 1 - self.failUnlessRaises(ValueError, is_valid_dm_throw, (D)) + self.assertRaises(ValueError, is_valid_dm_throw, (D)) def test_is_valid_dm_assymetric_F(self): "Tests is_valid_dm(*) on an assymetric distance matrix. False expected." y = np.random.rand(10) D = squareform(y) D[1,3] = D[3,1] + 1 - self.failUnless(is_valid_dm(D) == False) + self.assertTrue(is_valid_dm(D) == False) def test_is_valid_dm_correct_1_by_1(self): "Tests is_valid_dm(*) on a correct 1x1. True expected." D = np.zeros((1,1), dtype=np.double) - self.failUnless(is_valid_dm(D) == True) + self.assertTrue(is_valid_dm(D) == True) def test_is_valid_dm_correct_2_by_2(self): "Tests is_valid_dm(*) on a correct 2x2. True expected." y = np.random.rand(1) D = squareform(y) - self.failUnless(is_valid_dm(D) == True) + self.assertTrue(is_valid_dm(D) == True) def test_is_valid_dm_correct_3_by_3(self): "Tests is_valid_dm(*) on a correct 3x3. True expected." y = np.random.rand(3) D = squareform(y) - self.failUnless(is_valid_dm(D) == True) + self.assertTrue(is_valid_dm(D) == True) def test_is_valid_dm_correct_4_by_4(self): "Tests is_valid_dm(*) on a correct 4x4. True expected." y = np.random.rand(6) D = squareform(y) - self.failUnless(is_valid_dm(D) == True) + self.assertTrue(is_valid_dm(D) == True) def test_is_valid_dm_correct_5_by_5(self): "Tests is_valid_dm(*) on a correct 5x5. True expected." y = np.random.rand(10) D = squareform(y) - self.failUnless(is_valid_dm(D) == True) + self.assertTrue(is_valid_dm(D) == True) def is_valid_y_throw(y): return is_valid_y(y, throw=True) @@ -1636,52 +1636,52 @@ def test_is_valid_y_int16_array_E(self): "Tests is_valid_y(*) on an int16 array. Exception expected." y = np.zeros((10,), dtype='i') - self.failUnlessRaises(TypeError, is_valid_y_throw, (y)) + self.assertRaises(TypeError, is_valid_y_throw, (y)) def test_is_valid_y_int16_array_F(self): "Tests is_valid_y(*) on an int16 array. False expected." y = np.zeros((10,), dtype='i') - self.failUnless(is_valid_y(y) == False) + self.assertTrue(is_valid_y(y) == False) def test_is_valid_y_improper_shape_2D_E(self): "Tests is_valid_y(*) on a 2D array. Exception expected." y = np.zeros((3,3,), dtype=np.double) - self.failUnlessRaises(ValueError, is_valid_y_throw, (y)) + self.assertRaises(ValueError, is_valid_y_throw, (y)) def test_is_valid_y_improper_shape_2D_F(self): "Tests is_valid_y(*) on a 2D array. False expected." y = np.zeros((3,3,), dtype=np.double) - self.failUnless(is_valid_y(y) == False) + self.assertTrue(is_valid_y(y) == False) def test_is_valid_y_improper_shape_3D_E(self): "Tests is_valid_y(*) on a 3D array. Exception expected." y = np.zeros((3,3,3), dtype=np.double) - self.failUnlessRaises(ValueError, is_valid_y_throw, (y)) + self.assertRaises(ValueError, is_valid_y_throw, (y)) def test_is_valid_y_improper_shape_3D_F(self): "Tests is_valid_y(*) on a 3D array. False expected." y = np.zeros((3,3,3), dtype=np.double) - self.failUnless(is_valid_y(y) == False) + self.assertTrue(is_valid_y(y) == False) def test_is_valid_y_correct_2_by_2(self): "Tests is_valid_y(*) on a correct 2x2 condensed. True expected." y = self.correct_n_by_n(2) - self.failUnless(is_valid_y(y) == True) + self.assertTrue(is_valid_y(y) == True) def test_is_valid_y_correct_3_by_3(self): "Tests is_valid_y(*) on a correct 3x3 condensed. True expected." y = self.correct_n_by_n(3) - self.failUnless(is_valid_y(y) == True) + self.assertTrue(is_valid_y(y) == True) def test_is_valid_y_correct_4_by_4(self): "Tests is_valid_y(*) on a correct 4x4 condensed. True expected." y = self.correct_n_by_n(4) - self.failUnless(is_valid_y(y) == True) + self.assertTrue(is_valid_y(y) == True) def test_is_valid_y_correct_5_by_5(self): "Tests is_valid_y(*) on a correct 5x5 condensed. True expected." y = self.correct_n_by_n(5) - self.failUnless(is_valid_y(y) == True) + self.assertTrue(is_valid_y(y) == True) def test_is_valid_y_2_100(self): "Tests is_valid_y(*) on 100 improper condensed distance matrices. Expecting exception." @@ -1690,7 +1690,7 @@ a.add(n*(n-1)/2) for i in xrange(5, 105): if i not in a: - self.failUnlessRaises(ValueError, self.bad_y, i) + self.assertRaises(ValueError, self.bad_y, i) def bad_y(self, n): y = np.random.rand(n) Modified: trunk/scipy/stats/tests/test_distributions.py =================================================================== --- trunk/scipy/stats/tests/test_distributions.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/stats/tests/test_distributions.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -356,9 +356,9 @@ def test_docstrings(self): """See ticket #761""" if stats.rayleigh.__doc__ is not None: - self.failUnless("rayleigh" in stats.rayleigh.__doc__.lower()) + self.assertTrue("rayleigh" in stats.rayleigh.__doc__.lower()) if stats.bernoulli.__doc__ is not None: - self.failUnless("bernoulli" in stats.bernoulli.__doc__.lower()) + self.assertTrue("bernoulli" in stats.bernoulli.__doc__.lower()) class TestEntropy(TestCase): def test_entropy_positive(self): Modified: trunk/scipy/weave/tests/test_size_check.py =================================================================== --- trunk/scipy/weave/tests/test_size_check.py 2010-09-13 19:53:39 UTC (rev 6804) +++ trunk/scipy/weave/tests/test_size_check.py 2010-09-13 21:20:07 UTC (rev 6805) @@ -40,7 +40,7 @@ desired = desired assert_array_equal(actual,desired) def generic_error_check(self,x,y): - self.failUnlessRaises(ValueError, size_check.binary_op_size, x, y) + self.assertRaises(ValueError, size_check.binary_op_size, x, y) def desired_type(self,val): return np.array(val) From scipy-svn at scipy.org Tue Sep 14 19:07:54 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 14 Sep 2010 18:07:54 -0500 (CDT) Subject: [Scipy-svn] r6806 - trunk/scipy/interpolate Message-ID: <20100914230754.B931139CD4D@scipy.org> Author: ptvirtan Date: 2010-09-14 18:07:54 -0500 (Tue, 14 Sep 2010) New Revision: 6806 Modified: trunk/scipy/interpolate/interpnd.pyx Log: BUG: interpolate: do not use fmax, since it's a C99-only function Modified: trunk/scipy/interpolate/interpnd.pyx =================================================================== --- trunk/scipy/interpolate/interpnd.pyx 2010-09-13 21:20:07 UTC (rev 6805) +++ trunk/scipy/interpolate/interpnd.pyx 2010-09-14 23:07:54 UTC (rev 6806) @@ -37,14 +37,12 @@ cdef extern from "math.h": double sqrt(double x) nogil - double fmax(double a, double b) nogil double fabs(double a) nogil cdef extern from "numpy/ndarrayobject.h": cdef enum: NPY_MAXDIMS - #------------------------------------------------------------------------------ # Interpolator base class #------------------------------------------------------------------------------ @@ -427,15 +425,15 @@ r[0] = ( Q[3]*s[0] - Q[1]*s[1])/det r[1] = (-Q[2]*s[0] + Q[0]*s[1])/det - change = fmax(fabs(y[it.vertex*2 + 0] + r[0]), - fabs(y[it.vertex*2 + 1] + r[1])) + change = max(fabs(y[it.vertex*2 + 0] + r[0]), + fabs(y[it.vertex*2 + 1] + r[1])) y[it.vertex*2 + 0] = -r[0] y[it.vertex*2 + 1] = -r[1] # relative/absolute error - change /= fmax(1.0, fmax(fabs(r[0]), fabs(r[1]))) - err = fmax(err, change) + change /= max(1.0, max(fabs(r[0]), fabs(r[1]))) + err = max(err, change) if err < tol: return iiter + 1 From scipy-svn at scipy.org Tue Sep 14 19:08:08 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 14 Sep 2010 18:08:08 -0500 (CDT) Subject: [Scipy-svn] r6807 - in trunk/scipy/lib: blas lapack Message-ID: <20100914230808.B4C1239CD4D@scipy.org> Author: ptvirtan Date: 2010-09-14 18:08:08 -0500 (Tue, 14 Sep 2010) New Revision: 6807 Modified: trunk/scipy/lib/blas/atlas_version.c trunk/scipy/lib/lapack/atlas_version.c Log: BUG: lib: make atlas_version.c's Py3 compatible (fixes #1280) Modified: trunk/scipy/lib/blas/atlas_version.c =================================================================== --- trunk/scipy/lib/blas/atlas_version.c 2010-09-14 23:07:54 UTC (rev 6806) +++ trunk/scipy/lib/blas/atlas_version.c 2010-09-14 23:08:08 UTC (rev 6807) @@ -1,4 +1,5 @@ #include "Python.h" +#include "numpy/npy_3kcompat.h" static PyObject* version(PyObject* self, PyObject* dummy) { @@ -20,14 +21,41 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "atlas_version", + NULL, + -1, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit_atlas_version(void) +{ +#define RETVAL m + PyObject *m; + m = PyModule_Create(&moduledef); +#else +#define RETVAL PyMODINIT_FUNC initatlas_version(void) { PyObject *m = NULL; m = Py_InitModule("atlas_version", module_methods); +#endif + if (m == NULL) { + return RETVAL; + } #if defined(ATLAS_INFO) { PyObject *d = PyModule_GetDict(m); - PyDict_SetItemString(d,"ATLAS_VERSION",PyString_FromString(ATLAS_INFO)); + PyDict_SetItemString(d,"ATLAS_VERSION", + PyUString_FromString(ATLAS_INFO)); } #endif + return RETVAL; } Modified: trunk/scipy/lib/lapack/atlas_version.c =================================================================== --- trunk/scipy/lib/lapack/atlas_version.c 2010-09-14 23:07:54 UTC (rev 6806) +++ trunk/scipy/lib/lapack/atlas_version.c 2010-09-14 23:08:08 UTC (rev 6807) @@ -1,4 +1,5 @@ #include "Python.h" +#include "numpy/npy_3kcompat.h" static PyObject* version(PyObject* self, PyObject* dummy) { @@ -20,14 +21,41 @@ {NULL, NULL, 0, NULL} }; +#if PY_VERSION_HEX >= 0x03000000 + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "atlas_version", + NULL, + -1, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit_atlas_version(void) +{ +#define RETVAL m + PyObject *m; + m = PyModule_Create(&moduledef); +#else +#define RETVAL PyMODINIT_FUNC initatlas_version(void) { PyObject *m = NULL; m = Py_InitModule("atlas_version", module_methods); +#endif + if (m == NULL) { + return RETVAL; + } #if defined(ATLAS_INFO) { PyObject *d = PyModule_GetDict(m); - PyDict_SetItemString(d,"ATLAS_VERSION",PyString_FromString(ATLAS_INFO)); + PyDict_SetItemString(d,"ATLAS_VERSION", + PyUString_FromString(ATLAS_INFO)); } #endif + return RETVAL; } From scipy-svn at scipy.org Tue Sep 14 19:08:20 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Tue, 14 Sep 2010 18:08:20 -0500 (CDT) Subject: [Scipy-svn] r6808 - trunk/scipy/interpolate Message-ID: <20100914230820.92AE639CD4D@scipy.org> Author: ptvirtan Date: 2010-09-14 18:08:20 -0500 (Tue, 14 Sep 2010) New Revision: 6808 Modified: trunk/scipy/interpolate/interpnd.c Log: GEN: interpolate: regenerate interpnd.c Modified: trunk/scipy/interpolate/interpnd.c =================================================================== --- trunk/scipy/interpolate/interpnd.c 2010-09-14 23:08:08 UTC (rev 6807) +++ trunk/scipy/interpolate/interpnd.c 2010-09-14 23:08:20 UTC (rev 6808) @@ -825,10 +825,10 @@ static char __pyx_k_28[] = "LinearNDInterpolator"; static char __pyx_k_29[] = "\n CloughTocher2DInterpolator(points, values, tol=1e-6)\n\n Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D. \n\n .. versionadded:: 0.9\n\n Parameters\n ----------\n points : ndarray of floats, shape (npoints, ndims)\n Data point coordinates.\n values : ndarray of float or complex, shape (npoints, ...)\n Data values.\n fill_value : float, optional\n Value used to fill in for requested points outside of the\n convex hull of the input points. If not provided, then\n the default is ``nan``.\n tol : float, optional\n Absolute/relative tolerance for gradient estimation.\n maxiter : int, optional\n Maximum number of iterations in gradient estimation.\n\n Notes\n -----\n The interpolant is constructed by triangulating the input data\n with Qhull [Qhull]_, and constructing a piecewise cubic\n interpolating Bezier polynomial on each triangle, using a\n Clough-Tocher scheme [CT]_. The interpolant is guaranteed to be\n continuously differentiable.\n\n The gradients of the interpolant are chosen so that the curvature\n of the interpolating surface is approximatively minimized. The\n gradients necessary for this are estimated using the global\n algorithm described in [Nielson83,Renka84]_.\n\n References\n ----------\n\n .. [Qhull] http://www.qhull.org/\n\n .. [CT] See, for example,\n P. Alfeld,\n ''A trivariate Clough-Tocher scheme for tetrahedral data''.\n Computer Aided Geometric Design, 1, 169 (1984);\n G. Farin,\n ''Triangular Bernstein-Bezier patches''.\n Computer Aided Geometric Design, 3, 83 (1986).\n\n .. [Nielson83] G. Nielson,\n ''A method for interpolating scattered data based upon a minimum norm\n network''.\n Math. Comp., 40, 253 (1983).\n\n .. [Renka84] R. J. Renka and A. K. Cline.\n ''A Triangle-based C1 interpolation method.'',\n Rocky Mountain J. Math., 14, 223 (1984).\n\n "; static char __pyx_k_30[] = "CloughTocher2DInterpolator"; -static char __pyx_k_31[] = "NDInterpolatorBase.__init__ (line 60)"; -static char __pyx_k_32[] = "NDInterpolatorBase._check_init_shape (line 93)"; -static char __pyx_k_33[] = "NDInterpolatorBase.__call__ (line 114)"; -static char __pyx_k_34[] = "_ndim_coords_from_arrays (line 139)"; +static char __pyx_k_31[] = "NDInterpolatorBase.__init__ (line 58)"; +static char __pyx_k_32[] = "NDInterpolatorBase._check_init_shape (line 91)"; +static char __pyx_k_33[] = "NDInterpolatorBase.__call__ (line 112)"; +static char __pyx_k_34[] = "_ndim_coords_from_arrays (line 137)"; static char __pyx_k__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -1086,13 +1086,13 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values); if (likely(values[2])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -1106,7 +1106,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -1131,7 +1131,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase.__init__"); __Pyx_RefNannyFinishContext(); @@ -1141,14 +1141,14 @@ __Pyx_INCREF(__pyx_v_values); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1157,17 +1157,17 @@ __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1176,9 +1176,9 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_init_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_init_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_points); @@ -1186,10 +1186,10 @@ __Pyx_INCREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndim), __pyx_v_ndim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__ndim), __pyx_v_ndim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1197,33 +1197,33 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1232,28 +1232,28 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values_shape, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values_shape, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - __pyx_t_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1261,60 +1261,60 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetItem(__pyx_v_values, __pyx_t_3); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetItem(__pyx_v_values, __pyx_t_3); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6; } - __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_v_values) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_v_values) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } { - __pyx_t_3 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__prod); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__prod); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PySequence_GetSlice(__pyx_t_1, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_GetSlice(__pyx_t_1, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -1322,34 +1322,34 @@ __Pyx_GIVEREF(__pyx_t_6); __pyx_t_2 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L6:; - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__issubdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__issubdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__complexfloating); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__complexfloating); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -1357,92 +1357,92 @@ __Pyx_GIVEREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__is_complex, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__is_complex, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_complex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_complex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__astype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_fill_value); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fill_value); __Pyx_GIVEREF(__pyx_v_fill_value); - __pyx_t_2 = PyObject_Call(((PyObject*)&PyComplex_Type), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject*)&PyComplex_Type), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__fill_value, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__fill_value, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7; } { - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__values, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_fill_value); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyFloat_FromDouble(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_fill_value); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyFloat_FromDouble(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__fill_value, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__fill_value, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_L7:; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -1503,13 +1503,13 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values); if (likely(values[2])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -1518,7 +1518,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_init_shape") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_init_shape") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -1539,7 +1539,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_check_init_shape", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_init_shape"); __Pyx_RefNannyFinishContext(); @@ -1547,91 +1547,91 @@ __pyx_L4_argument_unpacking_done:; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_int_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_4)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -1639,15 +1639,15 @@ __pyx_t_4 = (__pyx_v_ndim != Py_None); if (__pyx_t_4) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_ndim, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_ndim, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_5; } else { @@ -1656,19 +1656,19 @@ if (__pyx_t_6) { - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } __pyx_L9:; @@ -1720,11 +1720,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_check_call_shape", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_check_call_shape", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_call_shape") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_call_shape") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -1736,7 +1736,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_check_call_shape", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_check_call_shape", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase._check_call_shape"); __Pyx_RefNannyFinishContext(); @@ -1745,17 +1745,17 @@ __Pyx_INCREF(__pyx_v_xi); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -1764,39 +1764,39 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; @@ -1859,11 +1859,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -1875,7 +1875,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.NDInterpolatorBase.__call__"); __Pyx_RefNannyFinishContext(); @@ -1886,14 +1886,14 @@ __pyx_v_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1902,14 +1902,14 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_call_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_call_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1918,33 +1918,33 @@ __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1953,34 +1953,34 @@ __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PySequence_GetSlice(__pyx_v_shape, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_v_shape, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -1988,7 +1988,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -1997,21 +1997,21 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___evaluate_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___evaluate_complex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2023,14 +2023,14 @@ { - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___evaluate_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___evaluate_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -2042,22 +2042,22 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_r, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2118,9 +2118,9 @@ __pyx_t_3 = __pyx_t_1; } if (__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_points); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_points); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_points, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_points, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_TypeCheck(__pyx_t_4, ((PyTypeObject *)((PyObject*)__pyx_ptype_5numpy_ndarray))); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2135,14 +2135,14 @@ if (__pyx_t_1) { - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__broadcast_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__broadcast_arrays); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PySequence_Tuple(__pyx_v_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PySequence_Tuple(__pyx_v_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; @@ -2151,10 +2151,10 @@ __pyx_t_7 = 0; - __pyx_t_9 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_1); @@ -2162,13 +2162,13 @@ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_builtin_xrange, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_8 = 0; __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -2182,7 +2182,7 @@ } else { __pyx_t_7 = PyIter_Next(__pyx_t_4); if (!__pyx_t_7) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_7); @@ -2192,36 +2192,36 @@ __pyx_t_7 = 0; - __pyx_t_7 = PyObject_GetItem(__pyx_v_p, __pyx_v_j); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetItem(__pyx_v_p, __pyx_v_j); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_10, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_8)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_10, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; @@ -2229,37 +2229,37 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyFloat_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_10, __pyx_t_6, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)&PyFloat_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_10, __pyx_t_6, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -2274,7 +2274,7 @@ if (PyList_CheckExact(__pyx_v_p) || PyTuple_CheckExact(__pyx_v_p)) { __pyx_t_8 = 0; __pyx_t_4 = __pyx_v_p; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_p); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } for (;;) { @@ -2287,7 +2287,7 @@ } else { __pyx_t_6 = PyIter_Next(__pyx_t_4); if (!__pyx_t_6) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_6); @@ -2298,14 +2298,14 @@ __Pyx_INCREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_j); __pyx_v_j = __pyx_t_7; - __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_6, 0, Py_Ellipsis); @@ -2313,7 +2313,7 @@ __Pyx_INCREF(__pyx_v_j); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); - if (PyObject_SetItem(__pyx_v_points, __pyx_t_6, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_points, __pyx_t_6, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -2323,17 +2323,17 @@ { - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -2406,13 +2406,13 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values); if (likely(values[2])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -2421,7 +2421,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -2442,7 +2442,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator.__init__"); __Pyx_RefNannyFinishContext(); @@ -2450,12 +2450,12 @@ __pyx_L4_argument_unpacking_done:; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); @@ -2466,10 +2466,10 @@ __Pyx_INCREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fill_value), __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fill_value), __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -2477,21 +2477,21 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__qhull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__qhull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tri, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tri, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2609,11 +2609,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_double") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_double") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = ((PyArrayObject *)values[1]); @@ -2625,7 +2625,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator._evaluate_double"); __Pyx_RefNannyFinishContext(); @@ -2638,24 +2638,24 @@ __pyx_bstruct_points.buf = NULL; __pyx_bstruct_vertices.buf = NULL; __pyx_bstruct_xi.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_xi = __pyx_bstruct_xi.strides[0]; __pyx_bstride_1_xi = __pyx_bstruct_xi.strides[1]; __pyx_bshape_0_xi = __pyx_bstruct_xi.shape[0]; __pyx_bshape_1_xi = __pyx_bstruct_xi.shape[1]; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1]; __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1]; } @@ -2665,15 +2665,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -2683,18 +2683,18 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -2710,35 +2710,35 @@ __pyx_v_start = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_fill_value = __pyx_t_6; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_t_4, 1, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -2746,26 +2746,26 @@ __Pyx_GIVEREF(__pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2782,7 +2782,7 @@ } __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1]; __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1]; - if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_out)); @@ -2793,29 +2793,29 @@ __pyx_v_nvalues = (__pyx_v_out->dimensions[1]); - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__finfo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__finfo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__eps); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__eps); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_eps); @@ -2833,7 +2833,7 @@ __pyx_v_i = __pyx_t_11; - __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L7;} + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L7;} __pyx_v_isimplex = __pyx_f_5scipy_7spatial_5qhull__find_simplex(__pyx_v_info, __pyx_v_c, (((double *)__pyx_v_xi->data) + (__pyx_v_i * __pyx_v_ndim)), (&__pyx_v_start), __pyx_t_6); @@ -3072,11 +3072,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_complex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_complex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = ((PyArrayObject *)values[1]); @@ -3088,7 +3088,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.LinearNDInterpolator._evaluate_complex"); __Pyx_RefNannyFinishContext(); @@ -3101,24 +3101,24 @@ __pyx_bstruct_points.buf = NULL; __pyx_bstruct_vertices.buf = NULL; __pyx_bstruct_xi.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_xi = __pyx_bstruct_xi.strides[0]; __pyx_bstride_1_xi = __pyx_bstruct_xi.strides[1]; __pyx_bshape_0_xi = __pyx_bstruct_xi.shape[0]; __pyx_bshape_1_xi = __pyx_bstruct_xi.shape[1]; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[2]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_complex_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1]; __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1]; } @@ -3128,15 +3128,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -3146,18 +3146,18 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -3173,35 +3173,35 @@ __pyx_v_start = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_fill_value = __pyx_t_6; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_t_4, 1, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -3209,26 +3209,26 @@ __Pyx_GIVEREF(__pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__complex); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__complex); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[2]; @@ -3245,7 +3245,7 @@ } __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1]; __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1]; - if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_out)); @@ -3256,29 +3256,29 @@ __pyx_v_nvalues = (__pyx_v_out->dimensions[1]); - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__finfo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__finfo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__eps); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__eps); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_int_100); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_eps); @@ -3296,7 +3296,7 @@ __pyx_v_i = __pyx_t_11; - __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L7;} + __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L7;} __pyx_v_isimplex = __pyx_f_5scipy_7spatial_5qhull__find_simplex(__pyx_v_info, __pyx_v_c, (((double *)__pyx_v_xi->data) + (__pyx_v_i * __pyx_v_ndim)), (&__pyx_v_start), __pyx_t_16); @@ -3479,6 +3479,9 @@ int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; + double __pyx_t_8; + double __pyx_t_9; + double __pyx_t_10; __pyx_t_1 = (2 * __pyx_v_d->npoints); @@ -3579,19 +3582,51 @@ (__pyx_v_r[1]) = ((((-(__pyx_v_Q[2])) * (__pyx_v_s[0])) + ((__pyx_v_Q[0]) * (__pyx_v_s[1]))) / __pyx_v_det); - __pyx_v_change = fmax(fabs(((__pyx_v_y[((__pyx_v_it.vertex * 2) + 0)]) + (__pyx_v_r[0]))), fabs(((__pyx_v_y[((__pyx_v_it.vertex * 2) + 1)]) + (__pyx_v_r[1])))); + __pyx_t_8 = fabs(((__pyx_v_y[((__pyx_v_it.vertex * 2) + 1)]) + (__pyx_v_r[1]))); + __pyx_t_9 = fabs(((__pyx_v_y[((__pyx_v_it.vertex * 2) + 0)]) + (__pyx_v_r[0]))); + + + if ((__pyx_t_8 > __pyx_t_9)) { + __pyx_t_10 = __pyx_t_8; + } else { + __pyx_t_10 = __pyx_t_9; + } + __pyx_v_change = __pyx_t_10; + + (__pyx_v_y[((__pyx_v_it.vertex * 2) + 0)]) = (-(__pyx_v_r[0])); (__pyx_v_y[((__pyx_v_it.vertex * 2) + 1)]) = (-(__pyx_v_r[1])); - __pyx_v_change /= fmax(1.0, fmax(fabs((__pyx_v_r[0])), fabs((__pyx_v_r[1])))); + __pyx_t_10 = fabs((__pyx_v_r[1])); + __pyx_t_8 = fabs((__pyx_v_r[0])); + if ((__pyx_t_10 > __pyx_t_8)) { + __pyx_t_9 = __pyx_t_10; + } else { + __pyx_t_9 = __pyx_t_8; + } + __pyx_t_10 = __pyx_t_9; + __pyx_t_9 = 1.0; + if ((__pyx_t_10 > __pyx_t_9)) { + __pyx_t_8 = __pyx_t_10; + } else { + __pyx_t_8 = __pyx_t_9; + } + __pyx_v_change /= __pyx_t_8; - __pyx_v_err = fmax(__pyx_v_err, __pyx_v_change); + __pyx_t_8 = __pyx_v_change; + __pyx_t_10 = __pyx_v_err; + if ((__pyx_t_8 > __pyx_t_10)) { + __pyx_t_9 = __pyx_t_8; + } else { + __pyx_t_9 = __pyx_t_10; + } + __pyx_v_err = __pyx_t_9; } @@ -3686,7 +3721,7 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("estimate_gradients_2d_global", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("estimate_gradients_2d_global", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { @@ -3700,7 +3735,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "estimate_gradients_2d_global") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "estimate_gradients_2d_global") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_y = values[1]; @@ -3723,7 +3758,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("estimate_gradients_2d_global", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("estimate_gradients_2d_global", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.estimate_gradients_2d_global"); __Pyx_RefNannyFinishContext(); @@ -3741,17 +3776,17 @@ __pyx_bstruct_grad.buf = NULL; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3760,51 +3795,51 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__npoints); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__npoints); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__issubdtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__issubdtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__complexfloating); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__complexfloating); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -3812,20 +3847,20 @@ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__real); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tri); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tri); @@ -3833,11 +3868,11 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3847,11 +3882,11 @@ __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__imag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__imag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tri); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tri); @@ -3859,11 +3894,11 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3873,22 +3908,22 @@ __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_rg, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_rg, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject*)&PyComplex_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject*)&PyComplex_Type)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -3898,10 +3933,10 @@ __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_r, __pyx_n_s__real, __pyx_v_rg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_r, __pyx_n_s__real, __pyx_v_rg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_r, __pyx_n_s__imag, __pyx_v_ig) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_r, __pyx_n_s__imag, __pyx_v_ig) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); @@ -3913,26 +3948,26 @@ __pyx_L7:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_y_shape); __pyx_v_y_shape = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { - __pyx_t_5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -3940,7 +3975,7 @@ PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetItem(__pyx_v_y, __pyx_t_3); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_y, __pyx_t_3); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_y); @@ -3951,11 +3986,11 @@ __pyx_L8:; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__npoints); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__npoints); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -3963,11 +3998,11 @@ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_y); @@ -3975,34 +4010,34 @@ __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); - __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4011,22 +4046,22 @@ __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_y, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -4037,12 +4072,12 @@ __Pyx_GIVEREF(__pyx_int_2); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4051,7 +4086,7 @@ __pyx_t_3 = 0; - if (!(likely(((__pyx_v_y) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_y, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_y) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_y, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_v_y); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4068,7 +4103,7 @@ } __pyx_bstride_0_data = __pyx_bstruct_data.strides[0]; __pyx_bstride_1_data = __pyx_bstruct_data.strides[1]; __pyx_bshape_0_data = __pyx_bstruct_data.shape[0]; __pyx_bshape_1_data = __pyx_bstruct_data.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_INCREF(__pyx_v_y); @@ -4076,7 +4111,7 @@ __pyx_v_data = ((PyArrayObject *)__pyx_v_y); - if (!(likely(((__pyx_v_yi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_yi, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_yi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_yi, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_v_yi); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4093,7 +4128,7 @@ } __pyx_bstride_0_grad = __pyx_bstruct_grad.strides[0]; __pyx_bstride_1_grad = __pyx_bstruct_grad.strides[1]; __pyx_bstride_2_grad = __pyx_bstruct_grad.strides[2]; __pyx_bshape_0_grad = __pyx_bstruct_grad.shape[0]; __pyx_bshape_1_grad = __pyx_bstruct_grad.shape[1]; __pyx_bshape_2_grad = __pyx_bstruct_grad.shape[2]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_INCREF(__pyx_v_yi); @@ -4117,10 +4152,10 @@ { - __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_maxiter); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L14;} + __pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_maxiter); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L14;} - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L14;} + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L14;} __pyx_v_ret = __pyx_f_8interpnd__estimate_gradients_2d_global(__pyx_v_info, (((double *)__pyx_v_data->data) + (__pyx_v_info->npoints * __pyx_v_k)), __pyx_t_13, __pyx_t_14, (((double *)__pyx_v_grad->data) + ((2 * __pyx_v_info->npoints) * __pyx_v_k))); @@ -4144,16 +4179,16 @@ if (__pyx_t_4) { - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_13)); @@ -4161,7 +4196,7 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4176,9 +4211,9 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_yi, __pyx_n_s__transpose); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_yi, __pyx_n_s__transpose); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1); @@ -4189,27 +4224,27 @@ __Pyx_INCREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); - __pyx_t_3 = PyNumber_Add(__pyx_v_y_shape, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_v_y_shape, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4885,13 +4920,13 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values); if (likely(values[2])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -4910,7 +4945,7 @@ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -4939,7 +4974,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator.__init__"); __Pyx_RefNannyFinishContext(); @@ -4947,12 +4982,12 @@ __pyx_L4_argument_unpacking_done:; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); @@ -4963,13 +4998,13 @@ __Pyx_INCREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndim), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ndim), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fill_value), __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fill_value), __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4977,31 +5012,31 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__qhull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__qhull); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tri, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tri, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -5009,20 +5044,20 @@ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__tol), __pyx_v_tol) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__maxiter), __pyx_v_maxiter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__grad, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__grad, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5158,11 +5193,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_double") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_double") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = ((PyArrayObject *)values[1]); @@ -5174,7 +5209,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_double", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator._evaluate_double"); __Pyx_RefNannyFinishContext(); @@ -5188,24 +5223,24 @@ __pyx_bstruct_points.buf = NULL; __pyx_bstruct_vertices.buf = NULL; __pyx_bstruct_xi.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_xi = __pyx_bstruct_xi.strides[0]; __pyx_bstride_1_xi = __pyx_bstruct_xi.strides[1]; __pyx_bshape_0_xi = __pyx_bstruct_xi.shape[0]; __pyx_bshape_1_xi = __pyx_bstruct_xi.shape[1]; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1]; __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1]; } @@ -5215,15 +5250,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__grad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__grad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_grad, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_grad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_grad.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_grad = __pyx_bstruct_grad.strides[0]; __pyx_bstride_1_grad = __pyx_bstruct_grad.strides[1]; __pyx_bstride_2_grad = __pyx_bstruct_grad.strides[2]; __pyx_bshape_0_grad = __pyx_bstruct_grad.shape[0]; __pyx_bshape_1_grad = __pyx_bstruct_grad.shape[1]; __pyx_bshape_2_grad = __pyx_bstruct_grad.shape[2]; } @@ -5233,15 +5268,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -5251,18 +5286,18 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -5278,35 +5313,35 @@ __pyx_v_start = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_fill_value = __pyx_t_7; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_t_5, 1, 1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5314,26 +5349,26 @@ __Pyx_GIVEREF(__pyx_t_8); __pyx_t_5 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_8, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_8, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5350,7 +5385,7 @@ } __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1]; __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1]; - if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_out)); @@ -5361,29 +5396,29 @@ __pyx_v_nvalues = (__pyx_v_out->dimensions[1]); - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__eps); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__eps); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_int_100); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_int_100); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_eps); @@ -5401,7 +5436,7 @@ __pyx_v_i = __pyx_t_12; - __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L7;} + __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L7;} __pyx_v_isimplex = __pyx_f_5scipy_7spatial_5qhull__find_simplex(__pyx_v_info, __pyx_v_c, (((double *)__pyx_v_xi->data) + (__pyx_v_i * __pyx_v_ndim)), (&__pyx_v_start), __pyx_t_7); @@ -5687,11 +5722,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_complex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_evaluate_complex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = ((PyArrayObject *)values[1]); @@ -5703,7 +5738,7 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_evaluate_complex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("interpnd.CloughTocher2DInterpolator._evaluate_complex"); __Pyx_RefNannyFinishContext(); @@ -5717,24 +5752,24 @@ __pyx_bstruct_points.buf = NULL; __pyx_bstruct_vertices.buf = NULL; __pyx_bstruct_xi.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_xi, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_xi = __pyx_bstruct_xi.strides[0]; __pyx_bstride_1_xi = __pyx_bstruct_xi.strides[1]; __pyx_bshape_0_xi = __pyx_bstruct_xi.shape[0]; __pyx_bshape_1_xi = __pyx_bstruct_xi.shape[1]; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[2]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_complex_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_values = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_values.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1]; __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1]; } @@ -5744,15 +5779,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__grad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__grad); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[2]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_grad, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_complex_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { __pyx_v_grad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_grad.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_grad = __pyx_bstruct_grad.strides[0]; __pyx_bstride_1_grad = __pyx_bstruct_grad.strides[1]; __pyx_bstride_2_grad = __pyx_bstruct_grad.strides[2]; __pyx_bshape_0_grad = __pyx_bstruct_grad.shape[0]; __pyx_bshape_1_grad = __pyx_bstruct_grad.shape[1]; __pyx_bshape_2_grad = __pyx_bstruct_grad.shape[2]; } @@ -5762,15 +5797,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -5780,18 +5815,18 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__vertices); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -5807,35 +5842,35 @@ __pyx_v_start = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fill_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_fill_value = __pyx_t_7; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tri); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_t_5, 1, 1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_xi->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5843,26 +5878,26 @@ __Pyx_GIVEREF(__pyx_t_8); __pyx_t_5 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__complex); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__complex); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_8, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_8, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = ((PyArrayObject *)__pyx_t_10); { __Pyx_BufFmt_StackElem __pyx_stack[2]; @@ -5879,7 +5914,7 @@ } __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1]; __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1]; - if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_out)); @@ -5890,29 +5925,29 @@ __pyx_v_nvalues = (__pyx_v_out->dimensions[1]); - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__finfo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__double); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__eps); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__eps); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_int_100); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Multiply(__pyx_t_10, __pyx_int_100); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_eps); @@ -5930,7 +5965,7 @@ __pyx_v_i = __pyx_t_12; - __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L7;} + __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_eps); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L7;} __pyx_v_isimplex = __pyx_f_5scipy_7spatial_5qhull__find_simplex(__pyx_v_info, __pyx_v_c, (((double *)__pyx_v_xi->data) + (__pyx_v_i * __pyx_v_ndim)), (&__pyx_v_start), __pyx_t_17); @@ -7406,15 +7441,15 @@ {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_Warning = __Pyx_GetName(__pyx_b, __pyx_n_s__Warning); if (!__pyx_builtin_Warning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_Warning = __Pyx_GetName(__pyx_b, __pyx_n_s__Warning); if (!__pyx_builtin_Warning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; @@ -7543,159 +7578,159 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); - if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_3), __pyx_n_s__NDInterpolatorBase, "interpnd"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_3), __pyx_n_s__NDInterpolatorBase, "interpnd"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nan); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_k_1 = __pyx_t_5; __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___init__, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___init__, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_init_shape, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_init_shape, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___check_init_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___check_init_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_call_shape, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase__check_call_shape, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___check_call_shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___check_call_shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___call__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_18NDInterpolatorBase___call__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____call__, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____call__, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NDInterpolatorBase, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NDInterpolatorBase, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_27)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_CreateClass(__pyx_t_5, ((PyObject *)__pyx_t_3), __pyx_n_s_28, "interpnd"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_27)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_CreateClass(__pyx_t_5, ((PyObject *)__pyx_t_3), __pyx_n_s_28, "interpnd"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_k_9 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____init__, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s____init__, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_5, 0, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___evaluate_double, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___evaluate_double, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_20LinearNDInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyMethod_New(__pyx_t_2, 0, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___evaluate_complex, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s___evaluate_complex, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_28, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_28, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_builtin_Warning); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_Warning); __Pyx_GIVEREF(__pyx_builtin_Warning); - __pyx_t_5 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_3), __pyx_n_s_14, "interpnd"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_3), __pyx_n_s_14, "interpnd"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_14, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_14, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_k_10 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__NDInterpolatorBase); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_29)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_3), __pyx_n_s_30, "interpnd"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItemString(((PyObject *)__pyx_t_3), "__doc__", ((PyObject *)__pyx_kp_s_29)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_3), __pyx_n_s_30, "interpnd"); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_k_15 = __pyx_t_2; @@ -7703,39 +7738,39 @@ __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_16 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_double, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s___evaluate_double, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s___evaluate_double, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_8interpnd_26CloughTocher2DInterpolator__evaluate_complex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s___evaluate_complex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_5, __pyx_n_s___evaluate_complex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_30, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_30, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; From scipy-svn at scipy.org Thu Sep 16 01:21:48 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 16 Sep 2010 00:21:48 -0500 (CDT) Subject: [Scipy-svn] r6809 - in trunk/scipy/sparse: linalg/dsolve/tests linalg/dsolve/umfpack/tests linalg/eigen/arpack/tests linalg/eigen/lobpcg/tests linalg/isolve/tests linalg/tests tests Message-ID: <20100916052148.6EE6839CC3F@scipy.org> Author: warren.weckesser Date: 2010-09-16 00:21:48 -0500 (Thu, 16 Sep 2010) New Revision: 6809 Modified: trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py trunk/scipy/sparse/linalg/eigen/arpack/tests/test_speigs.py trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py trunk/scipy/sparse/linalg/isolve/tests/test_iterative.py trunk/scipy/sparse/linalg/isolve/tests/test_lgmres.py trunk/scipy/sparse/linalg/isolve/tests/test_lsqr.py trunk/scipy/sparse/linalg/tests/test_interface.py trunk/scipy/sparse/linalg/tests/test_iterative.py trunk/scipy/sparse/tests/test_base.py trunk/scipy/sparse/tests/test_construct.py trunk/scipy/sparse/tests/test_extract.py trunk/scipy/sparse/tests/test_spfuncs.py trunk/scipy/sparse/tests/test_sputils.py Log: TST: sparse: Don't use plain assert. Don't use 'import *'. Modified: trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -2,7 +2,8 @@ from numpy import array, finfo, arange, eye, all, unique, ones, dot, matrix import numpy.random as random -from numpy.testing import * +from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal, \ + assert_raises, assert_almost_equal, assert_equal, assert_array_equal, assert_ from scipy.linalg import norm, inv from scipy.sparse import spdiags, SparseEfficiencyWarning, csc_matrix @@ -63,15 +64,15 @@ x = random.rand(self.n) lu = splu(self.A) r = self.A*lu.solve(x) - assert abs(x - r).max() < 1e-13 + assert_(abs(x - r).max() < 1e-13) def test_spilu_smoketest(self): # Check that spilu works at all x = random.rand(self.n) lu = spilu(self.A, drop_tol=1e-2, fill_factor=5) r = self.A*lu.solve(x) - assert abs(x - r).max() < 1e-2 - assert abs(x - r).max() > 1e-5 + assert_(abs(x - r).max() < 1e-2) + assert_(abs(x - r).max() > 1e-5) def test_splu_nnz0(self): A = csc_matrix( (5,5), dtype='d' ) Modified: trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/dsolve/umfpack/tests/test_umfpack.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -7,7 +7,8 @@ import warnings import random -from numpy.testing import * +from numpy.testing import TestCase, assert_array_almost_equal, dec, \ + decorate_methods from scipy import rand, matrix, diag, eye from scipy.sparse import csc_matrix, spdiags, SparseEfficiencyWarning @@ -179,4 +180,5 @@ decorate_methods(cls, _umfpack_skip) if __name__ == "__main__": + import nose nose.run(argv=['', __file__]) Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -6,7 +6,9 @@ """ import numpy as np -from numpy.testing import * +from numpy.testing import assert_almost_equal, assert_array_almost_equal, \ + assert_array_almost_equal_nulp, TestCase, run_module_suite, dec, \ + verbose from numpy import array, finfo, argsort, dot, round, conj, random from scipy.sparse.linalg.eigen.arpack import eigen_symmetric, eigen, svd Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_speigs.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_speigs.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_speigs.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,9 +1,9 @@ #!/usr/bin/env python -from numpy.testing import * +from numpy.testing import run_module_suite, TestCase, assert_array_almost_equal from scipy.sparse.linalg.interface import aslinearoperator -from scipy.sparse.linalg.eigen.arpack.speigs import * +from scipy.sparse.linalg.eigen.arpack import speigs import numpy as np @@ -11,7 +11,7 @@ def test(self): maxn=15 # Dimension of square matrix to be solved # Use a PDP^-1 factorisation to construct matrix with known - # eiegevalues/vectors. Used random eiegenvectors initially. + # eigenvalues/vectors. Used random eigenvectors initially. P = np.mat(np.random.random((maxn,)*2)) P /= map(np.linalg.norm, P.T) # Normalise the eigenvectors D = np.mat(np.zeros((maxn,)*2)) @@ -27,7 +27,7 @@ matvec = A.matvec #= lambda x: np.asarray(A*x)[0] nev=4 - eigvs = ARPACK_eigs(matvec, A.shape[0], nev=nev) + eigvs = speigs.ARPACK_eigs(matvec, A.shape[0], nev=nev) calc_vals = eigvs[0] # Ensure the calculated eigenvectors have the same sign as the reference values calc_vecs = eigvs[1] / [np.sign(x[0]) for x in eigvs[1].T] Modified: trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -3,7 +3,7 @@ """ import numpy -from numpy.testing import * +from numpy.testing import assert_almost_equal, run_module_suite from scipy import arange, ones, rand, set_printoptions, r_, diag, linalg from scipy.linalg import eig Modified: trunk/scipy/sparse/linalg/isolve/tests/test_iterative.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/tests/test_iterative.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/isolve/tests/test_iterative.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -2,7 +2,7 @@ """ Test functions for the sparse.linalg.isolve module """ -from numpy.testing import * +from numpy.testing import TestCase, assert_equal, assert_array_equal, assert_ from numpy import zeros, ones, arange, array, abs, max from scipy.linalg import norm @@ -101,7 +101,7 @@ assert_array_equal(x0, 0*b) #ensure that x0 is not overwritten assert_equal(info,0) - assert( norm(b - A*x) < tol*norm(b) ) + assert_( norm(b - A*x) < tol*norm(b) ) def test_precond(self): """test whether all methods accept a trivial preconditioner""" @@ -131,7 +131,7 @@ else: x, info = solver(A, b, M=precond, x0=x0, tol=tol) assert_equal(info,0) - assert( norm(b - A*x) < tol*norm(b) ) + assert_( norm(b - A*x) < tol*norm(b) ) A = A.copy() A.psolve = identity @@ -139,7 +139,7 @@ x, info = solver(A, b, x0=x0, tol=tol) assert_equal(info,0) - assert( norm(b - A*x) < tol*norm(b) ) + assert_( norm(b - A*x) < tol*norm(b) ) class TestQMR(TestCase): @@ -176,7 +176,7 @@ x,info = qmr(A, b, tol=1e-8, maxiter=15, M1=M1, M2=M2) assert_equal(info,0) - assert( norm(b - A*x) < 1e-8*norm(b) ) + assert_( norm(b - A*x) < 1e-8*norm(b) ) class TestGMRES(TestCase): @@ -194,8 +194,9 @@ callback = lambda r:store_residual(r, rvec) x,flag = gmres(A, b, x0=zeros(A.shape[0]), tol=1e-16, maxiter=maxiter, callback=callback) diff = max(abs((rvec - array([1.0, 0.81649658092772603])))) - assert(diff < 1e-5) + assert_(diff < 1e-5) if __name__ == "__main__": + import nose nose.run(argv=['', __file__]) Modified: trunk/scipy/sparse/linalg/isolve/tests/test_lgmres.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/tests/test_lgmres.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/isolve/tests/test_lgmres.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -2,7 +2,7 @@ """Tests for the linalg.isolve.lgmres module """ -from numpy.testing import * +from numpy.testing import TestCase, assert_ from numpy import zeros, array, allclose from scipy.linalg import norm @@ -28,7 +28,7 @@ count[0] = 0 x0, flag = lgmres(A, b, x0=zeros(A.shape[0]), inner_m=6, tol=1e-14, **kw) count_0 = count[0] - assert allclose(A*x0, b, rtol=1e-12, atol=1e-12), norm(A*x0-b) + assert_(allclose(A*x0, b, rtol=1e-12, atol=1e-12), norm(A*x0-b)) return x0, count_0 @@ -41,35 +41,35 @@ x0, count_0 = do_solve() x1, count_1 = do_solve(M=M) - assert count_1 == 3 - assert count_1 < count_0/2 - assert allclose(x1, x0, rtol=1e-14) + assert_(count_1 == 3) + assert_(count_1 < count_0/2) + assert_(allclose(x1, x0, rtol=1e-14)) def test_outer_v(self): # Check that the augmentation vectors behave as expected outer_v = [] x0, count_0 = do_solve(outer_k=6, outer_v=outer_v) - assert len(outer_v) > 0 - assert len(outer_v) <= 6 + assert_(len(outer_v) > 0) + assert_(len(outer_v) <= 6) x1, count_1 = do_solve(outer_k=6, outer_v=outer_v) - assert count_1 == 2, count_1 - assert count_1 < count_0/2 - assert allclose(x1, x0, rtol=1e-14) + assert_(count_1 == 2, count_1) + assert_(count_1 < count_0/2) + assert_(allclose(x1, x0, rtol=1e-14)) # --- outer_v = [] x0, count_0 = do_solve(outer_k=6, outer_v=outer_v, store_outer_Av=False) - assert array([v[1] is None for v in outer_v]).all() - assert len(outer_v) > 0 - assert len(outer_v) <= 6 + assert_(array([v[1] is None for v in outer_v]).all()) + assert_(len(outer_v) > 0) + assert_(len(outer_v) <= 6) x1, count_1 = do_solve(outer_k=6, outer_v=outer_v) - assert count_1 == 3, count_1 - assert count_1 < count_0/2 - assert allclose(x1, x0, rtol=1e-14) + assert_(count_1 == 3, count_1) + assert_(count_1 < count_0/2) + assert_(allclose(x1, x0, rtol=1e-14)) if __name__ == "__main__": import nose Modified: trunk/scipy/sparse/linalg/isolve/tests/test_lsqr.py =================================================================== --- trunk/scipy/sparse/linalg/isolve/tests/test_lsqr.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/isolve/tests/test_lsqr.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,4 +1,5 @@ import numpy as np +from numpy.testing import assert_ from scipy.sparse.linalg import lsqr from time import time @@ -25,7 +26,7 @@ svx = np.linalg.solve(G, b) X = lsqr(G, b, show=show, atol=tol, btol=tol, iter_lim=maxit) xo = X[0] - assert norm(svx - xo) < 1e-5 + assert_(norm(svx - xo) < 1e-5) if __name__ == "__main__": svx = np.linalg.solve(G, b) Modified: trunk/scipy/sparse/linalg/tests/test_interface.py =================================================================== --- trunk/scipy/sparse/linalg/tests/test_interface.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/tests/test_interface.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,12 +1,13 @@ """Test functions for the sparse.linalg.interface module """ -from numpy.testing import * +from numpy.testing import TestCase, assert_, assert_equal, \ + assert_raises import numpy as np import scipy.sparse as sparse -from scipy.sparse.linalg.interface import * +from scipy.sparse.linalg import interface class TestLinearOperator(TestCase): @@ -26,7 +27,7 @@ def test_matvec(self): for matvec in self.matvecs: - A = LinearOperator((2,3), matvec) + A = interface.LinearOperator((2,3), matvec) assert_equal(A.matvec(np.array([1,2,3])), [14,32]) assert_equal(A.matvec(np.array([[1],[2],[3]])), [[14],[32]]) @@ -36,13 +37,13 @@ assert_equal(A.matvec(np.matrix([[1],[2],[3]])), [[14],[32]]) assert_equal(A * np.matrix([[1],[2],[3]]), [[14],[32]]) - assert( isinstance(A.matvec(np.array([1,2,3])), np.ndarray) ) - assert( isinstance(A.matvec(np.array([[1],[2],[3]])), np.ndarray) ) - assert( isinstance(A * np.array([1,2,3]), np.ndarray) ) - assert( isinstance(A * np.array([[1],[2],[3]]), np.ndarray) ) + assert_( isinstance(A.matvec(np.array([1,2,3])), np.ndarray) ) + assert_( isinstance(A.matvec(np.array([[1],[2],[3]])), np.ndarray) ) + assert_( isinstance(A * np.array([1,2,3]), np.ndarray) ) + assert_( isinstance(A * np.array([[1],[2],[3]]), np.ndarray) ) - assert( isinstance(A.matvec(np.matrix([[1],[2],[3]])), np.ndarray) ) - assert( isinstance(A * np.matrix([[1],[2],[3]]), np.ndarray) ) + assert_( isinstance(A.matvec(np.matrix([[1],[2],[3]])), np.ndarray) ) + assert_( isinstance(A * np.matrix([[1],[2],[3]]), np.ndarray) ) assert_raises(ValueError, A.matvec, np.array([1,2])) assert_raises(ValueError, A.matvec, np.array([1,2,3,4])) @@ -84,7 +85,7 @@ def test_basic(self): for M in self.cases: - A = aslinearoperator(M) + A = interface.aslinearoperator(M) M,N = A.shape assert_equal(A.matvec(np.array([1,2,3])), [14,32]) Modified: trunk/scipy/sparse/linalg/tests/test_iterative.py =================================================================== --- trunk/scipy/sparse/linalg/tests/test_iterative.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/linalg/tests/test_iterative.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,7 +1,6 @@ import numpy as np from numpy.testing import run_module_suite, assert_almost_equal -import scipy.sparse as sp import scipy.sparse.linalg as spla def test_gmres_basic(): Modified: trunk/scipy/sparse/tests/test_base.py =================================================================== --- trunk/scipy/sparse/tests/test_base.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/tests/test_base.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -21,7 +21,9 @@ int8, ComplexWarning import random -from numpy.testing import * +from numpy.testing import assert_raises, assert_equal, assert_array_equal, \ + assert_array_almost_equal, assert_almost_equal, assert_, \ + dec, TestCase, run_module_suite import scipy.sparse as sparse from scipy.sparse import csc_matrix, csr_matrix, dok_matrix, \ @@ -250,7 +252,7 @@ B = A.asfptype() C = B.asfptype() - assert( B is C ) + assert_( B is C ) def test_mul_scalar(self): @@ -356,7 +358,7 @@ """ A = self.spmatrix([[1],[2],[3]]) - assert(isspmatrix(A * array(1))) + assert_(isspmatrix(A * array(1))) assert_equal((A * array(1)).todense(), [[1],[2],[3]]) assert_equal(A * array([1]), array([1,2,3])) assert_equal(A * array([[1]]), array([[1],[2],[3]])) @@ -372,8 +374,8 @@ assert_equal((M * matrix([[1],[2],[3]])).shape,(4,1)) #check result type - assert(isinstance( M * array([1,2,3]), ndarray)) - assert(isinstance( M * matrix([1,2,3]).T, matrix)) + assert_(isinstance( M * array([1,2,3]), ndarray)) + assert_(isinstance( M * matrix([1,2,3]).T, matrix)) #ensure exception is raised for improper dimensions bad_vecs = [array([1,2]), array([1,2,3,4]), array([[1],[2]]), @@ -464,7 +466,7 @@ for b in bs: result = asp*b - assert( isinstance(result, type(b)) ) + assert_( isinstance(result, type(b)) ) assert_equal( result.shape, (4,2) ) assert_equal( result, dot(a,b) ) @@ -556,7 +558,7 @@ B = A.copy() try: B[0,0] += 1 - assert B[0,0]!=A[0,0] + assert_(B[0,0] != A[0,0]) except NotImplementedError: # not all sparse matrices can be indexed pass @@ -689,7 +691,7 @@ a = A[6,3:7] except IndexError: caught += 1 - assert caught == 2 + assert_(caught == 2) class _TestVertSlicing: @@ -724,7 +726,7 @@ a = A[6,3:7] except IndexError: caught += 1 - assert caught == 2 + assert_(caught == 2) Modified: trunk/scipy/sparse/tests/test_construct.py =================================================================== --- trunk/scipy/sparse/tests/test_construct.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/tests/test_construct.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -2,12 +2,13 @@ import numpy as np from numpy import array, matrix -from numpy.testing import * +from numpy.testing import TestCase, run_module_suite, assert_equal, \ + assert_array_equal, assert_raises from scipy.sparse import csr_matrix, coo_matrix -from scipy.sparse.construct import * +from scipy.sparse import construct from scipy.sparse.construct import rand as sprand sparse_formats = ['csr','csc','coo','bsr','dia','lil','dok'] @@ -60,34 +61,34 @@ [ 0, 2, 0, 0,15]]) ) for d,o,m,n,result in cases: - assert_equal( spdiags(d,o,m,n).todense(), result ) + assert_equal( construct.spdiags(d,o,m,n).todense(), result ) def test_identity(self): - assert_equal(identity(1).toarray(), [[1]]) - assert_equal(identity(2).toarray(), [[1,0],[0,1]]) + assert_equal(construct.identity(1).toarray(), [[1]]) + assert_equal(construct.identity(2).toarray(), [[1,0],[0,1]]) - I = identity(3, dtype='int8', format='dia') + I = construct.identity(3, dtype='int8', format='dia') assert_equal( I.dtype, np.dtype('int8') ) assert_equal( I.format, 'dia' ) for fmt in sparse_formats: - I = identity( 3, format=fmt ) + I = construct.identity( 3, format=fmt ) assert_equal( I.format, fmt ) assert_equal( I.toarray(), [[1,0,0],[0,1,0],[0,0,1]]) def test_eye(self): - assert_equal(eye(1,1).toarray(), [[1]]) - assert_equal(eye(2,3).toarray(), [[1,0,0],[0,1,0]]) - assert_equal(eye(3,2).toarray(), [[1,0],[0,1],[0,0]]) - assert_equal(eye(3,3).toarray(), [[1,0,0],[0,1,0],[0,0,1]]) + assert_equal(construct.eye(1,1).toarray(), [[1]]) + assert_equal(construct.eye(2,3).toarray(), [[1,0,0],[0,1,0]]) + assert_equal(construct.eye(3,2).toarray(), [[1,0],[0,1],[0,0]]) + assert_equal(construct.eye(3,3).toarray(), [[1,0,0],[0,1,0],[0,0,1]]) - assert_equal(eye(3,3,dtype='int16').dtype, np.dtype('int16')) + assert_equal(construct.eye(3,3,dtype='int16').dtype, np.dtype('int16')) for m in [3, 5]: for n in [3, 5]: for k in range(-5,6): - assert_equal(eye(m, n, k=k).toarray(), np.eye(m, n, k=k)) + assert_equal(construct.eye(m, n, k=k).toarray(), np.eye(m, n, k=k)) def test_kron(self): cases = [] @@ -108,7 +109,7 @@ for a in cases: for b in cases: - result = kron(csr_matrix(a),csr_matrix(b)).todense() + result = construct.kron(csr_matrix(a),csr_matrix(b)).todense() expected = np.kron(a,b) assert_array_equal(result,expected) @@ -126,7 +127,7 @@ for a in cases: for b in cases: - result = kronsum(csr_matrix(a),csr_matrix(b)).todense() + result = construct.kronsum(csr_matrix(a),csr_matrix(b)).todense() expected = np.kron(np.eye(len(b)), a) + \ np.kron(b, np.eye(len(a))) assert_array_equal(result,expected) @@ -139,7 +140,7 @@ expected = matrix([[1, 2], [3, 4], [5, 6]]) - assert_equal( vstack( [A,B] ).todense(), expected ) + assert_equal( construct.vstack( [A,B] ).todense(), expected ) def test_hstack(self): @@ -148,7 +149,7 @@ expected = matrix([[1, 2, 5], [3, 4, 6]]) - assert_equal( hstack( [A,B] ).todense(), expected ) + assert_equal( construct.hstack( [A,B] ).todense(), expected ) def test_bmat(self): @@ -159,47 +160,47 @@ expected = matrix([[1, 2, 5], [3, 4, 6], [0, 0, 7]]) - assert_equal( bmat( [[A,B],[None,C]] ).todense(), expected ) + assert_equal( construct.bmat( [[A,B],[None,C]] ).todense(), expected ) expected = matrix([[1, 2, 0], [3, 4, 0], [0, 0, 7]]) - assert_equal( bmat( [[A,None],[None,C]] ).todense(), expected ) + assert_equal( construct.bmat( [[A,None],[None,C]] ).todense(), expected ) expected = matrix([[0, 5], [0, 6], [7, 0]]) - assert_equal( bmat( [[None,B],[C,None]] ).todense(), expected ) + assert_equal( construct.bmat( [[None,B],[C,None]] ).todense(), expected ) #TODO test failure cases def test_lil_diags(self): - assert_array_equal(lil_diags([[1,2,3],[4,5],[6]], + assert_array_equal(construct.lil_diags([[1,2,3],[4,5],[6]], [0,1,2],(3,3)).todense(), [[1,4,6], [0,2,5], [0,0,3]]) - assert_array_equal(lil_diags([[6],[4,5],[1,2,3]], + assert_array_equal(construct.lil_diags([[6],[4,5],[1,2,3]], [2,1,0],(3,3)).todense(), [[1,4,6], [0,2,5], [0,0,3]]) - assert_array_equal(lil_diags([[6,7,8],[4,5],[1,2,3]], + assert_array_equal(construct.lil_diags([[6,7,8],[4,5],[1,2,3]], [2,1,0],(3,3)).todense(), [[1,4,6], [0,2,5], [0,0,3]]) - assert_array_equal(lil_diags([[1,2,3],[4,5],[6]], + assert_array_equal(construct.lil_diags([[1,2,3],[4,5],[6]], [0,-1,-2],(3,3)).todense(), [[1,0,0], [4,2,0], [6,5,3]]) - assert_array_equal(lil_diags([[6,7,8],[4,5]], + assert_array_equal(construct.lil_diags([[6,7,8],[4,5]], [-2,-1],(3,3)).todense(), [[0,0,0], [4,0,0], Modified: trunk/scipy/sparse/tests/test_extract.py =================================================================== --- trunk/scipy/sparse/tests/test_extract.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/tests/test_extract.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,10 +1,10 @@ """test sparse matrix construction functions""" -from numpy.testing import * +from numpy.testing import TestCase, assert_equal from scipy.sparse import csr_matrix import numpy as np -from scipy.sparse.extract import * +from scipy.sparse import extract class TestExtract(TestCase): @@ -28,17 +28,17 @@ def find(self): for A in self.cases: - I,J,V = find(A) + I,J,V = extract.find(A) assert_equal( A.toarray(), csr_matrix(((I,J),V), shape=A.shape) ) def test_tril(self): for A in self.cases: B = A.toarray() for k in [-3,-2,-1,0,1,2,3]: - assert_equal( tril(A,k=k).toarray(), np.tril(B,k=k)) + assert_equal( extract.tril(A,k=k).toarray(), np.tril(B,k=k)) def test_triu(self): for A in self.cases: B = A.toarray() for k in [-3,-2,-1,0,1,2,3]: - assert_equal( triu(A,k=k).toarray(), np.triu(B,k=k)) + assert_equal( extract.triu(A,k=k).toarray(), np.triu(B,k=k)) Modified: trunk/scipy/sparse/tests/test_spfuncs.py =================================================================== --- trunk/scipy/sparse/tests/test_spfuncs.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/tests/test_spfuncs.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,7 +1,7 @@ from numpy import array, kron, matrix, diag -from numpy.testing import * +from numpy.testing import TestCase, run_module_suite, assert_, assert_equal -from scipy.sparse.spfuncs import * +from scipy.sparse import spfuncs from scipy.sparse import csr_matrix, csc_matrix, bsr_matrix from scipy.sparse.sparsetools import csr_scale_rows, csr_scale_columns, \ bsr_scale_rows, bsr_scale_columns @@ -65,9 +65,9 @@ for A in mats: for B in blks: X = kron(A,B) - r,c = estimate_blocksize(X) - assert(r >= B.shape[0]) - assert(c >= B.shape[1]) + r,c = spfuncs.estimate_blocksize(X) + assert_(r >= B.shape[0]) + assert_(c >= B.shape[1]) def test_count_blocks(self): def gold(A,bs): @@ -90,12 +90,12 @@ Y = csr_matrix(X) for R in range(1,6): for C in range(1,6): - assert_equal(count_blocks(Y,(R,C)),gold(X,(R,C))) + assert_equal(spfuncs.count_blocks(Y, (R, C)), gold(X, (R, C))) X = kron([[1,1,0],[0,0,1],[1,0,1]],[[1,1]]) Y = csc_matrix(X) - assert_equal(count_blocks(X,(1,2)),gold(X,(1,2))) - assert_equal(count_blocks(Y,(1,2)),gold(X,(1,2))) + assert_equal(spfuncs.count_blocks(X, (1, 2)), gold(X, (1, 2))) + assert_equal(spfuncs.count_blocks(Y, (1, 2)), gold(X, (1, 2))) def test_cs_graph_components(self): import numpy as np @@ -104,19 +104,19 @@ D = np.eye(4, dtype=np.bool) n_comp, flag = cs_graph_components(csr_matrix(D)) - assert(n_comp == 4) + assert_(n_comp == 4) assert_equal(flag, [0, 1, 2, 3]) D[0,1] = D[1,0] = 1 n_comp, flag = cs_graph_components(csr_matrix(D)) - assert(n_comp == 3) + assert_(n_comp == 3) assert_equal(flag, [0, 0, 1, 2]) # A pathological case... D[2,2] = 0 n_comp, flag = cs_graph_components(csr_matrix(D)) - assert(n_comp == 2) + assert_(n_comp == 2) assert_equal(flag, [0, 0, -2, 1]) if __name__ == "__main__": Modified: trunk/scipy/sparse/tests/test_sputils.py =================================================================== --- trunk/scipy/sparse/tests/test_sputils.py 2010-09-14 23:08:20 UTC (rev 6808) +++ trunk/scipy/sparse/tests/test_sputils.py 2010-09-16 05:21:48 UTC (rev 6809) @@ -1,69 +1,69 @@ """unit tests for sparse utility functions""" import numpy as np -from numpy.testing import * -from scipy.sparse.sputils import * +from numpy.testing import TestCase, run_module_suite, assert_equal +from scipy.sparse import sputils class TestSparseUtils(TestCase): def test_upcast(self): - assert_equal(upcast('intc'),np.intc) - assert_equal(upcast('int32','float32'),np.float64) - assert_equal(upcast('bool',complex,float),np.complex128) - assert_equal(upcast('i','d'),np.float64) + assert_equal(sputils.upcast('intc'),np.intc) + assert_equal(sputils.upcast('int32','float32'),np.float64) + assert_equal(sputils.upcast('bool',complex,float),np.complex128) + assert_equal(sputils.upcast('i','d'),np.float64) def test_getdtype(self): A = np.array([1],dtype='int8') - assert_equal(getdtype(None,default=float),np.float) - assert_equal(getdtype(None,a=A),np.int8) + assert_equal(sputils.getdtype(None,default=float),np.float) + assert_equal(sputils.getdtype(None,a=A),np.int8) def test_isscalarlike(self): - assert_equal(isscalarlike(3.0),True) - assert_equal(isscalarlike(-4),True) - assert_equal(isscalarlike(2.5),True) - assert_equal(isscalarlike(1 + 3j),True) - assert_equal(isscalarlike(np.array(3)),True) - assert_equal(isscalarlike( "16" ), True) + assert_equal(sputils.isscalarlike(3.0),True) + assert_equal(sputils.isscalarlike(-4),True) + assert_equal(sputils.isscalarlike(2.5),True) + assert_equal(sputils.isscalarlike(1 + 3j),True) + assert_equal(sputils.isscalarlike(np.array(3)),True) + assert_equal(sputils.isscalarlike( "16" ), True) - assert_equal(isscalarlike( np.array([3])), False) - assert_equal(isscalarlike( [[3]] ), False) - assert_equal(isscalarlike( (1,) ), False) - assert_equal(isscalarlike( (1,2) ), False) + assert_equal(sputils.isscalarlike( np.array([3])), False) + assert_equal(sputils.isscalarlike( [[3]] ), False) + assert_equal(sputils.isscalarlike( (1,) ), False) + assert_equal(sputils.isscalarlike( (1,2) ), False) def test_isintlike(self): - assert_equal(isintlike(3.0),True) - assert_equal(isintlike(-4),True) - assert_equal(isintlike(np.array(3)),True) - assert_equal(isintlike(np.array([3])), False) + assert_equal(sputils.isintlike(3.0),True) + assert_equal(sputils.isintlike(-4),True) + assert_equal(sputils.isintlike(np.array(3)),True) + assert_equal(sputils.isintlike(np.array([3])), False) - assert_equal(isintlike(2.5),False) - assert_equal(isintlike(1 + 3j),False) - assert_equal(isintlike( (1,) ), False) - assert_equal(isintlike( (1,2) ), False) + assert_equal(sputils.isintlike(2.5),False) + assert_equal(sputils.isintlike(1 + 3j),False) + assert_equal(sputils.isintlike( (1,) ), False) + assert_equal(sputils.isintlike( (1,2) ), False) def test_isshape(self): - assert_equal(isshape( (1,2) ),True) - assert_equal(isshape( (5,2) ),True) + assert_equal(sputils.isshape( (1,2) ),True) + assert_equal(sputils.isshape( (5,2) ),True) - assert_equal(isshape( (1.5,2) ),False) - assert_equal(isshape( (2,2,2) ),False) - assert_equal(isshape( ([2],2) ),False) + assert_equal(sputils.isshape( (1.5,2) ),False) + assert_equal(sputils.isshape( (2,2,2) ),False) + assert_equal(sputils.isshape( ([2],2) ),False) def test_issequence(self): - assert_equal(issequence( (1,) ),True) - assert_equal(issequence( (1,2,3) ),True) - assert_equal(issequence( [1] ),True) - assert_equal(issequence( [1,2,3] ),True) - assert_equal(issequence( np.array([1,2,3]) ),True) + assert_equal(sputils.issequence( (1,) ),True) + assert_equal(sputils.issequence( (1,2,3) ),True) + assert_equal(sputils.issequence( [1] ),True) + assert_equal(sputils.issequence( [1,2,3] ),True) + assert_equal(sputils.issequence( np.array([1,2,3]) ),True) - assert_equal(issequence( np.array([[1],[2],[3]]) ),False) - assert_equal(issequence( 3 ),False) + assert_equal(sputils.issequence( np.array([[1],[2],[3]]) ),False) + assert_equal(sputils.issequence( 3 ),False) def test_isdense(self): - assert_equal(isdense( np.array([1]) ),True) - assert_equal(isdense( np.matrix([1]) ),True) + assert_equal(sputils.isdense( np.array([1]) ),True) + assert_equal(sputils.isdense( np.matrix([1]) ),True) if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Fri Sep 17 09:43:22 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 17 Sep 2010 08:43:22 -0500 (CDT) Subject: [Scipy-svn] r6810 - in trunk/scipy/sparse/linalg/dsolve: . tests Message-ID: <20100917134322.50CCD39CD13@scipy.org> Author: stefan Date: 2010-09-17 08:43:22 -0500 (Fri, 17 Sep 2010) New Revision: 6810 Modified: trunk/scipy/sparse/linalg/dsolve/linsolve.py trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py Log: BUG: Correct formatting of error message in spsolve. Modified: trunk/scipy/sparse/linalg/dsolve/linsolve.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/linsolve.py 2010-09-16 05:21:48 UTC (rev 6809) +++ trunk/scipy/sparse/linalg/dsolve/linsolve.py 2010-09-17 13:43:22 UTC (rev 6810) @@ -62,10 +62,10 @@ M, N = A.shape if (M != N): - raise ValueError, "matrix must be square (has shape %s)" % (M,N) + raise ValueError("matrix must be square (has shape %s)" % ((M, N),)) if M != b.size: - raise ValueError, "matrix - rhs size mismatch (%s - %s)"\ - % (A.shape, b.size) + raise ValueError("matrix - rhs size mismatch (%s - %s)"\ + % (A.shape, b.size)) use_umfpack = use_umfpack and useUmfpack Modified: trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-16 05:21:48 UTC (rev 6809) +++ trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-17 13:43:22 UTC (rev 6810) @@ -51,6 +51,11 @@ assert_array_almost_equal(x, x2) + def test_non_square(self): + A = ones((3, 4)) + b = ones((4, 1)) + assert_raises(ValueError, spsolve, A, b) + class TestSplu(object): def setUp(self): n = 40 From scipy-svn at scipy.org Sat Sep 18 00:41:54 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 17 Sep 2010 23:41:54 -0500 (CDT) Subject: [Scipy-svn] r6811 - in trunk/scipy/sparse/linalg/dsolve: . tests Message-ID: <20100918044154.0F5D539CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-17 23:41:54 -0500 (Fri, 17 Sep 2010) New Revision: 6811 Modified: trunk/scipy/sparse/linalg/dsolve/linsolve.py trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py Log: sparse: update some 'raise' statements; a few other minor tweaks Modified: trunk/scipy/sparse/linalg/dsolve/linsolve.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/linsolve.py 2010-09-17 13:43:22 UTC (rev 6810) +++ trunk/scipy/sparse/linalg/dsolve/linsolve.py 2010-09-18 04:41:54 UTC (rev 6811) @@ -51,7 +51,7 @@ if max( b.shape ) == b.size: b = b.squeeze() else: - raise ValueError, "rhs must be a vector (has shape %s)" % (b.shape,) + raise ValueError("rhs must be a vector (has shape %s)" % (b.shape,)) if not (isspmatrix_csc(A) or isspmatrix_csr(A)): A = csc_matrix(A) @@ -64,18 +64,18 @@ if (M != N): raise ValueError("matrix must be square (has shape %s)" % ((M, N),)) if M != b.size: - raise ValueError("matrix - rhs size mismatch (%s - %s)"\ + raise ValueError("matrix - rhs size mismatch (%s - %s)" % (A.shape, b.size)) use_umfpack = use_umfpack and useUmfpack if isUmfpack and use_umfpack: if noScikit: - warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,'\ + warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,' ' install scikits.umfpack instead', DeprecationWarning ) if A.dtype.char not in 'dD': - raise ValueError, "convert matrix data to double, please, using"\ - " .astype(), or set linsolve.useUmfpack = False" + raise ValueError("convert matrix data to double, please, using" + " .astype(), or set linsolve.useUmfpack = False") b = asarray(b, dtype=A.dtype).reshape(-1) @@ -163,7 +163,7 @@ M, N = A.shape if (M != N): - raise ValueError, "can only factor square matrices" #is this true? + raise ValueError("can only factor square matrices") #is this true? _options = dict(DiagPivotThresh=diag_pivot_thresh, ColPerm=permc_spec, PanelSize=panel_size, Relax=relax) @@ -233,7 +233,7 @@ M, N = A.shape if (M != N): - raise ValueError, "can only factor square matrices" #is this true? + raise ValueError("can only factor square matrices") #is this true? _options = dict(ILU_DropRule=drop_rule, ILU_DropTol=drop_tol, ILU_FillFactor=fill_factor, @@ -255,7 +255,7 @@ """ if isUmfpack and useUmfpack: if noScikit: - warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,'\ + warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,' ' install scikits.umfpack instead', DeprecationWarning ) if not isspmatrix_csc(A): @@ -266,8 +266,8 @@ A = A.asfptype() #upcast to a floating point format if A.dtype.char not in 'dD': - raise ValueError, "convert matrix data to double, please, using"\ - " .astype(), or set linsolve.useUmfpack = False" + raise ValueError("convert matrix data to double, please, using" + " .astype(), or set linsolve.useUmfpack = False") family = {'d' : 'di', 'D' : 'zi'} umf = umfpack.UmfpackContext( family[A.dtype.char] ) Modified: trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py =================================================================== --- trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-17 13:43:22 UTC (rev 6810) +++ trunk/scipy/sparse/linalg/dsolve/tests/test_linsolve.py 2010-09-18 04:41:54 UTC (rev 6811) @@ -37,7 +37,7 @@ x = spsolve(Asp,b) - assert( norm(b - Asp*x) < 10 * cond_A * eps ) + assert_( norm(b - Asp*x) < 10 * cond_A * eps ) def test_smoketest(self): Adense = matrix([[ 0., 1., 1.], @@ -52,9 +52,14 @@ assert_array_almost_equal(x, x2) def test_non_square(self): + # A is not square. A = ones((3, 4)) b = ones((4, 1)) assert_raises(ValueError, spsolve, A, b) + # A2 and b2 have incompatible shapes. + A2 = csc_matrix(eye(3)) + b2 = array([1.0, 2.0]) + assert_raises(ValueError, spsolve, A2, b2) class TestSplu(object): def setUp(self): From scipy-svn at scipy.org Sat Sep 18 00:58:40 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 17 Sep 2010 23:58:40 -0500 (CDT) Subject: [Scipy-svn] r6812 - in trunk/scipy/sparse/linalg/eigen/arpack: . tests Message-ID: <20100918045840.F02CF39CC7C@scipy.org> Author: warren.weckesser Date: 2010-09-17 23:58:40 -0500 (Fri, 17 Sep 2010) New Revision: 6812 Modified: trunk/scipy/sparse/linalg/eigen/arpack/arpack.py trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py Log: BUG: sparse: Incorrect formatting in the eigen() function of arpack.py resulted in a TypeError instead of a ValueError when a matrix with an invalid shape was given. Modified: trunk/scipy/sparse/linalg/eigen/arpack/arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/arpack.py 2010-09-18 04:41:54 UTC (rev 6811) +++ trunk/scipy/sparse/linalg/eigen/arpack/arpack.py 2010-09-18 04:58:40 UTC (rev 6812) @@ -383,7 +383,7 @@ """ A = aslinearoperator(A) if A.shape[0] != A.shape[1]: - raise ValueError('expected square matrix (shape=%s)' % A.shape) + raise ValueError('expected square matrix (shape=%s)' % (A.shape,)) n = A.shape[0] matvec = lambda x : A.matvec(x) @@ -476,7 +476,7 @@ """ A = aslinearoperator(A) if A.shape[0] != A.shape[1]: - raise ValueError('expected square matrix (shape=%s)' % shape) + raise ValueError('expected square matrix (shape=%s)' % (A.shape,)) n = A.shape[0] if M is not None: @@ -513,7 +513,7 @@ n, m = A.shape if np.iscomplexobj(A): - raise NotImplementedError("Complex support for sparse SVD not " \ + raise NotImplementedError("Complex support for sparse SVD not " "implemented yet") op = lambda x: x.T.conjugate() else: Modified: trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py =================================================================== --- trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-18 04:41:54 UTC (rev 6811) +++ trunk/scipy/sparse/linalg/eigen/arpack/tests/test_arpack.py 2010-09-18 04:58:40 UTC (rev 6812) @@ -8,9 +8,10 @@ from numpy.testing import assert_almost_equal, assert_array_almost_equal, \ assert_array_almost_equal_nulp, TestCase, run_module_suite, dec, \ - verbose + assert_raises, verbose from numpy import array, finfo, argsort, dot, round, conj, random +from scipy.sparse import csc_matrix from scipy.sparse.linalg.eigen.arpack import eigen_symmetric, eigen, svd from scipy.linalg import svd as dsvd @@ -155,10 +156,9 @@ k=2 for typ in 'FD': for which in ['LM','SM','LR','SR']: - self.eval_evec(self.symmetric[0],typ,k,which) + self.eval_evec(self.symmetric[0],typ,k,which) - class TestEigenNonSymmetric(TestArpack): @@ -268,6 +268,13 @@ for m in self.nonsymmetric: self.eval_evec(m,typ,k,which) + +def test_eigen_bad_shapes(): + # A is not square. + A = csc_matrix(np.zeros((2,3))) + assert_raises(ValueError, eigen, A) + + def sorted_svd(m, k): """Compute svd of a dense matrix m, and return singular vectors/values sorted.""" From scipy-svn at scipy.org Wed Sep 22 05:00:38 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 22 Sep 2010 04:00:38 -0500 (CDT) Subject: [Scipy-svn] r6813 - trunk/scipy/spatial Message-ID: <20100922090038.B6C9439CC7C@scipy.org> Author: ptvirtan Date: 2010-09-22 04:00:38 -0500 (Wed, 22 Sep 2010) New Revision: 6813 Modified: trunk/scipy/spatial/qhull.pyx Log: BUG: spatial/qhull: ensure that _find_simplex always terminates, even when compiled with optimizations on Modified: trunk/scipy/spatial/qhull.pyx =================================================================== --- trunk/scipy/spatial/qhull.pyx 2010-09-18 04:58:40 UTC (rev 6812) +++ trunk/scipy/spatial/qhull.pyx 2010-09-22 09:00:38 UTC (rev 6813) @@ -27,6 +27,9 @@ extern void *stderr extern void *stdout +cdef extern from "math.h": + double fabs(double x) nogil + cdef extern from "qhull/src/qset.h": ctypedef union setelemT: void *p @@ -832,7 +835,14 @@ if ineigh == -1: continue dist = _distplane(d, ineigh, z) - if dist > best_dist: + + # Note addition of eps -- otherwise, this code does not + # necessarily terminate! The compiler may use extended + # accuracy of the FPU so that (dist > best_dist), but + # after storing to double size, dist == best_dist, + # resulting to non-terminating loop + + if dist > best_dist + eps*(1 + fabs(best_dist)): # Note: this is intentional: we jump in the middle of the cycle, # and continue the cycle from the next k. # From scipy-svn at scipy.org Wed Sep 22 05:00:45 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 22 Sep 2010 04:00:45 -0500 (CDT) Subject: [Scipy-svn] r6814 - trunk/scipy/spatial Message-ID: <20100922090045.C4A9439CD02@scipy.org> Author: ptvirtan Date: 2010-09-22 04:00:45 -0500 (Wed, 22 Sep 2010) New Revision: 6814 Modified: trunk/scipy/spatial/qhull.pyx Log: BUG: spatial/qhull: handle degenerate simplices correctly in _find_simplex_directed Modified: trunk/scipy/spatial/qhull.pyx =================================================================== --- trunk/scipy/spatial/qhull.pyx 2010-09-22 09:00:38 UTC (rev 6813) +++ trunk/scipy/spatial/qhull.pyx 2010-09-22 09:00:45 UTC (rev 6814) @@ -713,24 +713,20 @@ if c[k] < -eps: # The target point is in the direction of neighbor `k`! - m = d.neighbors[(ndim+1)*isimplex + k] if m == -1: # The point is outside the triangulation: bail out start[0] = isimplex return -1 - # Check that the target simplex is not degenerate. - v = d.transform[m*ndim*(ndim+1)] - if v != v: - # nan - continue - else: - isimplex = m - inside = -1 - break - elif c[k] > 1 + eps: - # we're outside this simplex + isimplex = m + inside = -1 + break + elif c[k] <= 1 + eps: + # we're inside this simplex + pass + else: + # we're outside (or the coordinate is nan; a degenerate simplex) inside = 0 if inside == -1: From scipy-svn at scipy.org Wed Sep 22 05:00:53 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 22 Sep 2010 04:00:53 -0500 (CDT) Subject: [Scipy-svn] r6815 - trunk/scipy/spatial Message-ID: <20100922090053.737A739CD30@scipy.org> Author: ptvirtan Date: 2010-09-22 04:00:53 -0500 (Wed, 22 Sep 2010) New Revision: 6815 Modified: trunk/scipy/spatial/qhull.c Log: GEN: spatial: regenerate qhull.c Modified: trunk/scipy/spatial/qhull.c =================================================================== --- trunk/scipy/spatial/qhull.c 2010-09-22 09:00:45 UTC (rev 6814) +++ trunk/scipy/spatial/qhull.c 2010-09-22 09:00:53 UTC (rev 6815) @@ -2,17 +2,38 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG +#include +#ifndef offsetof +#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif + +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif + +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif + #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) @@ -82,13 +103,37 @@ #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact -#else +#endif + +#if PY_VERSION_HEX < 0x02060000 + #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type + #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact + #define PyBytes_FromString PyString_FromString + #define PyBytes_FromStringAndSize PyString_FromStringAndSize + #define PyBytes_FromFormat PyString_FromFormat + #define PyBytes_DecodeEscape PyString_DecodeEscape + #define PyBytes_AsString PyString_AsString + #define PyBytes_AsStringAndSize PyString_AsStringAndSize + #define PyBytes_Size PyString_Size + #define PyBytes_AS_STRING PyString_AS_STRING + #define PyBytes_GET_SIZE PyString_GET_SIZE + #define PyBytes_Repr PyString_Repr + #define PyBytes_Concat PyString_Concat + #define PyBytes_ConcatAndDel PyString_ConcatAndDel + #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) + #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif +#ifndef PySet_CheckExact +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -103,32 +148,25 @@ #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask +#endif + +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif + + +#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif #if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) + #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -146,11 +184,16 @@ #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif + #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif + +#if defined(WIN32) || defined(MS_WINDOWS) +#define _USE_MATH_DEFINES +#endif #include #define __PYX_HAVE_API__scipy__spatial__qhull #include "stdlib.h" @@ -158,104 +201,51 @@ #include "stdio.h" #include "numpy/arrayobject.h" #include "numpy/ufuncobject.h" +#include "math.h" #include "qhull/src/qset.h" #include "qhull/src/qhull.h" #include "qhull_blas.h" + #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif + +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || defined(__INTEL_COMPILER) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif + typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif +#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) +#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) - #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - - -#if !defined(T_ULONGLONG) -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : -1)))) -#else -#define __Pyx_T_UNSIGNED_INT(x) \ - ((sizeof(x) == sizeof(unsigned char)) ? T_UBYTE : \ - ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \ - ((sizeof(x) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(x) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))))) -#endif -#if !defined(T_LONGLONG) -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : -1)))) -#else -#define __Pyx_T_SIGNED_INT(x) \ - ((sizeof(x) == sizeof(char)) ? T_BYTE : \ - ((sizeof(x) == sizeof(short)) ? T_SHORT : \ - ((sizeof(x) == sizeof(int)) ? T_INT : \ - ((sizeof(x) == sizeof(long)) ? T_LONG : \ - ((sizeof(x) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))))) -#endif - -#define __Pyx_T_FLOATING(x) \ - ((sizeof(x) == sizeof(float)) ? T_FLOAT : \ - ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1)) - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); @@ -265,7 +255,7 @@ #ifdef __GNUC__ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else @@ -285,7 +275,6 @@ static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; -static const char **__pyx_f; #if !defined(CYTHON_CCOMPLEX) @@ -311,6 +300,11 @@ #define _Complex_I 1.0fj #endif +static const char *__pyx_f[] = { + "qhull.pyx", + "numpy.pxd", +}; + typedef npy_int8 __pyx_t_5numpy_int8_t; typedef npy_int16 __pyx_t_5numpy_int16_t; @@ -465,7 +459,12 @@ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact); + + struct __Pyx_StructField_; typedef struct { @@ -487,8 +486,8 @@ } __Pyx_BufFmt_StackElem; +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack); static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); @@ -496,10 +495,10 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); -static int __Pyx_EndUnpack(PyObject *); +static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); @@ -526,11 +525,11 @@ } -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -543,14 +542,14 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -563,15 +562,15 @@ return r; } } - return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ +#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ + __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -585,7 +584,7 @@ r = PySequence_GetItem(o, i); } else { - r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i)); + r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } @@ -593,9 +592,6 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); @@ -609,14 +605,14 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); - static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp); +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_flagT(flagT); +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t); + #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) @@ -716,6 +712,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); @@ -751,6 +749,8 @@ + + static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; @@ -781,8 +781,8 @@ static int __pyx_f_5scipy_7spatial_5qhull__find_simplex(__pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, double *, double *, int *, double); static void __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init(__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *, __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int); static void __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next(__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *); -static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "numpy.double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; -static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "numpy.npy_int", NULL, sizeof(npy_int), 'I' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' }; +static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int = { "npy_int", NULL, sizeof(npy_int), 'I' }; #define __Pyx_MODULE_NAME "scipy.spatial.qhull" int __pyx_module_is_main_scipy__spatial__qhull = 0; @@ -812,7 +812,17 @@ static char __pyx_k_17[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_18[] = "Format string allocated too short."; static char __pyx_k_19[] = "\nWrappers for Qhull triangulation, plus some additional N-D geometry utilities\n\n.. versionadded:: 0.9\n\n"; -static char __pyx_k_20[] = "\n Delaunay(points)\n\n Delaunay tesselation in N dimensions\n\n .. versionadded:: 0.9\n\n Parameters\n ----------\n points : ndarray of floats, shape (npoints, ndim)\n Coordinates of points to triangulate\n\n Attributes\n ----------\n points : ndarray of double, shape (npoints, ndim)\n Points in the triangulation\n vertices : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of vertices forming simplices in the triangulation\n neighbors : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of neighbor simplices for each simplex.\n The kth neighbor is opposite to the kth vertex.\n For simplices at the boundary, -1 denotes no neighbor.\n equations : ndarray of double, shape (nsimplex, ndim+2)\n [normal, offset] forming the hyperplane equation of the facet\n on the paraboloid. (See [Qhull]_ documentation for more.)\n paraboloid_scale, paraboloid_shift : float\n Scale and shift for the extra paraboloid dimension.\n (See [Qhull]_ documentation for more.)\n transform : ndarray of double, shape (nsimplex, ndim+1, ndim)\n Affine transform from ``x`` to the barycentric coordinates ``c``.\n This is defined by::\n\n T c = x - r\n\n At vertex ``j``, ``c_j = 1`` and the other coordinates zero.\n\n For simplex ``i``, ``transform[i,:ndim,:ndim]`` contains\n inverse of the matrix ``T``, and ``transform[i,ndim,:]``\n contains the vector ``r``.\n vertex_to_simplex : ndarray of int, shape (npoints,)\n Lookup array, from a vertex, to some simplex which it is a part of.\n convex_hull : ndarray of int, shape (nfaces, ndim)\n Vertices of facets forming the convex hull of the point set.\n The array contains the indices of the points belonging to\n the (N-1)-dimensional facets that form the convex hull\n of the triangulation.\n\n Notes\n -----\n The tesselation is computed using the Qhull libary [Qhull]_.\n\n References\n ----------\n\n .. [Qhull] http://www.qhull.org/\n\n "; +static char __pyx_k_20[] = "\n Delaunay(points)\n\n Delaunay tesselation in N dimensions\n\n .. versionadded:: 0.9\n\n Parameters\n ----------\n points : ndarray of floats, shape (npoints, ndim)\n Coordinates of points to triangulate\n\n Attributes\n ----------\n points : ndarray of double, shape (npoints, ndim)\n Points in the triangulation\n vertices : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of vertices forming simplices in the triangulation\n neighbors : ndarray of ints, shape (nsimplex, ndim+1)\n Indices of neighbor simplices for each simplex.\n The kth neighbor is opposite to the kth vertex.\n For simplices at the boundary, -1 denotes no neighbor.\n equations : ndarray of double, shape (nsimplex, ndim+2)\n [normal, offset] forming the hyperplane equation of the facet\n on the paraboloid. (See [Qhull]_ documentation for more.)\n paraboloid_scale, paraboloid_shift : float\n Scale and shift for the extra paraboloid dimension.\n (See [Qhull]_ documentation for more.)\n transform : ndarray of double, shape (nsimplex, ndim+1, ndim)\n Affine transform from ``x`` to the barycentric coordinates ``c``.\n This is defined by::\n\n T c = x - r\n\n At vertex ``j``, ``c_j = 1`` and the other coordinates zero.\n\n For simplex ``i``, ``transform[i,:ndim,:ndim]`` contains\n inverse of the matrix ``T``, and ``transform[i,ndim,:]``\n contains the vector ``r``.\n vertex_to_simplex : ndarray of int, shape (npoints,)\n Lookup array, from a vertex, to some simplex which it is a part of.\n convex_hull : ndarray of int, shape (nfaces, ndim)\n Vertices of facets forming the convex hull of the point set.\n The array contains the indices of the points belonging to\n the (N-1)-dimensional facets that form the convex hull\n of the triangulation.\n\n Notes\n -----\n The tesselation is computed usi""ng the Qhull libary [Qhull]_.\n\n References\n ----------\n\n .. [Qhull] http://www.qhull.org/\n\n "; +static char __pyx_k_21[] = "_construct_delaunay (line 134)"; +static char __pyx_k_22[] = "_qhull_get_facet_array (line 197)"; +static char __pyx_k_23[] = "_get_barycentric_transforms (line 278)"; +static char __pyx_k_24[] = "Delaunay.transform (line 941)"; +static char __pyx_k_25[] = "Delaunay.vertex_to_simplex (line 964)"; +static char __pyx_k_26[] = "Delaunay.convex_hull (line 994)"; +static char __pyx_k_27[] = "Delaunay.find_simplex (line 1040)"; +static char __pyx_k_28[] = "Delaunay.plane_distance (line 1112)"; +static char __pyx_k_29[] = "Delaunay.lift_points (line 1147)"; +static char __pyx_k_30[] = "tsearch (line 1162)"; static char __pyx_k__B[] = "B"; static char __pyx_k__H[] = "H"; static char __pyx_k__I[] = "I"; @@ -891,6 +901,7 @@ static char __pyx_k__Delaunay[] = "Delaunay"; static char __pyx_k____init__[] = "__init__"; static char __pyx_k____main__[] = "__main__"; +static char __pyx_k____test__[] = "__test__"; static char __pyx_k__delaunay[] = "delaunay"; static char __pyx_k__facet_id[] = "facet_id"; static char __pyx_k__itemsize[] = "itemsize"; @@ -946,7 +957,17 @@ static PyObject *__pyx_kp_u_18; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_20; +static PyObject *__pyx_kp_u_21; +static PyObject *__pyx_kp_u_22; +static PyObject *__pyx_kp_u_23; +static PyObject *__pyx_kp_u_24; +static PyObject *__pyx_kp_u_25; +static PyObject *__pyx_kp_u_26; +static PyObject *__pyx_kp_u_27; +static PyObject *__pyx_kp_u_28; +static PyObject *__pyx_kp_u_29; static PyObject *__pyx_kp_s_3; +static PyObject *__pyx_kp_u_30; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_n_s_5; static PyObject *__pyx_kp_s_6; @@ -963,6 +984,7 @@ static PyObject *__pyx_n_s____all__; static PyObject *__pyx_n_s____init__; static PyObject *__pyx_n_s____main__; +static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s___construct_delaunay; static PyObject *__pyx_n_s___qhull_lock; static PyObject *__pyx_n_s___transform; @@ -1078,8 +1100,8 @@ int __pyx_v_dim; int __pyx_v_numpoints; int __pyx_v_exitcode; - PyObject *__pyx_v_paraboloid_scale; - PyObject *__pyx_v_paraboloid_shift; + double __pyx_v_paraboloid_scale; + double __pyx_v_paraboloid_shift; PyObject *__pyx_v_vertices; PyObject *__pyx_v_neighbors; PyObject *__pyx_v_equations; @@ -1098,25 +1120,22 @@ PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - boolT __pyx_t_10; - realT __pyx_t_11; + realT __pyx_t_10; + PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; + int __pyx_t_13; int __pyx_t_14; - int __pyx_t_15; __Pyx_RefNannySetupContext("_construct_delaunay"); __pyx_self = __pyx_self; __Pyx_INCREF((PyObject *)__pyx_v_points); - __pyx_v_paraboloid_scale = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_paraboloid_shift = Py_None; __Pyx_INCREF(Py_None); __pyx_v_vertices = Py_None; __Pyx_INCREF(Py_None); __pyx_v_neighbors = Py_None; __Pyx_INCREF(Py_None); __pyx_v_equations = Py_None; __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; @@ -1125,21 +1144,21 @@ __pyx_v_options = __pyx_k_1; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_t_3; { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1156,7 +1175,7 @@ } __pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; - if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_points); @@ -1174,17 +1193,17 @@ if (__pyx_t_9) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_2)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; @@ -1194,28 +1213,28 @@ if (__pyx_t_9) { - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_3)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___qhull_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___qhull_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__acquire); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__acquire); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1237,17 +1256,17 @@ if (__pyx_t_9) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_4)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L11;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L11;} goto __pyx_L13; } __pyx_L13:; @@ -1256,134 +1275,120 @@ qh_triangulate(); - __pyx_t_10 = qh_qh.SCALElast; - if (__pyx_t_10) { + if (qh_qh.SCALElast) { - __pyx_t_11 = (qh_qh.last_high - qh_qh.last_low); - if (unlikely(__pyx_t_11 == 0)) { + __pyx_t_10 = (qh_qh.last_high - qh_qh.last_low); + if (unlikely(__pyx_t_10 == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L11;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L11;} } - __pyx_t_1 = PyFloat_FromDouble((qh_qh.last_newhigh / __pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_paraboloid_scale); - __pyx_v_paraboloid_scale = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_paraboloid_scale = (qh_qh.last_newhigh / __pyx_t_10); - __pyx_t_1 = PyFloat_FromDouble((-qh_qh.last_low)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_paraboloid_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_paraboloid_shift); - __pyx_v_paraboloid_shift = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_paraboloid_shift = ((-qh_qh.last_low) * __pyx_v_paraboloid_scale); goto __pyx_L14; } { - __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_paraboloid_scale); - __pyx_v_paraboloid_scale = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_paraboloid_scale = 1.0; - __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_paraboloid_shift); - __pyx_v_paraboloid_shift = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_paraboloid_shift = 0.0; } __pyx_L14:; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_numpoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_numpoints); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_1 = 0; + __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) { PyObject* tuple = __pyx_t_2; - __pyx_t_12 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_12); - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_1); + __pyx_t_11 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_11); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_vertices); - __pyx_v_vertices = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_v_vertices = __pyx_t_11; + __pyx_t_11 = 0; __Pyx_DECREF(__pyx_v_neighbors); - __pyx_v_neighbors = __pyx_t_3; + __pyx_v_neighbors = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_v_equations); + __pyx_v_equations = __pyx_t_3; __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_equations); - __pyx_v_equations = __pyx_t_1; - __pyx_t_1 = 0; } else { - __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_12 = __Pyx_UnpackItem(__pyx_t_13, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_13, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_11 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_12, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_13, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_EndUnpack(__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__Pyx_EndUnpack(__pyx_t_12, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_v_vertices); - __pyx_v_vertices = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_v_vertices = __pyx_t_11; + __pyx_t_11 = 0; __Pyx_DECREF(__pyx_v_neighbors); - __pyx_v_neighbors = __pyx_t_3; + __pyx_v_neighbors = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_v_equations); + __pyx_v_equations = __pyx_t_3; __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_equations); - __pyx_v_equations = __pyx_t_1; - __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L11;} + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_paraboloid_scale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L11;} __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_paraboloid_shift); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L11;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_vertices); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vertices); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices); __Pyx_GIVEREF(__pyx_v_vertices); __Pyx_INCREF(__pyx_v_neighbors); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_neighbors); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_neighbors); __Pyx_GIVEREF(__pyx_v_neighbors); __Pyx_INCREF(__pyx_v_equations); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_equations); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_equations); __Pyx_GIVEREF(__pyx_v_equations); - __Pyx_INCREF(__pyx_v_paraboloid_scale); - PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_paraboloid_scale); - __Pyx_GIVEREF(__pyx_v_paraboloid_scale); - __Pyx_INCREF(__pyx_v_paraboloid_shift); - PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_paraboloid_shift); - __Pyx_GIVEREF(__pyx_v_paraboloid_shift); - __pyx_r = __pyx_t_2; + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L10; } + + { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; @@ -1394,18 +1399,16 @@ __pyx_why = 3; goto __pyx_L12; __pyx_L11: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; goto __pyx_L12; } __pyx_L12:; - - qh_freeqhull(0); @@ -1414,40 +1417,40 @@ __pyx_t_9 = (__pyx_v_curlong != 0); if (!__pyx_t_9) { - __pyx_t_14 = (__pyx_v_totlong != 0); - __pyx_t_15 = __pyx_t_14; + __pyx_t_13 = (__pyx_v_totlong != 0); + __pyx_t_14 = __pyx_t_13; } else { - __pyx_t_15 = __pyx_t_9; + __pyx_t_14 = __pyx_t_9; } - if (__pyx_t_15) { + if (__pyx_t_14) { - __pyx_t_2 = PyInt_FromLong(__pyx_v_totlong); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L15_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyInt_FromLong(__pyx_v_curlong); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_totlong); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L15_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_curlong); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L15_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L15_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L15_error;} __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L15_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L15_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L15_error;} goto __pyx_L16; } __pyx_L16:; @@ -1473,6 +1476,8 @@ } } } + + { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; @@ -1483,27 +1488,25 @@ __pyx_why = 3; goto __pyx_L9; __pyx_L8: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; goto __pyx_L9; } __pyx_L9:; - - - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___qhull_lock); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L18_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___qhull_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L18_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__release); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L19; __pyx_L18_error:; if (__pyx_why == 4) { @@ -1532,8 +1535,8 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_points); @@ -1544,8 +1547,6 @@ __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_points); __pyx_L2:; - __Pyx_DECREF(__pyx_v_paraboloid_scale); - __Pyx_DECREF(__pyx_v_paraboloid_shift); __Pyx_DECREF(__pyx_v_vertices); __Pyx_DECREF(__pyx_v_neighbors); __Pyx_DECREF(__pyx_v_equations); @@ -1607,16 +1608,15 @@ PyArrayObject *__pyx_t_14 = NULL; PyArrayObject *__pyx_t_15 = NULL; PyArrayObject *__pyx_t_16 = NULL; - flagT __pyx_t_17; - long __pyx_t_18; + long __pyx_t_17; + int __pyx_t_18; int __pyx_t_19; int __pyx_t_20; - int __pyx_t_21; - unsigned int __pyx_t_22; + unsigned int __pyx_t_21; + int __pyx_t_22; int __pyx_t_23; int __pyx_t_24; int __pyx_t_25; - int __pyx_t_26; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ndim,&__pyx_n_s__numpoints,0}; __Pyx_RefNannySetupContext("_qhull_get_facet_array"); __pyx_self = __pyx_self; @@ -1638,25 +1638,26 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__numpoints); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_qhull_get_facet_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_qhull_get_facet_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_qhull_get_facet_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_qhull_get_facet_array") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - __pyx_v_ndim = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_ndim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_numpoints = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_ndim = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_ndim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_numpoints = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { - __pyx_v_ndim = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_ndim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_numpoints = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_ndim = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_ndim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_numpoints = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_numpoints == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_qhull_get_facet_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_qhull_get_facet_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull._qhull_get_facet_array"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -1669,38 +1670,38 @@ __pyx_bstruct_id_map.buf = NULL; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyLong_FromUnsignedLong(qh_qh.facet_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyLong_FromUnsignedLong(qh_qh.facet_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1717,7 +1718,7 @@ } __pyx_bstride_0_id_map = __pyx_bstruct_id_map.strides[0]; __pyx_bshape_0_id_map = __pyx_bstruct_id_map.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_id_map)); @@ -1725,14 +1726,14 @@ __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_id_map), __pyx_n_s__fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_id_map), __pyx_n_s__fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -1765,10 +1766,10 @@ __pyx_t_13 = __pyx_v_facet->id; __pyx_t_7 = -1; - if (unlikely(__pyx_t_13 >= __pyx_bshape_0_id_map)) __pyx_t_7 = 0; + if (unlikely(__pyx_t_13 >= (size_t)__pyx_bshape_0_id_map)) __pyx_t_7 = 0; if (unlikely(__pyx_t_7 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_7); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_id_map.buf, __pyx_t_13, __pyx_bstride_0_id_map) = __pyx_v_j; @@ -1783,16 +1784,16 @@ } - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1800,26 +1801,26 @@ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1836,7 +1837,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -1844,16 +1845,16 @@ __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); @@ -1861,26 +1862,26 @@ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__intc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1897,7 +1898,7 @@ } __pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_15 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_neighbors)); @@ -1905,16 +1906,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_ndim + 2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -1922,26 +1923,26 @@ __Pyx_GIVEREF(__pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1958,7 +1959,7 @@ } __pyx_bstride_0_equations = __pyx_bstruct_equations.strides[0]; __pyx_bstride_1_equations = __pyx_bstruct_equations.strides[1]; __pyx_bshape_0_equations = __pyx_bstruct_equations.shape[0]; __pyx_bshape_1_equations = __pyx_bstruct_equations.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_16 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_equations)); @@ -1985,24 +1986,23 @@ if (__pyx_t_12) { - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } __pyx_L11:; - __pyx_t_17 = __pyx_v_facet->upperdelaunay; - if (__pyx_t_17) { + if (__pyx_v_facet->upperdelaunay) { __pyx_v_facet = __pyx_v_facet->next; @@ -2014,8 +2014,8 @@ __pyx_L12:; - __pyx_t_18 = (__pyx_v_ndim + 1); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_18; __pyx_t_7+=1) { + __pyx_t_17 = (__pyx_v_ndim + 1); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; @@ -2025,99 +2025,99 @@ __pyx_v_point = qh_pointid(__pyx_v_vertex->point); - __pyx_t_19 = __pyx_v_j; - __pyx_t_20 = __pyx_v_i; - __pyx_t_21 = -1; + __pyx_t_18 = __pyx_v_j; + __pyx_t_19 = __pyx_v_i; + __pyx_t_20 = -1; + if (__pyx_t_18 < 0) { + __pyx_t_18 += __pyx_bshape_0_vertices; + if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0; + } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_vertices)) __pyx_t_20 = 0; if (__pyx_t_19 < 0) { - __pyx_t_19 += __pyx_bshape_0_vertices; - if (unlikely(__pyx_t_19 < 0)) __pyx_t_21 = 0; - } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_vertices)) __pyx_t_21 = 0; - if (__pyx_t_20 < 0) { - __pyx_t_20 += __pyx_bshape_1_vertices; - if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 1; - } else if (unlikely(__pyx_t_20 >= __pyx_bshape_1_vertices)) __pyx_t_21 = 1; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 += __pyx_bshape_1_vertices; + if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1; + } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_vertices)) __pyx_t_20 = 1; + if (unlikely(__pyx_t_20 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_20); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_19, __pyx_bstride_0_vertices, __pyx_t_20, __pyx_bstride_1_vertices) = __pyx_v_point; + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_18, __pyx_bstride_0_vertices, __pyx_t_19, __pyx_bstride_1_vertices) = __pyx_v_point; } - __pyx_t_18 = (__pyx_v_ndim + 1); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_18; __pyx_t_7+=1) { + __pyx_t_17 = (__pyx_v_ndim + 1); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; __pyx_v_neighbor = ((facetT *)(__pyx_v_facet->neighbors->e[__pyx_v_i]).p); - __pyx_t_22 = __pyx_v_neighbor->id; - __pyx_t_21 = -1; - if (unlikely(__pyx_t_22 >= __pyx_bshape_0_id_map)) __pyx_t_21 = 0; - if (unlikely(__pyx_t_21 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_21); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_21 = __pyx_v_neighbor->id; + __pyx_t_20 = -1; + if (unlikely(__pyx_t_21 >= (size_t)__pyx_bshape_0_id_map)) __pyx_t_20 = 0; + if (unlikely(__pyx_t_20 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_20); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_21 = __pyx_v_j; - __pyx_t_23 = __pyx_v_i; - __pyx_t_24 = -1; - if (__pyx_t_21 < 0) { - __pyx_t_21 += __pyx_bshape_0_neighbors; - if (unlikely(__pyx_t_21 < 0)) __pyx_t_24 = 0; - } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_neighbors)) __pyx_t_24 = 0; - if (__pyx_t_23 < 0) { - __pyx_t_23 += __pyx_bshape_1_neighbors; - if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 1; - } else if (unlikely(__pyx_t_23 >= __pyx_bshape_1_neighbors)) __pyx_t_24 = 1; - if (unlikely(__pyx_t_24 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_24); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = __pyx_v_j; + __pyx_t_22 = __pyx_v_i; + __pyx_t_23 = -1; + if (__pyx_t_20 < 0) { + __pyx_t_20 += __pyx_bshape_0_neighbors; + if (unlikely(__pyx_t_20 < 0)) __pyx_t_23 = 0; + } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_neighbors)) __pyx_t_23 = 0; + if (__pyx_t_22 < 0) { + __pyx_t_22 += __pyx_bshape_1_neighbors; + if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 1; + } else if (unlikely(__pyx_t_22 >= __pyx_bshape_1_neighbors)) __pyx_t_23 = 1; + if (unlikely(__pyx_t_23 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_23); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_neighbors.buf, __pyx_t_21, __pyx_bstride_0_neighbors, __pyx_t_23, __pyx_bstride_1_neighbors) = (*__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_id_map.buf, __pyx_t_22, __pyx_bstride_0_id_map)); + *__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_neighbors.buf, __pyx_t_20, __pyx_bstride_0_neighbors, __pyx_t_22, __pyx_bstride_1_neighbors) = (*__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_id_map.buf, __pyx_t_21, __pyx_bstride_0_id_map)); } - __pyx_t_18 = (__pyx_v_ndim + 1); - for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_18; __pyx_t_7+=1) { + __pyx_t_17 = (__pyx_v_ndim + 1); + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_17; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - __pyx_t_24 = __pyx_v_j; - __pyx_t_25 = __pyx_v_i; - __pyx_t_26 = -1; + __pyx_t_23 = __pyx_v_j; + __pyx_t_24 = __pyx_v_i; + __pyx_t_25 = -1; + if (__pyx_t_23 < 0) { + __pyx_t_23 += __pyx_bshape_0_equations; + if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 0; + } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_equations)) __pyx_t_25 = 0; if (__pyx_t_24 < 0) { - __pyx_t_24 += __pyx_bshape_0_equations; - if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 0; - } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_equations)) __pyx_t_26 = 0; - if (__pyx_t_25 < 0) { - __pyx_t_25 += __pyx_bshape_1_equations; - if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 1; - } else if (unlikely(__pyx_t_25 >= __pyx_bshape_1_equations)) __pyx_t_26 = 1; - if (unlikely(__pyx_t_26 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_26); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_24 += __pyx_bshape_1_equations; + if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 1; + } else if (unlikely(__pyx_t_24 >= __pyx_bshape_1_equations)) __pyx_t_25 = 1; + if (unlikely(__pyx_t_25 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_25); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_equations.buf, __pyx_t_24, __pyx_bstride_0_equations, __pyx_t_25, __pyx_bstride_1_equations) = (__pyx_v_facet->normal[__pyx_v_i]); + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_equations.buf, __pyx_t_23, __pyx_bstride_0_equations, __pyx_t_24, __pyx_bstride_1_equations) = (__pyx_v_facet->normal[__pyx_v_i]); } __pyx_t_7 = __pyx_v_j; - __pyx_t_18 = (__pyx_v_ndim + 1); - __pyx_t_26 = -1; + __pyx_t_17 = (__pyx_v_ndim + 1); + __pyx_t_25 = -1; if (__pyx_t_7 < 0) { __pyx_t_7 += __pyx_bshape_0_equations; - if (unlikely(__pyx_t_7 < 0)) __pyx_t_26 = 0; - } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_equations)) __pyx_t_26 = 0; - if (__pyx_t_18 < 0) { - __pyx_t_18 += __pyx_bshape_1_equations; - if (unlikely(__pyx_t_18 < 0)) __pyx_t_26 = 1; - } else if (unlikely(__pyx_t_18 >= __pyx_bshape_1_equations)) __pyx_t_26 = 1; - if (unlikely(__pyx_t_26 != -1)) { - __Pyx_RaiseBufferIndexError(__pyx_t_26); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) __pyx_t_25 = 0; + } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_equations)) __pyx_t_25 = 0; + if (__pyx_t_17 < 0) { + __pyx_t_17 += __pyx_bshape_1_equations; + if (unlikely(__pyx_t_17 < 0)) __pyx_t_25 = 1; + } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_equations)) __pyx_t_25 = 1; + if (unlikely(__pyx_t_25 != -1)) { + __Pyx_RaiseBufferIndexError(__pyx_t_25); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_equations.buf, __pyx_t_7, __pyx_bstride_0_equations, __pyx_t_18, __pyx_bstride_1_equations) = __pyx_v_facet->offset; + *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_equations.buf, __pyx_t_7, __pyx_bstride_0_equations, __pyx_t_17, __pyx_bstride_1_equations) = __pyx_v_facet->offset; __pyx_v_j += 1; @@ -2129,7 +2129,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_vertices)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_vertices)); @@ -2331,11 +2331,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertices); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("_get_barycentric_transforms", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_get_barycentric_transforms", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_get_barycentric_transforms") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_get_barycentric_transforms") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_points = ((PyArrayObject *)values[0]); __pyx_v_vertices = ((PyArrayObject *)values[1]); @@ -2347,41 +2347,40 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_barycentric_transforms", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("_get_barycentric_transforms", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull._get_barycentric_transforms"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF((PyObject *)__pyx_v_points); - __Pyx_INCREF((PyObject *)__pyx_v_vertices); __pyx_v_T = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_Tinvs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_T.buf = NULL; __pyx_bstruct_Tinvs.buf = NULL; __pyx_bstruct_points.buf = NULL; __pyx_bstruct_vertices.buf = NULL; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_points), __pyx_ptype_5numpy_ndarray, 1, "points", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertices), __pyx_ptype_5numpy_ndarray, 1, "vertices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_v_points, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_v_vertices, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nan = __pyx_t_3; @@ -2392,16 +2391,16 @@ __pyx_v_nvertex = (__pyx_v_vertices->dimensions[0]); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -2409,26 +2408,26 @@ __Pyx_GIVEREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2445,7 +2444,7 @@ } __pyx_bstride_0_T = __pyx_bstruct_T.strides[0]; __pyx_bstride_1_T = __pyx_bstruct_T.strides[1]; __pyx_bshape_0_T = __pyx_bstruct_T.shape[0]; __pyx_bshape_1_T = __pyx_bstruct_T.shape[1]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_T)); @@ -2453,18 +2452,18 @@ __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__pyx_v_nvertex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_nvertex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_ndim + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -2475,26 +2474,26 @@ __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_1, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_1, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2511,7 +2510,7 @@ } __pyx_bstride_0_Tinvs = __pyx_bstruct_Tinvs.strides[0]; __pyx_bstride_1_Tinvs = __pyx_bstruct_Tinvs.strides[1]; __pyx_bstride_2_Tinvs = __pyx_bstruct_Tinvs.strides[2]; __pyx_bshape_0_Tinvs = __pyx_bstruct_Tinvs.shape[0]; __pyx_bshape_1_Tinvs = __pyx_bstruct_Tinvs.shape[1]; __pyx_bshape_2_Tinvs = __pyx_bstruct_Tinvs.shape[2]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_Tinvs)); @@ -2609,7 +2608,7 @@ __pyx_v_det = ((__pyx_v_x1 * __pyx_v_y2) - (__pyx_v_x2 * __pyx_v_y1)); - __pyx_t_14 = (__pyx_v_det == 0); + __pyx_t_14 = (__pyx_v_det == 0.0); if (__pyx_t_14) { @@ -2624,7 +2623,7 @@ if (unlikely(__pyx_v_det == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_39 = __pyx_v_ivertex; __pyx_t_40 = 0; @@ -2638,7 +2637,7 @@ __pyx_t_3 = (-__pyx_v_x2); if (unlikely(__pyx_v_det == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_42 = __pyx_v_ivertex; __pyx_t_43 = 0; @@ -2652,7 +2651,7 @@ __pyx_t_3 = (-__pyx_v_y1); if (unlikely(__pyx_v_det == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_45 = __pyx_v_ivertex; __pyx_t_46 = 1; @@ -2665,7 +2664,7 @@ if (unlikely(__pyx_v_det == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_48 = __pyx_v_ivertex; __pyx_t_49 = 1; @@ -2758,7 +2757,7 @@ if (__pyx_t_66 < 0) __pyx_t_66 += __pyx_bshape_0_Tinvs; if (__pyx_t_67 < 0) __pyx_t_67 += __pyx_bshape_1_Tinvs; if (__pyx_t_77 < 0) __pyx_t_77 += __pyx_bshape_2_Tinvs; - *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_double_t *, __pyx_bstruct_Tinvs.buf, __pyx_t_66, __pyx_bstride_0_Tinvs, __pyx_t_67, __pyx_bstride_1_Tinvs, __pyx_t_77, __pyx_bstride_2_Tinvs) = 1; + *__Pyx_BufPtrStrided3d(__pyx_t_5numpy_double_t *, __pyx_bstruct_Tinvs.buf, __pyx_t_66, __pyx_bstride_0_Tinvs, __pyx_t_67, __pyx_bstride_1_Tinvs, __pyx_t_77, __pyx_bstride_2_Tinvs) = 1.0; } @@ -2839,8 +2838,6 @@ __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_T); __Pyx_DECREF((PyObject *)__pyx_v_Tinvs); - __Pyx_DECREF((PyObject *)__pyx_v_points); - __Pyx_DECREF((PyObject *)__pyx_v_vertices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -2869,7 +2866,7 @@ __pyx_v_i = __pyx_t_2; - (__pyx_v_c[__pyx_v_i]) = 0; + (__pyx_v_c[__pyx_v_i]) = 0.0; __pyx_t_3 = __pyx_v_ndim; @@ -2887,7 +2884,7 @@ __pyx_t_5 = (__pyx_v_c[__pyx_v_i]); __pyx_t_6 = ((-__pyx_v_eps) <= __pyx_t_5); if (__pyx_t_6) { - __pyx_t_6 = (__pyx_t_5 <= (1 + __pyx_v_eps)); + __pyx_t_6 = (__pyx_t_5 <= (1.0 + __pyx_v_eps)); } __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -2904,7 +2901,7 @@ __pyx_t_5 = (__pyx_v_c[__pyx_v_ndim]); __pyx_t_7 = ((-__pyx_v_eps) <= __pyx_t_5); if (__pyx_t_7) { - __pyx_t_7 = (__pyx_t_5 <= (1 + __pyx_v_eps)); + __pyx_t_7 = (__pyx_t_5 <= (1.0 + __pyx_v_eps)); } __pyx_t_6 = (!__pyx_t_7); if (__pyx_t_6) { @@ -2953,7 +2950,7 @@ { - (__pyx_v_c[__pyx_v_i]) = 0; + (__pyx_v_c[__pyx_v_i]) = 0.0; __pyx_t_2 = __pyx_v_ndim; @@ -2987,7 +2984,7 @@ __pyx_v_i = __pyx_t_2; - (__pyx_v_c[__pyx_v_i]) = 0; + (__pyx_v_c[__pyx_v_i]) = 0.0; __pyx_t_3 = __pyx_v_ndim; @@ -3012,7 +3009,7 @@ int __pyx_t_2; - (__pyx_v_z[__pyx_v_d->ndim]) = 0; + (__pyx_v_z[__pyx_v_d->ndim]) = 0.0; __pyx_t_1 = __pyx_v_d->ndim; @@ -3023,7 +3020,7 @@ (__pyx_v_z[__pyx_v_i]) = (__pyx_v_x[__pyx_v_i]); - (__pyx_v_z[__pyx_v_d->ndim]) += pow((__pyx_v_x[__pyx_v_i]), 2); + (__pyx_v_z[__pyx_v_d->ndim]) += pow((__pyx_v_x[__pyx_v_i]), 2.0); } @@ -3148,12 +3145,11 @@ int __pyx_t_4; - __pyx_t_1 = __pyx_v_it->restart; - if (__pyx_t_1) { + if (__pyx_v_it->restart) { - __pyx_t_2 = (__pyx_v_it->start_index == -1); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_it->start_index == -1); + if (__pyx_t_1) { __pyx_v_it->index = -1; @@ -3168,19 +3164,19 @@ __pyx_v_it->triangle = __pyx_v_it->start_triangle; - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_k = __pyx_t_1; + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_k = __pyx_t_2; __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_it->triangle * 3) + __pyx_v_k)]); - __pyx_t_2 = (__pyx_v_ivertex != __pyx_v_it->vertex); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_ivertex != __pyx_v_it->vertex); + if (__pyx_t_1) { __pyx_t_3 = (__pyx_v_k != __pyx_v_it->start_index); __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_4 = __pyx_t_2; + __pyx_t_4 = __pyx_t_1; } if (__pyx_t_4) { @@ -3243,8 +3239,8 @@ if (__pyx_t_4) { - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_k = __pyx_t_1; + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_k = __pyx_t_2; __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_it->triangle * 3) + __pyx_v_k)]); @@ -3252,8 +3248,8 @@ __pyx_t_4 = (__pyx_v_ivertex != __pyx_v_it->vertex); if (__pyx_t_4) { - __pyx_t_2 = (__pyx_v_k != __pyx_v_it->index); - __pyx_t_3 = __pyx_t_2; + __pyx_t_1 = (__pyx_v_k != __pyx_v_it->index); + __pyx_t_3 = __pyx_t_1; } else { __pyx_t_3 = __pyx_t_4; } @@ -3283,8 +3279,8 @@ __pyx_L10:; - for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) { - __pyx_v_k = __pyx_t_1; + for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) { + __pyx_v_k = __pyx_t_2; __pyx_v_ivertex = (__pyx_v_it->info->vertices[((__pyx_v_itri * 3) + __pyx_v_k)]); @@ -3295,11 +3291,11 @@ __pyx_t_4 = (__pyx_v_ivertex != __pyx_v_it->vertex); - __pyx_t_2 = __pyx_t_4; + __pyx_t_1 = __pyx_t_4; } else { - __pyx_t_2 = __pyx_t_3; + __pyx_t_1 = __pyx_t_3; } - if (__pyx_t_2) { + if (__pyx_t_1) { __pyx_v_it->index = __pyx_v_k; @@ -3319,8 +3315,8 @@ __pyx_v_it->triangle = __pyx_v_itri; - __pyx_t_2 = (__pyx_v_it->triangle == __pyx_v_it->start_triangle); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_it->triangle == __pyx_v_it->start_triangle); + if (__pyx_t_1) { __pyx_v_it->index = -1; @@ -3365,11 +3361,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ivertex); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_delaunay = values[0]; __pyx_v_ivertex = values[1]; @@ -3381,40 +3377,38 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.RidgeIter2D.__init__"); + __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF((PyObject *)__pyx_v_self); - __Pyx_INCREF(__pyx_v_delaunay); - __Pyx_INCREF(__pyx_v_ivertex); ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_delaunay, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_delaunay, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_2, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_8)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; @@ -3430,7 +3424,7 @@ ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_delaunay, 0, 1); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_ivertex); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_ivertex); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init((&((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it), ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info, __pyx_t_4); __pyx_r = 0; @@ -3441,21 +3435,17 @@ __Pyx_AddTraceback("scipy.spatial.qhull.RidgeIter2D.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_self); - __Pyx_DECREF(__pyx_v_delaunay); - __Pyx_DECREF(__pyx_v_ivertex); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, PyObject *unused); -static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, PyObject *unused) { +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); +static PyObject *__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_t_1 = (((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->info != NULL); @@ -3478,7 +3468,6 @@ ((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->delaunay = Py_None; __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3517,33 +3506,32 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__next__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None); + __pyx_v_ret = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_t_1 = (((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.index == -1); if (__pyx_t_1) { - __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.vertex2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.triangle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_5scipy_7spatial_5qhull_RidgeIter2D *)__pyx_v_self)->it.triangle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -3557,8 +3545,9 @@ __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_t_6; + if (!(likely(PyTuple_CheckExact(__pyx_t_6))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_v_ret)); + __pyx_v_ret = ((PyObject *)__pyx_t_6); __pyx_t_6 = 0; @@ -3566,8 +3555,8 @@ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); - __pyx_r = __pyx_v_ret; + __Pyx_INCREF(((PyObject *)__pyx_v_ret)); + __pyx_r = ((PyObject *)__pyx_v_ret); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3582,7 +3571,6 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_ret); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3639,7 +3627,6 @@ int __pyx_r; int __pyx_t_1; int __pyx_t_2; - int __pyx_t_3; __pyx_t_1 = __pyx_f_5scipy_7spatial_5qhull__is_point_fully_outside(__pyx_v_d, __pyx_v_x, __pyx_v_eps); @@ -3661,8 +3648,7 @@ __pyx_v_inside = __pyx_f_5scipy_7spatial_5qhull__barycentric_inside(__pyx_v_d->ndim, (__pyx_v_d->transform + ((__pyx_v_isimplex * __pyx_v_d->ndim) * (__pyx_v_d->ndim + 1))), __pyx_v_x, __pyx_v_c, __pyx_v_eps); - __pyx_t_3 = __pyx_v_inside; - if (__pyx_t_3) { + if (__pyx_v_inside) { __pyx_r = __pyx_v_isimplex; @@ -3690,7 +3676,6 @@ int __pyx_v_inside; int __pyx_v_isimplex; double *__pyx_v_transform; - double __pyx_v_v; int __pyx_r; int __pyx_t_1; int __pyx_t_2; @@ -3761,41 +3746,27 @@ __pyx_L9:; - __pyx_v_v = (__pyx_v_d->transform[((__pyx_v_m * __pyx_v_ndim) * (__pyx_v_ndim + 1))]); + __pyx_v_isimplex = __pyx_v_m; - __pyx_t_3 = (__pyx_v_v != __pyx_v_v); - if (__pyx_t_3) { + __pyx_v_inside = -1; - - goto __pyx_L6_continue; - goto __pyx_L10; - } - { - - - __pyx_v_isimplex = __pyx_v_m; - - - __pyx_v_inside = -1; - - - goto __pyx_L7_break; - } - __pyx_L10:; + + goto __pyx_L7_break; goto __pyx_L8; } - __pyx_t_3 = ((__pyx_v_c[__pyx_v_k]) > (1 + __pyx_v_eps)); + __pyx_t_3 = ((__pyx_v_c[__pyx_v_k]) <= (1.0 + __pyx_v_eps)); if (__pyx_t_3) { + goto __pyx_L8; + } + { __pyx_v_inside = 0; - goto __pyx_L8; } __pyx_L8:; - __pyx_L6_continue:; } __pyx_L7_break:; @@ -3911,11 +3882,10 @@ while (1) { - __pyx_t_1 = __pyx_v_changed; - if (!__pyx_t_1) break; + if (!__pyx_v_changed) break; - __pyx_t_4 = (__pyx_v_best_dist > 0); + __pyx_t_4 = (__pyx_v_best_dist > 0.0); if (__pyx_t_4) { @@ -3949,7 +3919,7 @@ __pyx_v_dist = __pyx_f_5scipy_7spatial_5qhull__distplane(__pyx_v_d, __pyx_v_ineigh, __pyx_v_z); - __pyx_t_4 = (__pyx_v_dist > __pyx_v_best_dist); + __pyx_t_4 = (__pyx_v_dist > (__pyx_v_best_dist + (__pyx_v_eps * (1.0 + fabs(__pyx_v_best_dist))))); if (__pyx_t_4) { @@ -4021,11 +3991,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_points = values[1]; @@ -4037,9 +4007,10 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.__init__"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_points); @@ -4050,34 +4021,34 @@ __pyx_v_paraboloid_shift = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4086,14 +4057,14 @@ __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_points); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_points); __Pyx_GIVEREF(__pyx_v_points); - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4123,20 +4094,20 @@ __pyx_v_paraboloid_shift = __pyx_t_6; __pyx_t_6 = 0; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_EndUnpack(__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_EndUnpack(__pyx_t_7, 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_vertices); __pyx_v_vertices = __pyx_t_3; @@ -4156,87 +4127,87 @@ } - __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__ndim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_points, __pyx_n_s__shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__npoints, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_vertices, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__nsimplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__points, __pyx_v_points) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__vertices, __pyx_v_vertices) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__neighbors, __pyx_v_neighbors) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__equations, __pyx_v_equations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_scale, __pyx_v_paraboloid_scale) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__paraboloid_shift, __pyx_v_paraboloid_shift) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__min_bound, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__max); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__axis), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__max_bound, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -4276,25 +4247,24 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("transform"); __pyx_self = __pyx_self; - __Pyx_INCREF(__pyx_v_self); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -4302,13 +4272,13 @@ __Pyx_GIVEREF(__pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___transform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5; } @@ -4316,7 +4286,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -4332,7 +4302,6 @@ __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.transform"); __pyx_r = NULL; __pyx_L0:; - __Pyx_DECREF(__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4382,75 +4351,74 @@ int __pyx_t_20; __Pyx_RefNannySetupContext("vertex_to_simplex"); __pyx_self = __pyx_self; - __Pyx_INCREF(__pyx_v_self); __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; __pyx_bstruct_arr.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__npoints); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__intc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__intc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__fill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4467,7 +4435,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_arr)); @@ -4475,9 +4443,9 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4494,7 +4462,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -4502,16 +4470,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nsimplex = __pyx_t_8; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_8; @@ -4539,7 +4507,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_vertices)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_ivertex = (*__Pyx_BufPtrStrided2d(npy_int *, __pyx_bstruct_vertices.buf, __pyx_t_16, __pyx_bstride_0_vertices, __pyx_t_17, __pyx_bstride_1_vertices)); @@ -4552,7 +4520,7 @@ } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_arr)) __pyx_t_19 = 0; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_19); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_18, __pyx_bstride_0_arr)) == -1); if (__pyx_t_2) { @@ -4566,7 +4534,7 @@ } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_arr)) __pyx_t_20 = 0; if (unlikely(__pyx_t_20 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_20); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_arr.buf, __pyx_t_19, __pyx_bstride_0_arr) = __pyx_v_isimplex; goto __pyx_L10; @@ -4580,7 +4548,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -4608,7 +4576,6 @@ __pyx_L2:; __Pyx_DECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4677,7 +4644,6 @@ long __pyx_t_28; __Pyx_RefNannySetupContext("convex_hull"); __pyx_self = __pyx_self; - __Pyx_INCREF(__pyx_v_self); __pyx_v_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_neighbors = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -4687,9 +4653,9 @@ __pyx_bstruct_vertices.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4706,7 +4672,7 @@ } __pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_neighbors)); @@ -4714,9 +4680,9 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4733,7 +4699,7 @@ } __pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertices)); @@ -4741,16 +4707,16 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndim = __pyx_t_3; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nsimplex = __pyx_t_3; @@ -4758,16 +4724,16 @@ __pyx_v_msize = 10; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -4775,21 +4741,21 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_1 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_8, __pyx_t_9, ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -4799,7 +4765,7 @@ __pyx_t_11 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4816,7 +4782,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); @@ -4909,7 +4875,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(Py_None); @@ -4920,13 +4886,13 @@ __pyx_v_msize = ((2 * __pyx_v_msize) + 1); - __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_msize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -4934,14 +4900,14 @@ __Pyx_GIVEREF(__pyx_t_9); __pyx_t_10 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4958,7 +4924,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); @@ -4990,7 +4956,7 @@ } __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1]; __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1]; - if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(Py_None); @@ -4998,13 +4964,13 @@ __pyx_v_arr = ((PyArrayObject *)Py_None); - __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__resize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromLong(__pyx_v_ndim); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); @@ -5012,7 +4978,7 @@ __Pyx_GIVEREF(__pyx_t_11); __pyx_t_8 = 0; __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -5050,7 +5016,6 @@ __Pyx_DECREF((PyObject *)__pyx_v_neighbors); __Pyx_DECREF((PyObject *)__pyx_v_vertices); __Pyx_DECREF(__pyx_v_out); - __Pyx_DECREF(__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5124,16 +5089,16 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bruteforce); - if (unlikely(value)) { values[2] = value; kw_args--; } + if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "find_simplex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -5152,14 +5117,13 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("find_simplex", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.find_simplex"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_xi); - __Pyx_INCREF(__pyx_v_bruteforce); __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_out_ = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_xi_shape = Py_None; __Pyx_INCREF(Py_None); @@ -5168,17 +5132,17 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asanyarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5187,72 +5151,72 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_3; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_2, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5260,7 +5224,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -5269,37 +5233,37 @@ __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5316,7 +5280,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -5327,66 +5291,66 @@ __pyx_v_start = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__finfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__eps); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_eps = __pyx_t_11; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__intc); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5396,7 +5360,7 @@ __pyx_t_12 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5413,7 +5377,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5424,7 +5388,7 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 1, 0); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_bruteforce); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { @@ -5444,7 +5408,7 @@ } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_out_)) __pyx_t_16 = 0; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_16); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_out_.buf, __pyx_t_15, __pyx_bstride_0_out_) = __pyx_v_isimplex; } @@ -5469,7 +5433,7 @@ } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_out_)) __pyx_t_17 = 0; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_17); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(npy_int *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_) = __pyx_v_isimplex; } @@ -5481,16 +5445,16 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5522,9 +5486,7 @@ __Pyx_DECREF((PyObject *)__pyx_v_out_); __Pyx_DECREF(__pyx_v_xi_shape); __Pyx_DECREF(__pyx_v_out); - __Pyx_DECREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_xi); - __Pyx_DECREF(__pyx_v_bruteforce); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5596,11 +5558,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "plane_distance") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_xi = values[1]; @@ -5612,12 +5574,12 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("plane_distance", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.plane_distance"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_self); __Pyx_INCREF(__pyx_v_xi); __pyx_v_x = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_out_ = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -5627,72 +5589,72 @@ __pyx_bstruct_out_.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_12)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_xi_shape); __pyx_v_xi_shape = __pyx_t_1; __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__prod); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySequence_GetSlice(__pyx_t_3, 0, -1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5700,7 +5662,7 @@ __Pyx_GIVEREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5709,37 +5671,37 @@ __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_xi, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5756,7 +5718,7 @@ } __pyx_bstride_0_x = __pyx_bstruct_x.strides[0]; __pyx_bstride_1_x = __pyx_bstruct_x.strides[1]; __pyx_bshape_0_x = __pyx_bstruct_x.shape[0]; __pyx_bshape_1_x = __pyx_bstruct_x.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_x)); @@ -5767,16 +5729,16 @@ __pyx_v_info = __pyx_f_5scipy_7spatial_5qhull__get_delaunay_info(__pyx_v_self, 0, 0); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_info->nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5784,21 +5746,21 @@ __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__double); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5808,7 +5770,7 @@ __pyx_t_11 = 0; - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_v_out); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5825,7 +5787,7 @@ } __pyx_bstride_0_out_ = __pyx_bstruct_out_.strides[0]; __pyx_bstride_1_out_ = __pyx_bstruct_out_.strides[1]; __pyx_bshape_0_out_ = __pyx_bstruct_out_.shape[0]; __pyx_bshape_1_out_ = __pyx_bstruct_out_.shape[1]; - if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_12 = 0; __Pyx_INCREF(__pyx_v_out); @@ -5859,7 +5821,7 @@ } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_out_)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_18); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_double_t *, __pyx_bstruct_out_.buf, __pyx_t_16, __pyx_bstride_0_out_, __pyx_t_17, __pyx_bstride_1_out_) = __pyx_f_5scipy_7spatial_5qhull__distplane(__pyx_v_info, __pyx_v_j, __pyx_v_z); } @@ -5870,27 +5832,27 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_GetAttr(__pyx_v_out, __pyx_n_s__reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_xi_shape, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nsimplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5922,7 +5884,6 @@ __Pyx_DECREF((PyObject *)__pyx_v_out_); __Pyx_DECREF(__pyx_v_xi_shape); __Pyx_DECREF(__pyx_v_out); - __Pyx_DECREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_xi); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); @@ -5965,11 +5926,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lift_points") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_x = values[1]; @@ -5981,56 +5942,57 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("lift_points", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.Delaunay.lift_points"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_v_z = Py_None; __Pyx_INCREF(Py_None); - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_t_1, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6040,9 +6002,9 @@ __pyx_t_5 = 0; - __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -6050,23 +6012,23 @@ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_v_x) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Power(__pyx_v_x, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -6074,14 +6036,14 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_1, 0, Py_Ellipsis); @@ -6089,20 +6051,20 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_1, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_2, 0, Py_Ellipsis); @@ -6110,13 +6072,13 @@ __Pyx_INCREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); - __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetItem(__pyx_v_z, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetItem(__pyx_v_z, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6175,11 +6137,11 @@ values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xi); if (likely(values[1])) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tsearch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_tri = values[0]; __pyx_v_xi = values[1]; @@ -6191,22 +6153,23 @@ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("tsearch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("scipy.spatial.qhull.tsearch"); + __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_tri, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_xi); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xi); __Pyx_GIVEREF(__pyx_v_xi); - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6285,14 +6248,13 @@ PyArrayObject *__pyx_t_6 = NULL; PyArrayObject *__pyx_t_7 = NULL; double __pyx_t_8; - int __pyx_t_9; - PyArrayObject *__pyx_t_10 = NULL; + PyArrayObject *__pyx_t_9 = NULL; + int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyArrayObject *__pyx_t_14 = NULL; __Pyx_RefNannySetupContext("_get_delaunay_info"); - __Pyx_INCREF(__pyx_v_obj); __pyx_v_transform = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_vertex_to_simplex = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_transform.buf = NULL; @@ -6305,15 +6267,15 @@ __pyx_bstruct_max_bound.buf = NULL; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__points); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_points, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_points = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_points.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_points = __pyx_bstruct_points.strides[0]; __pyx_bstride_1_points = __pyx_bstruct_points.strides[1]; __pyx_bshape_0_points = __pyx_bstruct_points.shape[0]; __pyx_bshape_1_points = __pyx_bstruct_points.shape[1]; } @@ -6323,15 +6285,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertices, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_vertices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_vertices.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_vertices = __pyx_bstruct_vertices.strides[0]; __pyx_bstride_1_vertices = __pyx_bstruct_vertices.strides[1]; __pyx_bshape_0_vertices = __pyx_bstruct_vertices.shape[0]; __pyx_bshape_1_vertices = __pyx_bstruct_vertices.shape[1]; } @@ -6341,15 +6303,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__neighbors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_neighbors, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_neighbors = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_neighbors.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_neighbors = __pyx_bstruct_neighbors.strides[0]; __pyx_bstride_1_neighbors = __pyx_bstruct_neighbors.strides[1]; __pyx_bshape_0_neighbors = __pyx_bstruct_neighbors.shape[0]; __pyx_bshape_1_neighbors = __pyx_bstruct_neighbors.shape[1]; } @@ -6359,15 +6321,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__equations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_equations, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_equations = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_equations.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_equations = __pyx_bstruct_equations.strides[0]; __pyx_bstride_1_equations = __pyx_bstruct_equations.strides[1]; __pyx_bshape_0_equations = __pyx_bstruct_equations.shape[0]; __pyx_bshape_1_equations = __pyx_bstruct_equations.shape[1]; } @@ -6377,15 +6339,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__min_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_min_bound, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_min_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_min_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_min_bound = __pyx_bstruct_min_bound.strides[0]; __pyx_bshape_0_min_bound = __pyx_bstruct_min_bound.shape[0]; } @@ -6395,15 +6357,15 @@ __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__max_bound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_max_bound, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_max_bound = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_max_bound.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_max_bound = __pyx_bstruct_max_bound.strides[0]; __pyx_bshape_0_max_bound = __pyx_bstruct_max_bound.shape[0]; } @@ -6437,33 +6399,32 @@ __pyx_v_info->equations = ((double *)__pyx_v_equations->data); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_scale = __pyx_t_8; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__paraboloid_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_info->paraboloid_shift = __pyx_t_8; - __pyx_t_9 = __pyx_v_compute_transform; - if (__pyx_t_9) { + if (__pyx_v_compute_transform) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = ((PyArrayObject *)__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_transform); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_transform, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_transform, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_transform, (PyObject*)__pyx_v_transform, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); @@ -6474,9 +6435,9 @@ } __pyx_bstride_0_transform = __pyx_bstruct_transform.strides[0]; __pyx_bstride_1_transform = __pyx_bstruct_transform.strides[1]; __pyx_bstride_2_transform = __pyx_bstruct_transform.strides[2]; __pyx_bshape_0_transform = __pyx_bstruct_transform.shape[0]; __pyx_bshape_1_transform = __pyx_bstruct_transform.shape[1]; __pyx_bshape_2_transform = __pyx_bstruct_transform.shape[2]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_10 = 0; + __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_transform)); __pyx_v_transform = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -6493,19 +6454,18 @@ __pyx_L3:; - __pyx_t_9 = __pyx_v_compute_vertex_to_simplex; - if (__pyx_t_9) { + if (__pyx_v_compute_vertex_to_simplex) { - __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vertex_to_simplex); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { + __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); + if (unlikely(__pyx_t_10 < 0)) { PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vertex_to_simplex, (PyObject*)__pyx_v_vertex_to_simplex, &__Pyx_TypeInfo_nn_npy_int, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); @@ -6516,7 +6476,7 @@ } __pyx_bstride_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.strides[0]; __pyx_bshape_0_vertex_to_simplex = __pyx_bstruct_vertex_to_simplex.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_vertex_to_simplex)); @@ -6580,15 +6540,14 @@ __Pyx_XDECREF((PyObject *)__pyx_v_equations); __Pyx_XDECREF((PyObject *)__pyx_v_min_bound); __Pyx_XDECREF((PyObject *)__pyx_v_max_bound); - __Pyx_DECREF(__pyx_v_obj); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); +static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_copy_shape; int __pyx_v_i; int __pyx_v_ndim; @@ -6613,7 +6572,6 @@ if (__pyx_v_info == NULL) return 0; __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_v_endian_detector = 1; @@ -6652,17 +6610,17 @@ if (__pyx_t_3) { - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_13)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_13)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_13)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; @@ -6680,17 +6638,17 @@ if (__pyx_t_2) { - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_14)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_14)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_14)); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; @@ -6702,8 +6660,7 @@ __pyx_v_info->ndim = __pyx_v_ndim; - __pyx_t_6 = __pyx_v_copy_shape; - if (__pyx_t_6) { + if (__pyx_v_copy_shape) { __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2))); @@ -6813,17 +6770,17 @@ if (__pyx_t_1) { - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_u_15)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_15)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_15)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; @@ -6949,22 +6906,22 @@ { - __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L14:; @@ -6988,7 +6945,7 @@ __pyx_v_offset = 0; - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; @@ -7013,18 +6970,16 @@ } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); -static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); +static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__"); - __Pyx_INCREF((PyObject *)__pyx_v_self); __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self)); @@ -7046,7 +7001,6 @@ } __pyx_L6:; - __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_RefNannyFinishContext(); } @@ -7059,7 +7013,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7086,7 +7040,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7113,7 +7067,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7140,7 +7094,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7167,7 +7121,7 @@ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -7207,7 +7161,6 @@ int __pyx_t_9; char *__pyx_t_10; __Pyx_RefNannySetupContext("_util_dtypestring"); - __Pyx_INCREF((PyObject *)__pyx_v_descr); __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None); @@ -7224,7 +7177,7 @@ if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) { __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2); } else { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; @@ -7234,9 +7187,9 @@ __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_fields)); __pyx_v_fields = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -7245,7 +7198,7 @@ if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) { PyObject* tuple = ((PyObject *)__pyx_v_fields); __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((PyArray_Descr *)__pyx_t_3); @@ -7255,40 +7208,40 @@ __pyx_t_4 = 0; } else { __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2); - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_kp_u_17)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_17)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_17)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; @@ -7317,29 +7270,29 @@ if (__pyx_t_6) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_15)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_15)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_15)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; while (1) { - __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) break; @@ -7361,7 +7314,7 @@ if (__pyx_t_6) { - __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; @@ -7372,28 +7325,28 @@ if (__pyx_t_6) { - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_kp_u_18)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_18)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_18)); - __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 98; @@ -7401,12 +7354,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 66; @@ -7414,12 +7367,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 104; @@ -7427,12 +7380,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 72; @@ -7440,12 +7393,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 105; @@ -7453,12 +7406,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 73; @@ -7466,12 +7419,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 108; @@ -7479,12 +7432,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 76; @@ -7492,12 +7445,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 113; @@ -7505,12 +7458,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 81; @@ -7518,12 +7471,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 102; @@ -7531,12 +7484,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 100; @@ -7544,12 +7497,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 103; @@ -7557,12 +7510,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7572,12 +7525,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7587,12 +7540,12 @@ } - __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 90; @@ -7602,12 +7555,12 @@ } - __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { (__pyx_v_f[0]) = 79; @@ -7616,19 +7569,19 @@ { - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_16), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; @@ -7639,7 +7592,7 @@ { - __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_10; } __pyx_L9:; @@ -7665,7 +7618,6 @@ __Pyx_DECREF(__pyx_v_childname); __Pyx_DECREF(__pyx_v_new_offset); __Pyx_DECREF(__pyx_v_t); - __Pyx_DECREF((PyObject *)__pyx_v_descr); __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7676,8 +7628,6 @@ PyObject *__pyx_v_baseptr; int __pyx_t_1; __Pyx_RefNannySetupContext("set_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); - __Pyx_INCREF(__pyx_v_base); __pyx_t_1 = (__pyx_v_base == Py_None); @@ -7703,8 +7653,6 @@ __pyx_v_arr->base = __pyx_v_baseptr; - __Pyx_DECREF((PyObject *)__pyx_v_arr); - __Pyx_DECREF(__pyx_v_base); __Pyx_RefNannyFinishContext(); } @@ -7714,7 +7662,6 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base"); - __Pyx_INCREF((PyObject *)__pyx_v_arr); __pyx_t_1 = (__pyx_v_arr->base == NULL); @@ -7739,7 +7686,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -7778,9 +7724,8 @@ return 0; } -static struct PyMethodDef __pyx_methods_5scipy_7spatial_5qhull_RidgeIter2D[] = { +static PyMethodDef __pyx_methods_5scipy_7spatial_5qhull_RidgeIter2D[] = { {__Pyx_NAMESTR("__del__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___del__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull_11RidgeIter2D___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -7809,7 +7754,7 @@ 0, #endif 0, - #if PY_MAJOR_VERSION >= 3 + #if PY_MAJOR_VERSION < 3 0, #else 0, @@ -7838,7 +7783,7 @@ 0, 0, 0, - #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX) + #if PY_VERSION_HEX >= 0x02050000 0, #endif }; @@ -7892,8 +7837,12 @@ 0, 0, 0, + #if PY_MAJOR_VERSION < 3 0, + #else 0, + #endif + 0, &__pyx_tp_as_number_RidgeIter2D, &__pyx_tp_as_sequence_RidgeIter2D, &__pyx_tp_as_mapping_RidgeIter2D, @@ -7935,7 +7884,7 @@ #endif }; -static struct PyMethodDef __pyx_methods[] = { +static PyMethodDef __pyx_methods[] = { {__Pyx_NAMESTR("_construct_delaunay"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull__construct_delaunay, METH_O, __Pyx_DOCSTR(__pyx_doc_5scipy_7spatial_5qhull__construct_delaunay)}, {__Pyx_NAMESTR("_qhull_get_facet_array"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull__qhull_get_facet_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5scipy_7spatial_5qhull__qhull_get_facet_array)}, {__Pyx_NAMESTR("_get_barycentric_transforms"), (PyCFunction)__pyx_pf_5scipy_7spatial_5qhull__get_barycentric_transforms, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5scipy_7spatial_5qhull__get_barycentric_transforms)}, @@ -7943,8 +7892,6 @@ {0, 0, 0, 0} }; -static void __pyx_init_filenames(void); - #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, @@ -7970,7 +7917,17 @@ {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, + {&__pyx_kp_u_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 1, 0, 0}, + {&__pyx_kp_u_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 1, 0, 0}, + {&__pyx_kp_u_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 1, 0, 0}, + {&__pyx_kp_u_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 1, 0, 0}, + {&__pyx_kp_u_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 1, 0, 0}, + {&__pyx_kp_u_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 1, 0, 0}, + {&__pyx_kp_u_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 1, 0, 0}, + {&__pyx_kp_u_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0, 0}, + {&__pyx_kp_u_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_kp_u_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 1, 0, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_n_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 1}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, @@ -7987,6 +7944,7 @@ {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1}, {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, + {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s___construct_delaunay, __pyx_k___construct_delaunay, sizeof(__pyx_k___construct_delaunay), 0, 0, 1, 1}, {&__pyx_n_s___qhull_lock, __pyx_k___qhull_lock, sizeof(__pyx_k___qhull_lock), 0, 0, 1, 1}, {&__pyx_n_s___transform, __pyx_k___transform, sizeof(__pyx_k___transform), 0, 0, 1, 1}, @@ -8086,17 +8044,17 @@ {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetName(__pyx_b, __pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -8138,12 +8096,10 @@ } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_qhull(void)", __LINE__, __FILE__); #endif - __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 - __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #ifdef __pyx_binding_PyCFunctionType_USED + if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif @@ -8187,15 +8143,15 @@ if (__Pyx_ExportFunction("_RidgeIter2D_init", (void (*)(void))__pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_init, "void (__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *, __pyx_t_5scipy_7spatial_5qhull_DelaunayInfo_t *, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_ExportFunction("_RidgeIter2D_next", (void (*)(void))__pyx_f_5scipy_7spatial_5qhull__RidgeIter2D_next, "void (__pyx_t_5scipy_7spatial_5qhull_RidgeIter2D_t *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyType_Ready(&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "RidgeIter2D", (PyObject *)&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "RidgeIter2D", (PyObject *)&__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5scipy_7spatial_5qhull_RidgeIter2D = &__pyx_type_5scipy_7spatial_5qhull_RidgeIter2D; - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8224,144 +8180,238 @@ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__threading); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__threading); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__Lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___qhull_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s___qhull_lock, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); - if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Delaunay, "scipy.spatial.qhull"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_CreateClass(__pyx_t_2, ((PyObject *)__pyx_t_1), __pyx_n_s__Delaunay, "scipy.spatial.qhull"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay___init__, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay___init__, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_transform, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__transform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__transform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_vertex_to_simplex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__vertex_to_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_convex_hull, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_t_3, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__convex_hull, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_k_10 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_find_simplex, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__find_simplex, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_plane_distance, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyMethod_New(__pyx_t_4, 0, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__plane_distance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_New(&__pyx_mdef_5scipy_7spatial_5qhull_8Delaunay_lift_points, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyMethod_New(__pyx_t_2, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s__lift_points, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Delaunay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Delaunay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s___construct_delaunay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_21), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_22), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_23), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__transform); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_24), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__vertex_to_simplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_25), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__convex_hull); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_26), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__find_simplex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_27), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__plane_distance); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_28), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Delaunay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__lift_points); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_29), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__tsearch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_30), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + + goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); @@ -8383,15 +8433,34 @@ #endif } -static const char *__pyx_filenames[] = { - "qhull.pyx", - "numpy.pxd", -}; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, + const char *name, int exact) +{ + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (none_allowed && obj == Py_None) return 1; + else if (exact) { + if (Py_TYPE(obj) == type) return 1; + } + else { + if (PyObject_TypeCheck(obj, type)) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; } static CYTHON_INLINE int __Pyx_IsLittleEndian(void) { @@ -8799,7 +8868,7 @@ buf->suboffsets = __Pyx_minusones; } -static int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { +static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) { if (obj == Py_None) { __Pyx_ZeroBuffer(buf); return 0; @@ -8866,8 +8935,13 @@ (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "too many values to unpack (expected %d)", (int)expected); + #else + "too many values to unpack (expected %zd)", expected); + #endif } static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { @@ -8880,11 +8954,11 @@ return item; } -static int __Pyx_EndUnpack(PyObject *iter) { +static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(expected); return -1; } else if (!PyErr_Occurred()) @@ -9058,30 +9132,10 @@ } else if (PyTuple_GET_SIZE(t) < index) { __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(); + __Pyx_RaiseTooManyValuesError(index); } } -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { #if PY_VERSION_HEX >= 0x02060000 @@ -9107,14 +9161,14 @@ #endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *__import__ = 0; + PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - __import__ = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!__import__) + py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); + if (!py_import) goto bad; if (from_list) list = from_list; @@ -9130,23 +9184,15 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(__import__, + module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); - Py_XDECREF(__import__); + Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} - static PyObject *__Pyx_CreateClass( PyObject *bases, PyObject *dict, PyObject *name, const char *modname) { @@ -9282,24 +9328,56 @@ } #endif -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) { - const npy_intp neg_one = (npy_intp)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(npy_intp) < sizeof(long)) { +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_flagT(flagT val) { + const flagT neg_one = (flagT)-1, const_zero = (flagT)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(flagT) == sizeof(char)) || + (sizeof(flagT) == sizeof(short))) { return PyInt_FromLong((long)val); - } else if (sizeof(npy_intp) == sizeof(long)) { + } else if ((sizeof(flagT) == sizeof(int)) || + (sizeof(flagT) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); - } else { + } else if (sizeof(flagT) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(flagT), + little, !is_unsigned); } } +static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t val) { + const Py_intptr_t neg_one = (Py_intptr_t)-1, const_zero = (Py_intptr_t)0; + const int is_unsigned = const_zero < neg_one; + if ((sizeof(Py_intptr_t) == sizeof(char)) || + (sizeof(Py_intptr_t) == sizeof(short))) { + return PyInt_FromLong((long)val); + } else if ((sizeof(Py_intptr_t) == sizeof(int)) || + (sizeof(Py_intptr_t) == sizeof(long))) { + if (is_unsigned) + return PyLong_FromUnsignedLong((unsigned long)val); + else + return PyInt_FromLong((long)val); + } else if (sizeof(Py_intptr_t) == sizeof(PY_LONG_LONG)) { + if (is_unsigned) + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); + else + return PyLong_FromLongLong((PY_LONG_LONG)val); + } else { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), + little, !is_unsigned); + } +} + #if CYTHON_CCOMPLEX #ifdef __cplusplus static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { @@ -9605,6 +9683,25 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } +static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (sizeof(int) < sizeof(long)) { + long val = __Pyx_PyInt_AsLong(x); + if (unlikely(val != (long)(int)val)) { + if (!unlikely(val == -1 && PyErr_Occurred())) { + PyErr_SetString(PyExc_OverflowError, + (is_unsigned && unlikely(val < 0)) ? + "can't convert negative value to int" : + "value too large to convert to int"); + } + return (int)-1; + } + return (int)val; + } + return (int)__Pyx_PyInt_AsLong(x); +} + static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -9852,10 +9949,10 @@ goto bad; } tmp.fp = f; -#if PY_VERSION_HEX < 0x03010000 +#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) + cobj = PyCapsule_New(tmp.p, sig, 0); +#else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); -#else - cobj = PyCapsule_New(tmp.p, sig, 0); #endif if (!cobj) goto bad; @@ -9907,7 +10004,11 @@ PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); + #if PY_VERSION_HEX < 0x02050000 + PyErr_Warn(NULL, warning); + #else PyErr_WarnEx(NULL, warning, 0); + #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, @@ -10048,8 +10149,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } From scipy-svn at scipy.org Wed Sep 22 18:59:34 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Wed, 22 Sep 2010 17:59:34 -0500 (CDT) Subject: [Scipy-svn] r6816 - trunk/scipy/stats/tests Message-ID: <20100922225934.A8C8439CD30@scipy.org> Author: warren.weckesser Date: 2010-09-22 17:59:34 -0500 (Wed, 22 Sep 2010) New Revision: 6816 Modified: trunk/scipy/stats/tests/test_stats.py Log: TST: stats: add a test for the tie-handling of spearmanr (and tweak some code for readability) Modified: trunk/scipy/stats/tests/test_stats.py =================================================================== --- trunk/scipy/stats/tests/test_stats.py 2010-09-22 09:00:53 UTC (rev 6815) +++ trunk/scipy/stats/tests/test_stats.py 2010-09-22 22:59:34 UTC (rev 6816) @@ -254,7 +254,7 @@ m = stats.nanmedian(self.Xall) assert_(np.isnan(m)) -class TestCorr(TestCase): +class TestCorrPearsonr(TestCase): """ W.II.D. Compute a correlation matrix on all the variables. All the correlations, except for ZERO and MISS, shoud be exactly 1. @@ -266,171 +266,238 @@ y = stats.pearsonr(X,X) r = y[0] assert_approx_equal(r,1.0) + def test_pXBIG(self): y = stats.pearsonr(X,BIG) r = y[0] assert_approx_equal(r,1.0) + def test_pXLITTLE(self): y = stats.pearsonr(X,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_pXHUGE(self): y = stats.pearsonr(X,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_pXTINY(self): y = stats.pearsonr(X,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_pXROUND(self): y = stats.pearsonr(X,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_pBIGBIG(self): y = stats.pearsonr(BIG,BIG) r = y[0] assert_approx_equal(r,1.0) + def test_pBIGLITTLE(self): y = stats.pearsonr(BIG,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_pBIGHUGE(self): y = stats.pearsonr(BIG,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_pBIGTINY(self): y = stats.pearsonr(BIG,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_pBIGROUND(self): y = stats.pearsonr(BIG,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_pLITTLELITTLE(self): y = stats.pearsonr(LITTLE,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_pLITTLEHUGE(self): y = stats.pearsonr(LITTLE,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_pLITTLETINY(self): y = stats.pearsonr(LITTLE,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_pLITTLEROUND(self): y = stats.pearsonr(LITTLE,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_pHUGEHUGE(self): y = stats.pearsonr(HUGE,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_pHUGETINY(self): y = stats.pearsonr(HUGE,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_pHUGEROUND(self): y = stats.pearsonr(HUGE,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_pTINYTINY(self): y = stats.pearsonr(TINY,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_pTINYROUND(self): y = stats.pearsonr(TINY,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_pROUNDROUND(self): y = stats.pearsonr(ROUND,ROUND) r = y[0] assert_approx_equal(r,1.0) + + +class TestCorrSpearmanr(TestCase): + """ W.II.D. Compute a correlation matrix on all the variables. + + All the correlations, except for ZERO and MISS, shoud be exactly 1. + ZERO and MISS should have undefined or missing correlations with the + other variables. The same should go for SPEARMAN corelations, if + your program has them. + """ def test_sXX(self): y = stats.spearmanr(X,X) r = y[0] assert_approx_equal(r,1.0) + def test_sXBIG(self): y = stats.spearmanr(X,BIG) r = y[0] assert_approx_equal(r,1.0) + def test_sXLITTLE(self): y = stats.spearmanr(X,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_sXHUGE(self): y = stats.spearmanr(X,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_sXTINY(self): y = stats.spearmanr(X,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_sXROUND(self): y = stats.spearmanr(X,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_sBIGBIG(self): y = stats.spearmanr(BIG,BIG) r = y[0] assert_approx_equal(r,1.0) + def test_sBIGLITTLE(self): y = stats.spearmanr(BIG,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_sBIGHUGE(self): y = stats.spearmanr(BIG,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_sBIGTINY(self): y = stats.spearmanr(BIG,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_sBIGROUND(self): y = stats.spearmanr(BIG,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_sLITTLELITTLE(self): y = stats.spearmanr(LITTLE,LITTLE) r = y[0] assert_approx_equal(r,1.0) + def test_sLITTLEHUGE(self): y = stats.spearmanr(LITTLE,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_sLITTLETINY(self): y = stats.spearmanr(LITTLE,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_sLITTLEROUND(self): y = stats.spearmanr(LITTLE,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_sHUGEHUGE(self): y = stats.spearmanr(HUGE,HUGE) r = y[0] assert_approx_equal(r,1.0) + def test_sHUGETINY(self): y = stats.spearmanr(HUGE,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_sHUGEROUND(self): y = stats.spearmanr(HUGE,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_sTINYTINY(self): y = stats.spearmanr(TINY,TINY) r = y[0] assert_approx_equal(r,1.0) + def test_sTINYROUND(self): y = stats.spearmanr(TINY,ROUND) r = y[0] assert_approx_equal(r,1.0) + def test_sROUNDROUND(self): y = stats.spearmanr(ROUND,ROUND) r = y[0] assert_approx_equal(r,1.0) +class TestCorrSpearmanrTies(TestCase): + """Some tests of tie-handling by the spearmanr function.""" + + def test_tie1(self): + # Data + x = [1.0, 2.0, 3.0, 4.0] + y = [1.0, 2.0, 2.0, 3.0] + # Ranks of the data, with tie-handling. + xr = [1.0, 2.0, 3.0, 4.0] + yr = [1.0, 2.5, 2.5, 4.0] + # Result of spearmanr should be the same as applying + # pearsonr to the ranks. + sr = stats.spearmanr(x, y) + pr = stats.pearsonr(xr, yr) + assert_almost_equal(sr, pr) + + ## W.II.E. Tabulate X against X, using BIG as a case weight. The values ## should appear on the diagonal and the total should be 899999955. ## If the table cannot hold these values, forget about working with From scipy-svn at scipy.org Thu Sep 23 05:17:08 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 23 Sep 2010 04:17:08 -0500 (CDT) Subject: [Scipy-svn] r6817 - trunk/scipy/signal Message-ID: <20100923091708.180FC39CD30@scipy.org> Author: rgommers Date: 2010-09-23 04:17:07 -0500 (Thu, 23 Sep 2010) New Revision: 6817 Modified: trunk/scipy/signal/filter_design.py trunk/scipy/signal/ltisys.py Log: DOC: make ltisys and filter_design docs conform to current documentation standard. Modified: trunk/scipy/signal/filter_design.py =================================================================== --- trunk/scipy/signal/filter_design.py 2010-09-22 22:59:34 UTC (rev 6816) +++ trunk/scipy/signal/filter_design.py 2010-09-23 09:17:07 UTC (rev 6817) @@ -33,7 +33,7 @@ w = logspace(lfreq, hfreq, N) return w -def freqs(b,a,worN=None,plot=None): +def freqs(b, a, worN=None, plot=None): """Compute frequency response of analog filter. Given the numerator (b) and denominator (a) of a filter compute its @@ -46,9 +46,9 @@ Parameters ---------- b : ndarray - numerator of a linear filter + Numerator of a linear filter. a : ndarray - numerator of a linear filter + Denominator of a linear filter. worN : {None, int}, optional If None, then compute at 200 frequencies around the interesting parts of the response curve (determined by pole-zero locations). If a single @@ -163,7 +163,7 @@ plot(w, h) return w, h -def tf2zpk(b,a): +def tf2zpk(b, a): """Return zero, pole, gain (z,p,k) representation from a numerator, denominator representation of a linear filter. @@ -177,11 +177,11 @@ Returns ------- z : ndarray - zeros of the transfer function. + Zeros of the transfer function. p : ndarray - poles of the transfer function. + Poles of the transfer function. k : float - system gain. + System gain. If some values of b are too close to 0, they are removed. In that case, a BadCoefficients warning is emitted. @@ -195,25 +195,25 @@ p = roots(a) return z, p, k -def zpk2tf(z,p,k): +def zpk2tf(z, p, k): """Return polynomial transfer function representation from zeros and poles Parameters ---------- z : ndarray - zeros of the transfer function. + Zeros of the transfer function. p : ndarray - poles of the transfer function. + Poles of the transfer function. k : float - system gain. + System gain. Returns ------- b : ndarray - numerator polynomial. + Numerator polynomial. a : ndarray - numerator and denominator polynomials. + Numerator and denominator polynomials. Note ---- @@ -234,7 +234,7 @@ a = poly(p) return b, a -def normalize(b,a): +def normalize(b, a): """Normalize polynomial representation of a transfer function. If values of b are too close to 0, they are removed. In that case, a @@ -261,8 +261,8 @@ return outb, outa -def lp2lp(b,a,wo=1.0): - """Return a low-pass filter with cuttoff frequency wo +def lp2lp(b, a, wo=1.0): + """Return a low-pass filter with cutoff frequency `wo` from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) @@ -280,8 +280,8 @@ a = a * pwo[start1]/pwo[start1:] return normalize(b, a) -def lp2hp(b,a,wo=1.0): - """Return a high-pass filter with cuttoff frequency wo +def lp2hp(b, a, wo=1.0): + """Return a high-pass filter with cutoff frequency `wo` from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) @@ -308,8 +308,8 @@ return normalize(outb, outa) -def lp2bp(b,a,wo=1.0, bw=1.0): - """Return a band-pass filter with center frequency wo and bandwidth bw +def lp2bp(b, a, wo=1.0, bw=1.0): + """Return a band-pass filter with center frequency `wo` and bandwidth `bw` from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) @@ -339,8 +339,8 @@ return normalize(bprime, aprime) -def lp2bs(b,a,wo=1,bw=1): - """Return a band-stop filter with center frequency wo and bandwidth bw +def lp2bs(b, a, wo=1, bw=1): + """Return a band-stop filter with center frequency `wo` and bandwidth `bw` from a low-pass filter prototype with unity cutoff frequency. """ a,b = map(atleast_1d,(a,b)) @@ -370,10 +370,10 @@ return normalize(bprime, aprime) -def bilinear(b,a,fs=1.0): +def bilinear(b, a, fs=1.0): """Return a digital filter from an analog filter using the bilinear transform. - The bilinear transform substitutes (z-1) / (z+1) for s + The bilinear transform substitutes ``(z-1) / (z+1``) for ``s``. """ fs =float(fs) a,b = map(atleast_1d,(a,b)) @@ -413,28 +413,43 @@ Parameters ---------- - wp, ws -- Passband and stopband edge frequencies, normalized from 0 - to 1 (1 corresponds to pi radians / sample). For example: - Lowpass: wp = 0.2, ws = 0.3 - Highpass: wp = 0.3, ws = 0.2 - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] - gpass -- The maximum loss in the passband (dB). - gstop -- The minimum attenuation in the stopband (dB). - analog -- Non-zero to design an analog filter (in this case wp and - ws are in radians / second). - ftype -- The type of iir filter to design: - elliptic : 'ellip' - Butterworth : 'butter', - Chebyshev I : 'cheby1', - Chebyshev II: 'cheby2', - Bessel : 'bessel' - output -- Type of output: numerator/denominator ('ba') or pole-zero ('zpk') + wp, ws : float + Passband and stopband edge frequencies, normalized from 0 to 1 (1 + corresponds to pi radians / sample). For example: + - Lowpass: wp = 0.2, ws = 0.3 + - Highpass: wp = 0.3, ws = 0.2 + - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] + - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] + + gpass : float + The maximum loss in the passband (dB). + gstop : float + The minimum attenuation in the stopband (dB). + analog : int, optional + Non-zero to design an analog filter (in this case `wp` and `ws` are in + radians / second). + ftype : str, optional + The type of IIR filter to design: + + - elliptic : 'ellip' + - Butterworth : 'butter', + - Chebyshev I : 'cheby1', + - Chebyshev II: 'cheby2', + - Bessel : 'bessel' + + output : ['ba', 'zpk'], optional + Type of output: numerator/denominator ('ba') or pole-zero ('zpk'). + Default is 'ba'. + Returns ------- - b,a -- Numerator and denominator of the iir filter. - z,p,k -- Zeros, poles, and gain of the iir filter. + b, a : + Numerator and denominator of the IIR filter. Only returned if + ``output='ba'``. + z, p, k : Zeros, poles, and gain of the IIR filter. Only returned if + ``output='zpk'``. + """ try: @@ -465,18 +480,38 @@ Parameters ---------- - N -- the order of the filter. - Wn -- a scalar or length-2 sequence giving the critical frequencies. - rp, rs -- For chebyshev and elliptic filters provides the maximum ripple - in the passband and the minimum attenuation in the stop band. - btype -- the type of filter (lowpass, highpass, bandpass, or bandstop). - analog -- non-zero to return an analog filter, otherwise - a digital filter is returned. - ftype -- the type of IIR filter (Butterworth, Cauer (Elliptic), - Bessel, Chebyshev1, Chebyshev2) - output -- 'ba' for (b,a) output, 'zpk' for (z,p,k) output. + N : int + The order of the filter. + Wn : array_like + A scalar or length-2 sequence giving the critical frequencies. + rp : float, optional + For Chebyshev and elliptic filters provides the maximum ripple + in the passband. + rs : float, optional + For chebyshev and elliptic filters provides the minimum attenuation in + the stop band. + btype : str, optional + The type of filter (lowpass, highpass, bandpass, bandstop). + Default is bandpass. + analog : int, optional + Non-zero to return an analog filter, otherwise a digital filter is + returned. + ftype : str, optional + The type of IIR filter to design: - SEE ALSO butterord, cheb1ord, cheb2ord, ellipord + - elliptic : 'ellip' + - Butterworth : 'butter', + - Chebyshev I : 'cheby1', + - Chebyshev II: 'cheby2', + - Bessel : 'bessel' + + output : ['ba', 'zpk'], optional + Type of output: numerator/denominator ('ba') or pole-zero ('zpk'). + Default is 'ba'. + + See Also + -------- + butterord, cheb1ord, cheb2ord, ellipord """ ftype, btype, output = [x.lower() for x in (ftype, btype, output)] @@ -551,59 +586,57 @@ def butter(N, Wn, btype='low', analog=0, output='ba'): """Butterworth digital and analog filter design. - Description: + Design an Nth order lowpass digital or analog Butterworth filter and return + the filter coefficients in (B,A) or (Z,P,K) form. - Design an Nth order lowpass digital or analog Butterworth filter - and return the filter coefficients in (B,A) or (Z,P,K) form. - - See also buttord. + See also + -------- + buttord. """ return iirfilter(N, Wn, btype=btype, analog=analog, output=output, ftype='butter') def cheby1(N, rp, Wn, btype='low', analog=0, output='ba'): """Chebyshev type I digital and analog filter design. - Description: + Design an Nth order lowpass digital or analog Chebyshev type I filter and + return the filter coefficients in (B,A) or (Z,P,K) form. - Design an Nth order lowpass digital or analog Chebyshev type I filter - and return the filter coefficients in (B,A) or (Z,P,K) form. - - See also cheb1ord. + See also + -------- + cheb1ord. """ return iirfilter(N, Wn, rp=rp, btype=btype, analog=analog, output=output, ftype='cheby1') def cheby2(N, rs, Wn, btype='low', analog=0, output='ba'): """Chebyshev type I digital and analog filter design. - Description: + Design an Nth order lowpass digital or analog Chebyshev type I filter and + return the filter coefficients in (B,A) or (Z,P,K) form. - Design an Nth order lowpass digital or analog Chebyshev type I filter - and return the filter coefficients in (B,A) or (Z,P,K) form. - - See also cheb2ord. + See also + -------- + cheb2ord. """ return iirfilter(N, Wn, rs=rs, btype=btype, analog=analog, output=output, ftype='cheby2') def ellip(N, rp, rs, Wn, btype='low', analog=0, output='ba'): """Elliptic (Cauer) digital and analog filter design. - Description: + Design an Nth order lowpass digital or analog elliptic filter and return + the filter coefficients in (B,A) or (Z,P,K) form. - Design an Nth order lowpass digital or analog elliptic filter - and return the filter coefficients in (B,A) or (Z,P,K) form. - - See also ellipord. + See also + -------- + ellipord. """ return iirfilter(N, Wn, rs=rs, rp=rp, btype=btype, analog=analog, output=output, ftype='elliptic') def bessel(N, Wn, btype='low', analog=0, output='ba'): """Bessel digital and analog filter design. - Description: + Design an Nth order lowpass digital or analog Bessel filter and return the + filter coefficients in (B,A) or (Z,P,K) form. - Design an Nth order lowpass digital or analog Bessel filter - and return the filter coefficients in (B,A) or (Z,P,K) form. - """ return iirfilter(N, Wn, btype=btype, analog=analog, output=output, ftype='bessel') @@ -616,25 +649,31 @@ def band_stop_obj(wp, ind, passb, stopb, gpass, gstop, type): - """Band Stop Objective Function for order minimization + """Band Stop Objective Function for order minimization. - Description: + Returns the non-integer order for an analog band stop filter. - Returns the non-integer order for an analog band stop filter. - Parameters ---------- - wp -- passb edge - ind -- index specifying which passb edge to vary (0 or 1). - passb -- two element vector of fixed passband edges. - stopb -- two element vector of fixed stopband edges. - gstop -- amount in dB of attenuation in stopband. - gpass -- amount in dB of ripple in the passband. - type -- 'butter', 'cheby', or 'ellip': + wp : + Edge of passband `passb`. + ind : int + Index specifying which `passb` edge to vary (0 or 1). + passb : array_like + Two element sequence of fixed passband edges. + stopb : array_like + Two element sequence of fixed stopband edges. + gstop : float + Amount of attenuation in stopband in dB. + gpass : float + Amount of ripple in the passband in dB. + type : ['butter', 'cheby', 'ellip'] + Type of filter. Returns ------- - n -- filter order (possibly non-integer) + n : scalar + Filter order (possibly non-integer). """ passbC = passb.copy() @@ -666,27 +705,35 @@ """Butterworth filter order selection. Return the order of the lowest order digital Butterworth filter that loses - no more than gpass dB in the passband and has at least gstop dB attenuation - in the stopband. + no more than `gpass` dB in the passband and has at least `gstop` dB + attenuation in the stopband. Parameters ---------- - wp, ws -- Passband and stopband edge frequencies, normalized from 0 - to 1 (1 corresponds to pi radians / sample). For example: - Lowpass: wp = 0.2, ws = 0.3 - Highpass: wp = 0.3, ws = 0.2 - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] - gpass -- The maximum loss in the passband (dB). - gstop -- The minimum attenuation in the stopband (dB). - analog -- Non-zero to design an analog filter (in this case wp and - ws are in radians / second). + wp, ws : float + Passband and stopband edge frequencies, normalized from 0 to 1 (1 + corresponds to pi radians / sample). For example: + - Lowpass: wp = 0.2, ws = 0.3 + - Highpass: wp = 0.3, ws = 0.2 + - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] + - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] + + gpass : float + The maximum loss in the passband (dB). + gstop : float + The minimum attenuation in the stopband (dB). + analog : int, optional + Non-zero to design an analog filter (in this case `wp` and `ws` are in + radians / second). + Returns ------- - ord -- The lowest order for a Butterworth filter which meets specs. - Wn -- The Butterworth natural frequency (i.e. the "3dB frequency"). - Should be used with scipy.signal.butter to give filter results. + ord : int + The lowest order for a Butterworth filter which meets specs. + wn : ndarray or float + The Butterworth natural frequency (i.e. the "3dB frequency"). Should + be used with `butter` to give filter results. """ @@ -772,27 +819,35 @@ """Chebyshev type I filter order selection. Return the order of the lowest order digital Chebyshev Type I filter that - loses no more than gpass dB in the passband and has at least gstop dB + loses no more than `gpass` dB in the passband and has at least `gstop` dB attenuation in the stopband. Parameters ---------- - wp, ws -- Passband and stopband edge frequencies, normalized from 0 - to 1 (1 corresponds to pi radians / sample). For example: - Lowpass: wp = 0.2, ws = 0.3 - Highpass: wp = 0.3, ws = 0.2 - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] - gpass -- The maximum loss in the passband (dB). - gstop -- The minimum attenuation in the stopband (dB). - analog -- Non-zero to design an analog filter (in this case wp and - ws are in radians / second). + wp, ws : float + Passband and stopband edge frequencies, normalized from 0 to 1 (1 + corresponds to pi radians / sample). For example: + - Lowpass: wp = 0.2, ws = 0.3 + - Highpass: wp = 0.3, ws = 0.2 + - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] + - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] + + gpass : float + The maximum loss in the passband (dB). + gstop : float + The minimum attenuation in the stopband (dB). + analog : int, optional + Non-zero to design an analog filter (in this case `wp` and `ws` are in + radians / second). + Returns ------- - ord -- The lowest order for a Chebyshev type I filter that meets specs. - Wn -- The Chebyshev natural frequency (the "3dB frequency") for - use with scipy.signal.cheby1 to give filter results. + ord : int + The lowest order for a Chebyshev type I filter that meets specs. + wn : ndarray or float + The Chebyshev natural frequency (the "3dB frequency") for use with + `cheby1` to give filter results. """ wp = atleast_1d(wp) @@ -854,22 +909,30 @@ Parameters ---------- - wp, ws -- Passband and stopband edge frequencies, normalized from 0 - to 1 (1 corresponds to pi radians / sample). For example: - Lowpass: wp = 0.2, ws = 0.3 - Highpass: wp = 0.3, ws = 0.2 - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] - gpass -- The maximum loss in the passband (dB). - gstop -- The minimum attenuation in the stopband (dB). - analog -- Non-zero to design an analog filter (in this case wp and - ws are in radians / second). + wp, ws : float + Passband and stopband edge frequencies, normalized from 0 to 1 (1 + corresponds to pi radians / sample). For example: + - Lowpass: wp = 0.2, ws = 0.3 + - Highpass: wp = 0.3, ws = 0.2 + - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] + - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] + + gpass : float + The maximum loss in the passband (dB). + gstop : float + The minimum attenuation in the stopband (dB). + analog : int, optional + Non-zero to design an analog filter (in this case `wp` and `ws` are in + radians / second). + Returns ------- - ord -- The lowest order for a Chebyshev type II filter that meets specs. - Wn -- The Chebyshev natural frequency for - use with scipy.signal.cheby2 to give the filter. + ord : int + The lowest order for a Chebyshev type II filter that meets specs. + wn : ndarray or float + The Chebyshev natural frequency (the "3dB frequency") for use with + `cheby2` to give filter results. """ wp = atleast_1d(wp) @@ -953,22 +1016,30 @@ Parameters ---------- - wp, ws -- Passband and stopband edge frequencies, normalized from 0 - to 1 (1 corresponds to pi radians / sample). For example: - Lowpass: wp = 0.2, ws = 0.3 - Highpass: wp = 0.3, ws = 0.2 - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] - gpass -- The maximum loss in the passband (dB). - gstop -- The minimum attenuation in the stopband (dB). - analog -- Non-zero to design an analog filter (in this case wp and - ws are in radians / second). + wp, ws : float + Passband and stopband edge frequencies, normalized from 0 to 1 (1 + corresponds to pi radians / sample). For example: + - Lowpass: wp = 0.2, ws = 0.3 + - Highpass: wp = 0.3, ws = 0.2 + - Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6] + - Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5] + + gpass : float + The maximum loss in the passband (dB). + gstop : float + The minimum attenuation in the stopband (dB). + analog : int, optional + Non-zero to design an analog filter (in this case `wp` and `ws` are in + radians / second). + Returns - ------- - ord -- The lowest order for an Elliptic (Cauer) filter that meets specs. - Wn -- The natural frequency for use with scipy.signal.ellip - to give the filter. + ------ + ord : int + The lowest order for an Elliptic (Cauer) filter that meets specs. + wn : ndarray or float + The Chebyshev natural frequency (the "3dB frequency") for use with + `ellip` to give filter results.- """ wp = atleast_1d(wp) @@ -1031,10 +1102,9 @@ k = 1 return z, p, k -def cheb1ap(N,rp): - """Return (z,p,k) zero, pole, gain for Nth order Chebyshev type I - lowpass analog filter prototype with rp decibels of ripple - in the passband. +def cheb1ap(N, rp): + """Return (z,p,k) zero, pole, gain for Nth order Chebyshev type I lowpass + analog filter prototype with `rp` decibels of ripple in the passband. """ z = [] eps = numpy.sqrt(10**(0.1*rp)-1.0) @@ -1048,10 +1118,9 @@ return z, p, k pass -def cheb2ap(N,rs): - """Return (z,p,k) zero, pole, gain for Nth order Chebyshev type II - lowpass analog filter prototype with rs decibels of ripple - in the stopband. +def cheb2ap(N, rs): + """Return (z,p,k) zero, pole, gain for Nth order Chebyshev type II lowpass + analog filter prototype with `rs` decibels of ripple in the stopband. """ de = 1.0/sqrt(10**(0.1*rs)-1) mu = arcsinh(1.0/de)/N @@ -1093,13 +1162,16 @@ r = 1e20 return abs(r) -def ellipap(N,rp,rs): +def ellipap(N, rp, rs): """Return (z,p,k) zeros, poles, and gain of an Nth order normalized - prototype elliptic analog lowpass filter with rp decibels of ripple - in the passband and a stopband rs decibels down. + prototype elliptic analog lowpass filter with `rp` decibels of ripple in + the passband and a stopband `rs` decibels down. - See Chapter 12 and Chapter 5 of "Filter Design for Signal Processing", - by Lutova, Tosic, and Evans. This is + References + ---------- + Lutova, Tosic, and Evans, "Filter Design for Signal Processing", Chapters 5 + and 12. + """ if N == 1: p = -sqrt(1.0/(10**(0.1*rp)-1.0)) @@ -1160,8 +1232,8 @@ def besselap(N): - """Return (z,p,k) zero, pole, gain for analog prototype of an Nth - order Bessel filter.""" + """Return (z,p,k) zero, pole, gain for analog prototype of an Nth order + Bessel filter.""" z = [] k = 1 if N == 0: Modified: trunk/scipy/signal/ltisys.py =================================================================== --- trunk/scipy/signal/ltisys.py 2010-09-22 22:59:34 UTC (rev 6816) +++ trunk/scipy/signal/ltisys.py 2010-09-23 09:17:07 UTC (rev 6817) @@ -127,7 +127,7 @@ ---------- A, B, C, D : ndarray State-space representation of linear system. - input : int + input : int, optional For multiple-input systems, the input to use. Returns @@ -174,7 +174,7 @@ return num, den -def zpk2ss(z,p,k): +def zpk2ss(z, p, k): """Zero-pole-gain representation to state-space representation Parameters @@ -192,17 +192,23 @@ """ return tf2ss(*zpk2tf(z,p,k)) -def ss2zpk(A,B,C,D,input=0): +def ss2zpk(A, B, C, D, input=0): """State-space representation to zero-pole-gain representation. - Inputs: + Parameters + ---------- + A, B, C, D : ndarray + State-space representation of linear system. + input : int, optional + For multiple-input systems, the input to use. - A, B, C, D -- state-space matrices. - input -- for multiple-input systems, the input to use. + Returns + ------- + z, p : sequence + Zeros and poles. + k : float + System gain. - Outputs: - - z, p, k -- zeros and poles in sequences and gain constant. """ return tf2zpk(*ss2tf(A,B,C,D,input=input)) @@ -501,21 +507,21 @@ def _default_response_times(A, n): """Compute a reasonable set of time samples for the response time. - This function is used by impulse(), impulse2(), step() and step2() + This function is used by `impulse`, `impulse2`, `step` and `step2` to compute the response time when the `T` argument to the function is None. Parameters ---------- - A : square ndarray - The system matrix. + A : ndarray + The system matrix, which is square. n : int The number of time samples to generate. Returns ------- - t : ndarray, 1D - The 1D array of length `n` of time samples at which the response + t : ndarray + The 1-D array of length `n` of time samples at which the response is to be computed. """ # Create a reasonable time interval. This could use some more work. @@ -546,10 +552,11 @@ Returns ------- - T : 1D ndarray - Time points. - yout : 1D ndarray - Impulse response of the system (except for singularities at zero). + T : ndarray + A 1-D array of time points. + yout : ndarray + A 1-D array containing the impulse response of the system (except for + singularities at zero). """ if isinstance(system, lti): @@ -686,7 +693,7 @@ def step2(system, X0=None, T=None, N=None, **kwargs): """Step response of continuous-time system. - + This function is functionally the same as `scipy.signal.step`, but it uses the function `scipy.signal.lsim2` to compute the step response. From scipy-svn at scipy.org Thu Sep 23 05:17:32 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 23 Sep 2010 04:17:32 -0500 (CDT) Subject: [Scipy-svn] r6818 - trunk/scipy/signal Message-ID: <20100923091732.0D46839CD30@scipy.org> Author: rgommers Date: 2010-09-23 04:17:31 -0500 (Thu, 23 Sep 2010) New Revision: 6818 Modified: trunk/scipy/signal/signaltools.py Log: DOC: make signaltools docs conform to current documentation standard. Modified: trunk/scipy/signal/signaltools.py =================================================================== --- trunk/scipy/signal/signaltools.py 2010-09-23 09:17:07 UTC (rev 6817) +++ trunk/scipy/signal/signaltools.py 2010-09-23 09:17:31 UTC (rev 6818) @@ -302,7 +302,7 @@ return sigtools._order_filterND(a, domain, rank) -def medfilt(volume,kernel_size=None): +def medfilt(volume, kernel_size=None): """ Perform a median filter on an N-dimensional array. @@ -345,7 +345,7 @@ return sigtools._order_filterND(volume,domain,order) -def wiener(im,mysize=None,noise=None): +def wiener(im, mysize=None, noise=None): """ Perform a Wiener filter on an N-dimensional array. @@ -396,33 +396,41 @@ def convolve2d(in1, in2, mode='full', boundary='fill', fillvalue=0, old_behavior=True): """Convolve two 2-dimensional arrays. - Description: + Convolve `in1` and `in2` with output size determined by mode and boundary + conditions determined by `boundary` and `fillvalue`. - Convolve in1 and in2 with output size determined by mode and boundary - conditions determined by boundary and fillvalue. + Parameters + ---------- + in1, in2 : ndarray + Two-dimensional input arrays to be convolved. + mode: str, optional + A string indicating the size of the output: - Inputs: + ``valid`` : the output consists only of those elements that do not + rely on the zero-padding. - in1 -- a 2-dimensional array. - in2 -- a 2-dimensional array. - mode -- a flag indicating the size of the output - 'valid' (0): The output consists only of those elements that - do not rely on the zero-padding. - 'same' (1): The output is the same size as the input centered - with respect to the 'full' output. - 'full' (2): The output is the full discrete linear convolution - of the inputs. (*Default*) - boundary -- a flag indicating how to handle boundaries - 'fill' : pad input arrays with fillvalue. (*Default*) - 'wrap' : circular boundary conditions. - 'symm' : symmetrical boundary conditions. - fillvalue -- value to fill pad input arrays with (*Default* = 0) + ``same`` : the output is the same size as the largest input centered + with respect to the 'full' output. - Outputs: (out,) + ``full`` : the output is the full discrete linear cross-correlation + of the inputs. (Default) - out -- a 2-dimensional array containing a subset of the discrete linear - convolution of in1 with in2. + boundary : str, optional + A flag indicating how to handle boundaries: + - 'fill' : pad input arrays with fillvalue. (default) + - 'wrap' : circular boundary conditions. + - 'symm' : symmetrical boundary conditions. + + fillvalue : scalar, optional + Value to fill pad input arrays with. Default is 0. + + Returns + ------- + out : ndarray + A 2-dimensional array containing a subset of the discrete linear + convolution of `in1` with `in2`. + """ if old_behavior: warnings.warn(DeprecationWarning(_SWAP_INPUTS_DEPRECATION_MSG)) @@ -450,33 +458,41 @@ def correlate2d(in1, in2, mode='full', boundary='fill', fillvalue=0, old_behavior=True): """Cross-correlate two 2-dimensional arrays. - Description: + Cross correlate in1 and in2 with output size determined by mode and + boundary conditions determined by `boundary` and `fillvalue`. - Cross correlate in1 and in2 with output size determined by mode - and boundary conditions determined by boundary and fillvalue. + Parameters + ---------- + in1, in2 : ndarray + Two-dimensional input arrays to be convolved. + mode: str, optional + A string indicating the size of the output: - Inputs: + ``valid`` : the output consists only of those elements that do not + rely on the zero-padding. - in1 -- a 2-dimensional array. - in2 -- a 2-dimensional array. - mode -- a flag indicating the size of the output - 'valid' (0): The output consists only of those elements that - do not rely on the zero-padding. - 'same' (1): The output is the same size as the input centered - with respect to the 'full' output. - 'full' (2): The output is the full discrete linear convolution - of the inputs. (*Default*) - boundary -- a flag indicating how to handle boundaries - 'fill' : pad input arrays with fillvalue. (*Default*) - 'wrap' : circular boundary conditions. - 'symm' : symmetrical boundary conditions. - fillvalue -- value to fill pad input arrays with (*Default* = 0) + ``same`` : the output is the same size as the largest input centered + with respect to the 'full' output. - Outputs: (out,) + ``full`` : the output is the full discrete linear cross-correlation + of the inputs. (Default) - out -- a 2-dimensional array containing a subset of the discrete linear - cross-correlation of in1 with in2. + boundary : str, optional + A flag indicating how to handle boundaries: + - 'fill' : pad input arrays with fillvalue. (default) + - 'wrap' : circular boundary conditions. + - 'symm' : symmetrical boundary conditions. + + fillvalue : scalar, optional + Value to fill pad input arrays with. Default is 0. + + Returns + ------- + out : ndarray + A 2-dimensional array containing a subset of the discrete linear + cross-correlation of `in1` with `in2`. + """ if old_behavior: warnings.warn(DeprecationWarning(_SWAP_INPUTS_DEPRECATION_MSG)) @@ -490,7 +506,7 @@ Median filter a 2-dimensional array. Apply a median filter to the input array using a local window-size - given by kernel_size (must be odd). + given by `kernel_size` (must be odd). Parameters ---------- @@ -706,8 +722,8 @@ If M=len(b)-1 and N=len(a)-1. Then, the initial conditions are given in the vectors x and y as:: - x = {x[-1],x[-2],...,x[-M]} - y = {y[-1],y[-2],...,y[-N]} + x = {x[-1],x[-2],...,x[-M]} + y = {y[-1],y[-2],...,y[-N]} If x is not given, its inital conditions are assumed zero. If either vector is too short, then zeros are added @@ -715,7 +731,7 @@ The output vector zi contains:: - zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]} where K=max(M,N). + zi = {z_0[-1], z_1[-1], ..., z_K-1[-1]} where K=max(M,N). """ N = np.size(a)-1 @@ -823,7 +839,7 @@ x = ifft(Xf*h, axis=axis) return x -def hilbert2(x,N=None): +def hilbert2(x, N=None): """ Compute the '2-D' analytic signal of `x` @@ -889,7 +905,7 @@ indx = argsort(p) return take(p,indx,0), indx -def unique_roots(p,tol=1e-3,rtype='min'): +def unique_roots(p, tol=1e-3, rtype='min'): """ Determine unique roots and their multiplicities from a list of roots. @@ -961,7 +977,7 @@ return array(pout), array(mult) -def invres(r,p,k,tol=1e-3,rtype='avg'): +def invres(r, p, k, tol=1e-3, rtype='avg'): """Compute b(s) and a(s) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) @@ -1014,7 +1030,7 @@ b = b[1:] return b, a -def residue(b,a,tol=1e-3,rtype='avg'): +def residue(b, a, tol=1e-3, rtype='avg'): """ Compute partial-fraction expansion of b(s) / a(s). @@ -1085,7 +1101,7 @@ indx += sig return r/rscale, p, k -def residuez(b,a,tol=1e-3,rtype='avg'): +def residuez(b, a, tol=1e-3, rtype='avg'): """Compute partial-fraction expansion of b(z) / a(z). If M = len(b) and N = len(a) @@ -1105,7 +1121,10 @@ -------------- + ------------------ + ... + ------------------ (1-p[i]z**(-1)) (1-p[i]z**(-1))**2 (1-p[i]z**(-1))**n - See also: invresz, poly, polyval, unique_roots + See also + -------- + invresz, poly, polyval, unique_roots + """ b,a = map(asarray,(b,a)) gain = a[0] @@ -1150,7 +1169,7 @@ indx += sig return r/gain, p, k -def invresz(r,p,k,tol=1e-3,rtype='avg'): +def invresz(r, p, k, tol=1e-3, rtype='avg'): """Compute b(z) and a(z) from partial fraction expansion: r,p,k If M = len(b) and N = len(a) @@ -1170,7 +1189,10 @@ -------------- + ------------------ + ... + ------------------ (1-p[i]z**(-1)) (1-p[i]z**(-1))**2 (1-p[i]z**(-1))**n - See also: residuez, poly, polyval, unique_roots + See also + -------- + residuez, poly, polyval, unique_roots + """ extra = asarray(k) p, indx = cmplx_sort(p) @@ -1201,13 +1223,13 @@ return b, a -def resample(x,num,t=None,axis=0,window=None): +def resample(x, num, t=None, axis=0, window=None): """ Resample `x` to `num` samples using Fourier method along the given axis. The resampled signal starts at the same value as `x` but is sampled - with a spacing of `len(x) / num * (spacing of x)`. Because a - Fourier method is used, the signal is assumed periodic. + with a spacing of ``len(x) / num * (spacing of x)``. Because a + Fourier method is used, the signal is assumed to be periodic. Parameters ---------- @@ -1226,7 +1248,6 @@ Returns ------- - resampled_x or (resampled_x, resampled_t) Either the resampled array, or, if `t` was given, a tuple containing the resampled array and the corresponding resampled @@ -1373,7 +1394,7 @@ ret = transpose(ret,tuple(olddims)) return ret -def lfilter_zi(b,a): +def lfilter_zi(b, a): #compute the zi state from the filter parameters. see [Gust96]. #Based on: @@ -1398,7 +1419,7 @@ return array(zi_return) -def filtfilt(b,a,x): +def filtfilt(b, a, x): b, a, x = map(asarray, [b, a, x]) # FIXME: For now only accepting 1d arrays ntaps=max(len(a),len(b)) @@ -1460,7 +1481,9 @@ y : N-d array the down-sampled signal - See also: resample + See also + -------- + resample """ if not isinstance(q, int): From scipy-svn at scipy.org Thu Sep 23 05:17:48 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 23 Sep 2010 04:17:48 -0500 (CDT) Subject: [Scipy-svn] r6819 - trunk/scipy/signal Message-ID: <20100923091748.D393A39CD30@scipy.org> Author: rgommers Date: 2010-09-23 04:17:48 -0500 (Thu, 23 Sep 2010) New Revision: 6819 Modified: trunk/scipy/signal/bsplines.py trunk/scipy/signal/fir_filter_design.py Log: DOC: make bsplines and fir_filter_design docs conform to current documentation standard. Modified: trunk/scipy/signal/bsplines.py =================================================================== --- trunk/scipy/signal/bsplines.py 2010-09-23 09:17:31 UTC (rev 6818) +++ trunk/scipy/signal/bsplines.py 2010-09-23 09:17:48 UTC (rev 6819) @@ -14,8 +14,8 @@ def spline_filter(Iin, lmbda=5.0): """Smoothing spline (cubic) filtering of a rank-2 array. - Filter an input data set, Iin, using a (cubic) smoothing spline of - fall-off lmbda. + Filter an input data set, `Iin`, using a (cubic) smoothing spline of + fall-off `lmbda`. """ intype = Iin.dtype.char hcol = array([1.0,4.0,1.0],'f')/6.0 @@ -37,15 +37,15 @@ _splinefunc_cache = {} def _bspline_piecefunctions(order): - """Returns the function defined over the left-side - pieces for a bspline of a given order. The 0th piece - is the first one less than 0. The last piece is - a function identical to 0 (returned as the constant 0). + """Returns the function defined over the left-side pieces for a bspline of + a given order. - (There are order//2 + 2 total pieces). + The 0th piece is the first one less than 0. The last piece is a function + identical to 0 (returned as the constant 0). (There are order//2 + 2 total + pieces). - Also returns the condition functions that when evaluated - return boolean arrays for use with numpy.piecewise + Also returns the condition functions that when evaluated return boolean + arrays for use with `numpy.piecewise`. """ try: return _splinefunc_cache[order] @@ -100,9 +100,13 @@ return funclist, condfuncs -def bspline(x,n): - """bspline(x,n): B-spline basis function of order n. - uses numpy.piecewise and automatic function-generator. +def bspline(x, n): + """B-spline basis function of order n. + + Notes + ----- + Uses numpy.piecewise and automatic function-generator. + """ ax = -abs(asarray(x)) # number of pieces on the left-side is (n+1)/2 @@ -110,14 +114,16 @@ condlist = [func(ax) for func in condfuncs] return piecewise(ax, condlist, funclist) -def gauss_spline(x,n): +def gauss_spline(x, n): """Gaussian approximation to B-spline basis function of order n. """ signsq = (n+1) / 12.0 return 1/sqrt(2*pi*signsq) * exp(-x**2 / 2 / signsq) def cubic(x): - """Special case of bspline. Equivalent to bspline(x,3). + """A cubic B-spline. + + This is a special case of `bspline`, and equivalent to ``bspline(x, 3)``. """ ax = abs(asarray(x)) res = zeros_like(ax) @@ -132,7 +138,9 @@ return res def quadratic(x): - """Special case of bspline. Equivalent to bspline(x,2). + """A quadratic B-spline. + + This is a special case of `bspline`, and equivalent to ``bspline(x, 2)``. """ ax = abs(asarray(x)) res = zeros_like(ax) @@ -182,16 +190,16 @@ rho = rho * sqrt((48*lam + 24*lam * sqrt(3+144*lam))/xi) return rho,omeg -def _hc(k,cs,rho,omega): +def _hc(k, cs, rho, omega): return cs / sin(omega) * (rho**k)*sin(omega*(k+1))*(greater(k,-1)) -def _hs(k,cs,rho,omega): +def _hs(k, cs, rho, omega): c0 = cs*cs * (1 + rho*rho) / (1 - rho*rho) / (1-2*rho*rho*cos(2*omega) + rho**4) gamma = (1-rho*rho) / (1+rho*rho) / tan(omega) ak = abs(k) return c0 * rho**ak * (cos(omega*ak) + gamma*sin(omega*ak)) -def _cubic_smooth_coeff(signal,lamb): +def _cubic_smooth_coeff(signal, lamb): rho, omega = _coeff_smooth(lamb) cs = 1-2*rho*cos(omega) + rho*rho K = len(signal) @@ -245,24 +253,27 @@ output[k] = zi*(output[k+1]-yplus[k]) return output*8.0 -def cspline1d(signal,lamb=0.0): - """Compute cubic spline coefficients for rank-1 array. +def cspline1d(signal, lamb=0.0): + """ + Compute cubic spline coefficients for rank-1 array. - Description: + Find the cubic spline coefficients for a 1-D signal assuming + mirror-symmetric boundary conditions. To obtain the signal back from the + spline representation mirror-symmetric-convolve these coefficients with a + length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 . - Find the cubic spline coefficients for a 1-D signal assuming - mirror-symmetric boundary conditions. To obtain the signal back from - the spline representation mirror-symmetric-convolve these coefficients - with a length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 . + Parameters + ---------- + signal : ndarray + A rank-1 array representing samples of a signal. + lamb : float, optional + Smoothing coefficient, default is 0.0. - Inputs: + Returns + ------- + c : ndarray + Cubic spline coefficients. - signal -- a rank-1 array representing samples of a signal. - lamb -- smoothing coefficient (default = 0.0) - - Output: - - c -- cubic spline coefficients. """ if lamb != 0.0: return _cubic_smooth_coeff(signal,lamb) @@ -270,24 +281,25 @@ return _cubic_coeff(signal) -def qspline1d(signal,lamb=0.0): +def qspline1d(signal, lamb=0.0): """Compute quadratic spline coefficients for rank-1 array. - Description: + Find the quadratic spline coefficients for a 1-D signal assuming + mirror-symmetric boundary conditions. To obtain the signal back from the + spline representation mirror-symmetric-convolve these coefficients with a + length 3 FIR window [1.0, 6.0, 1.0]/ 8.0 . - Find the quadratic spline coefficients for a 1-D signal assuming - mirror-symmetric boundary conditions. To obtain the signal back from - the spline representation mirror-symmetric-convolve these coefficients - with a length 3 FIR window [1.0, 6.0, 1.0]/ 8.0 . + Parameters + ---------- + signal : ndarray + A rank-1 array representing samples of a signal. + lamb : float, optional + Smoothing coefficient (must be zero for now). - Inputs: - - signal -- a rank-1 array representing samples of a signal. - lamb -- smoothing coefficient (must be zero for now.) - - Output: - - c -- cubic spline coefficients. + Returns + ------- + c : ndarray + Cubic spline coefficients. """ if lamb != 0.0: raise ValueError, "Smoothing quadratic splines not supported yet." @@ -297,16 +309,15 @@ def cspline1d_eval(cj, newx, dx=1.0, x0=0): """Evaluate a spline at the new set of points. - dx is the old sample-spacing while x0 was the old origin. - In other-words the old-sample points (knot-points) for which the cj - represent spline coefficients were at equally-spaced points of + `dx` is the old sample-spacing while `x0` was the old origin. In + other-words the old-sample points (knot-points) for which the `cj` + represent spline coefficients were at equally-spaced points of: - oldx = x0 + j*dx j=0...N-1 + oldx = x0 + j*dx j=0...N-1, with N=len(cj) - N=len(cj) + Edges are handled using mirror-symmetric boundary conditions. - edges are handled using mirror-symmetric boundary conditions. """ newx = (asarray(newx)-x0)/float(dx) res = zeros_like(newx) @@ -333,16 +344,15 @@ def qspline1d_eval(cj, newx, dx=1.0, x0=0): """Evaluate a quadratic spline at the new set of points. - dx is the old sample-spacing while x0 was the old origin. - In other-words the old-sample points (knot-points) for which the cj - represent spline coefficients were at equally-spaced points of + `dx` is the old sample-spacing while `x0` was the old origin. In + other-words the old-sample points (knot-points) for which the `cj` + represent spline coefficients were at equally-spaced points of: - oldx = x0 + j*dx j=0...N-1 + oldx = x0 + j*dx j=0...N-1, with N=len(cj) - N=len(cj) + Edges are handled using mirror-symmetric boundary conditions. - edges are handled using mirror-symmetric boundary conditions. """ newx = (asarray(newx)-x0)/dx res = zeros_like(newx) Modified: trunk/scipy/signal/fir_filter_design.py =================================================================== --- trunk/scipy/signal/fir_filter_design.py 2010-09-23 09:17:31 UTC (rev 6818) +++ trunk/scipy/signal/fir_filter_design.py 2010-09-23 09:17:48 UTC (rev 6819) @@ -10,22 +10,34 @@ Parameters ---------- - ripple -- positive number specifying maximum ripple in passband (dB) - and minimum ripple in stopband - width -- width of transition region (normalized so that 1 corresponds - to pi radians / sample) + ripple : float + Positive number specifying maximum ripple in passband (dB) and minimum + ripple in stopband. + width : float + Width of transition region (normalized so that 1 corresponds to pi + radians / sample). Returns ------- - N, beta -- the order and beta parameter for the kaiser window. + N : int + The order parameter for the kaiser window. + beta : + The beta parameter for the kaiser window. - signal.kaiser(N,beta,sym=0) returns the window as does - signal.get_window(beta,N) - signal.get_window(('kaiser',beta),N) + Notes + ----- + There are several ways to obtain the Kaiser window: - Uses the empirical equations discovered by Kaiser. + signal.kaiser(N, beta, sym=0) + signal.get_window(beta,N) + signal.get_window(('kaiser',beta),N) - Oppenheim, Schafer, "Discrete-Time Signal Processing,", p.475-476. + The empirical equations discovered by Kaiser are used. + + References + ---------- + Oppenheim, Schafer, "Discrete-Time Signal Processing", p.475-476. + """ A = abs(ripple) # in case somebody is confused as to what's meant if (A>50): @@ -43,19 +55,23 @@ Parameters ---------- - N -- order of filter (number of taps) - cutoff -- cutoff frequency of filter (normalized so that 1 corresponds to - Nyquist or pi radians / sample) + N : int + Order of filter (number of taps). + cutoff : float + Cutoff frequency of filter (normalized so that 1 corresponds to Nyquist + or pi radians / sample) + width : float + If `width` is not None, then assume it is the approximate width of the + transition region (normalized so that 1 corresonds to pi) for use in + kaiser FIR filter design. + window : str. optional + Desired window to use. See `get_window` for a list of windows and + required parameters. Default is 'hamming'. - width -- if width is not None, then assume it is the approximate width of - the transition region (normalized so that 1 corresonds to pi) - for use in kaiser FIR filter design. - window -- desired window to use. See get_window for a list - of windows and required parameters. - Returns ------- - h -- coefficients of length N fir filter. + h : ndarray + Coefficients of length N FIR filter. """ From scipy-svn at scipy.org Thu Sep 23 05:18:07 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 23 Sep 2010 04:18:07 -0500 (CDT) Subject: [Scipy-svn] r6820 - trunk/scipy/signal Message-ID: <20100923091807.13D4A39CD30@scipy.org> Author: rgommers Date: 2010-09-23 04:18:06 -0500 (Thu, 23 Sep 2010) New Revision: 6820 Modified: trunk/scipy/signal/waveforms.py trunk/scipy/signal/wavelets.py trunk/scipy/signal/windows.py Log: DOC: make docs of signal.windows/waveforms/wavelets conform to doc standard. Modified: trunk/scipy/signal/waveforms.py =================================================================== --- trunk/scipy/signal/waveforms.py 2010-09-23 09:17:48 UTC (rev 6819) +++ trunk/scipy/signal/waveforms.py 2010-09-23 09:18:06 UTC (rev 6820) @@ -381,9 +381,10 @@ def _chirp_phase(t, f0, t1, f1, method='linear', vertex_zero=True): """ - Calculate the phase used by chirp_phase to generate its output. See - chirp_phase for a description of the arguments. + Calculate the phase used by chirp_phase to generate its output. + See `chirp_phase` for a description of the arguments. + """ f0 = float(f0) t1 = float(t1) @@ -477,9 +478,10 @@ def _sweep_poly_phase(t, poly): """ - Calculate the phase used by sweep_poly to generate its output. See - sweep_poly for a description of the arguments. + Calculate the phase used by sweep_poly to generate its output. + See `sweep_poly` for a description of the arguments. + """ # polyint handles lists, ndarrays and instances of poly1d automatically. intpoly = polyint(poly) Modified: trunk/scipy/signal/wavelets.py =================================================================== --- trunk/scipy/signal/wavelets.py 2010-09-23 09:17:48 UTC (rev 6819) +++ trunk/scipy/signal/wavelets.py 2010-09-23 09:18:06 UTC (rev 6820) @@ -72,34 +72,47 @@ asgn = [{0:1,1:-1}[k%2] for k in range(N+1)] return hk[::-1]*np.array(asgn) -def wavedec(amn,hk): +def wavedec(amn, hk): gk = qmf(hk) return NotImplemented -def cascade(hk,J=7): - """(x,phi,psi) at dyadic points K/2**J from filter coefficients. +def cascade(hk, J=7): + """Return (x, phi, psi) at dyadic points K/2**J from filter coefficients. - Inputs: - hk -- coefficients of low-pass filter - J -- values will be computed at grid points $K/2^J$ + Parameters + ---------- + hk : + Coefficients of low-pass filter. + J : int. optional + Values will be computed at grid points ``K/2**J``. - Outputs: - x -- the dyadic points $K/2^J$ for $K=0...N*(2^J)-1$ - where len(hk)=len(gk)=N+1 - phi -- the scaling function phi(x) at x - $\phi(x) = \sum_{k=0}^{N} h_k \phi(2x-k)$ - psi -- the wavelet function psi(x) at x - $\psi(x) = \sum_{k=0}^N g_k \phi(2x-k)$ - Only returned if gk is not None + Returns + ------- + x : + The dyadic points K/2**J for ``K=0...N * (2**J)-1`` where + ``len(hk) = len(gk) = N+1`` + phi : + The scaling function ``phi(x)`` at `x`: - Algorithm: + N + phi(x) = sum hk * phi(2x-k) + k=0 + psi : + The wavelet function ``psi(x)`` at `x`: - Uses the vector cascade algorithm described by Strang and Nguyen in - "Wavelets and Filter Banks" + N + phi(x) = sum gk * phi(2x-k) + k=0 - Builds a dictionary of values and slices for quick reuse. - Then inserts vectors into final vector at then end + `psi` is only returned if `gk` is not None. + Notes + ----- + The algorithm uses the vector cascade algorithm described by Strang and + Nguyen in "Wavelets and Filter Banks". It builds a dictionary of values + and slices for quick reuse. Then inserts vectors into final vector at the + end. + """ N = len(hk)-1 Modified: trunk/scipy/signal/windows.py =================================================================== --- trunk/scipy/signal/windows.py 2010-09-23 09:17:48 UTC (rev 6819) +++ trunk/scipy/signal/windows.py 2010-09-23 09:18:06 UTC (rev 6820) @@ -262,10 +262,9 @@ def general_gaussian(M, p, sig, sym=True): """Return a window with a generalized Gaussian shape. - exp(-0.5*(x/sig)**(2*p)) + The Gaussian shape is defined as ``exp(-0.5*(x/sig)**(2*p))``, the + half-power point is at ``(2*log(2)))**(1/(2*p)) * sig``. - half power point is at (2*log(2)))**(1/(2*p))*sig - """ if M < 1: return np.array([]) @@ -286,13 +285,13 @@ def chebwin(M, at, sym=True): """Dolph-Chebyshev window. - INPUTS: - - M : int - Window size - at : float - Attenuation (in dB) - sym : bool + Parameters + ---------- + M : int + Window size. + at : float + Attenuation (in dB). + sym : bool Generates symmetric window if True. """ From scipy-svn at scipy.org Thu Sep 23 11:27:55 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Thu, 23 Sep 2010 10:27:55 -0500 (CDT) Subject: [Scipy-svn] r6821 - trunk/scipy/integrate Message-ID: <20100923152755.68C6339CDFF@scipy.org> Author: rgommers Date: 2010-09-23 10:27:54 -0500 (Thu, 23 Sep 2010) New Revision: 6821 Modified: trunk/scipy/integrate/ode.py trunk/scipy/integrate/quadpack.py trunk/scipy/integrate/quadrature.py Log: DOC: make docs in integrate module conform to documentation standard. Modified: trunk/scipy/integrate/ode.py =================================================================== --- trunk/scipy/integrate/ode.py 2010-09-23 09:18:06 UTC (rev 6820) +++ trunk/scipy/integrate/ode.py 2010-09-23 15:27:54 UTC (rev 6821) @@ -1,6 +1,6 @@ # Authors: Pearu Peterson, Pauli Virtanen, John Travers """ -First-order ODE integrators +First-order ODE integrators. User-friendly interface to various numerical integrators for solving a system of first order ODEs with prescribed initial conditions:: @@ -35,7 +35,7 @@ This class has the same generic interface as ode, except it can handle complex f, y and Jacobians by transparently translating them into the equivalent real valued system. It supports the real valued solvers (i.e not zvode) and is -an alternative to ode with the zvode solver, sometimes performing better. +an alternative to ode with the zvode solver, sometimes performing better. """ integrator_info = \ @@ -109,21 +109,21 @@ Numerical solution of a system of first order ordinary differential equations y'=f(x,y). - this is an explicit runge-kutta method of order (4)5 + this is an explicit runge-kutta method of order (4)5 due to Dormand & Prince (with stepsize control and dense output). Authors: E. Hairer and G. Wanner Universite de Geneve, Dept. de Mathematiques - CH-1211 Geneve 24, Switzerland + CH-1211 Geneve 24, Switzerland e-mail: ernst.hairer at math.unige.ch gerhard.wanner at math.unige.ch - - This code is described in: + + This code is described in: E. Hairer, S.P. Norsett and G. Wanner, Solving Ordinary Differential Equations i. Nonstiff Problems. 2nd edition. Springer Series in Computational Mathematics, - Springer-Verlag (1993) + Springer-Verlag (1993) This integrator accepts the following parameters in set_integrator() method of the ode class: @@ -150,7 +150,7 @@ Numerical solution of a system of first 0rder ordinary differential equations y'=f(x,y). - this is an explicit runge-kutta method of order 8(5,3) + this is an explicit runge-kutta method of order 8(5,3) due to Dormand & Prince (with stepsize control and dense output). @@ -295,7 +295,7 @@ Parameters ---------- name : str - Name of the integrator + Name of the integrator. integrator_params : Additional parameters for the integrator. """ @@ -345,8 +345,12 @@ return self class complex_ode(ode): - """ A wrapper of ode for complex systems. """ + """ A wrapper of ode for complex systems. + For usage examples, see `ode`. + + """ + def __init__(self, f, jac=None): """ Define equation y' = f(y,t), where y and f can be complex. @@ -366,13 +370,13 @@ ode.__init__(self, self._wrap, self._wrap_jac) else: ode.__init__(self, self._wrap, None) - + def _wrap(self, t, y, *f_args): f = self.cf(*((t, y[::2] + 1j*y[1::2]) + f_args)) self.tmp[::2] = real(f) self.tmp[1::2] = imag(f) return self.tmp - + def _wrap_jac(self, t, y, *jac_args): jac = self.cjac(*((t, y[::2] + 1j*y[1::2]) + jac_args)) self.jac_tmp[1::2,1::2] = self.jac_tmp[::2,::2] = real(jac) @@ -681,7 +685,7 @@ def run(self,*args): y1,t,istate = self.runner(*(args[:5]+tuple(self.call_args)+args[5:])) if istate < 0: - warnings.warn('zvode: ' + + warnings.warn('zvode: ' + self.messages.get(istate, 'Unexpected istate=%s'%istate)) self.success = 0 else: @@ -744,11 +748,11 @@ def run(self,f,jac,y0,t0,t1,f_params,jac_params): x,y,iwork,idid = self.runner(*((f,t0,y0,t1) + tuple(self.call_args))) if idid < 0: - warnings.warn(self.name + ': ' + + warnings.warn(self.name + ': ' + self.messages.get(idid, 'Unexpected idid=%s'%idid)) self.success = 0 return y,x - + def _solout(self, *args): # dummy solout function pass Modified: trunk/scipy/integrate/quadpack.py =================================================================== --- trunk/scipy/integrate/quadpack.py 2010-09-23 09:18:06 UTC (rev 6820) +++ trunk/scipy/integrate/quadpack.py 2010-09-23 15:27:54 UTC (rev 6821) @@ -114,17 +114,17 @@ information dictionary contains the following entries instead of 'last', 'alist', 'blist', 'rlist', and 'elist': - 'lst' -- The number of subintervals needed for the integration (call it K_f). - 'rslst' -- A rank-1 array of length M_f=limlst, whose first K_f elements + 'lst' : The number of subintervals needed for the integration (call it K_f). + 'rslst' : A rank-1 array of length M_f=limlst, whose first K_f elements contain the integral contribution over the interval (a+(k-1)c, a+kc) where c = (2*floor(|w|) + 1) * pi / |w| and k=1,2,...,K_f. - 'erlst' -- A rank-1 array of length M_f containing the error estimate + 'erlst' : A rank-1 array of length M_f containing the error estimate corresponding to the interval in the same position in infodict['rslist']. - 'ierlst' -- A rank-1 integer array of length M_f containing an error flag - corresponding to the interval in the same position in - infodict['rslist']. See the explanation dictionary (last entry - in the output tuple) for the meaning of the codes. + 'ierlst' : A rank-1 integer array of length M_f containing an error flag + corresponding to the interval in the same position in + infodict['rslist']. See the explanation dictionary (last entry + in the output tuple) for the meaning of the codes. """) return @@ -207,16 +207,15 @@ See Also -------- - dblquad, tplquad - double and triple integrals - fixed_quad - fixed-order Gaussian quadrature - quadrature - adaptive Gaussian quadrature - odeint, ode - ODE integrators - simps, trapz, romb - integrators for sampled data - scipy.special - for coefficients and roots of orthogonal polynomials + dblquad, tplquad : double and triple integrals + fixed_quad : fixed-order Gaussian quadrature + quadrature : adaptive Gaussian quadrature + odeint, ode : ODE integrators + simps, trapz, romb : integrators for sampled data + scipy.special : for coefficients and roots of orthogonal polynomials Examples -------- - Calculate :math:`\\int^4_0 x^2 dx` and compare with an analytic result >>> from scipy import integrate @@ -232,7 +231,6 @@ >>> integrate.quad(invexp,0,inf) (0.99999999999999989, 5.8426061711142159e-11) - >>> f = lambda x,a : a*x >>> y, err = integrate.quad(f, 0, 1, args=(1,)) >>> y @@ -375,46 +373,48 @@ def dblquad(func, a, b, gfun, hfun, args=(), epsabs=1.49e-8, epsrel=1.49e-8): """ - Compute the double integral of func2d(y,x) - from x=a..b and y=gfun(x)..hfun(x). + Compute a double integral. + Return the double (definite) integral of func(y,x) from x=a..b and + y=gfun(x)..hfun(x). + Parameters ----------- - func2d : function - a Python function or method of at least two variables: y must be - the first argument and x the second argument. - (a,b) : tuple - the limits of integration in x: a < b - gfun : function - the lower boundary curve in y which is a function taking a single - floating point argument (x) and returning a floating point result: - a lambda function can be useful here. - hfun : function - the upper boundary curve in y (same requirements as gfun). - args : - extra arguments to pass to func2d. - epsabs : float - absolute tolerance passed directly to the inner 1-D quadrature - integration. - epsrel : float - relative tolerance of the inner 1-D integrals. + func : callable + A Python function or method of at least two variables: y must be the + first argument and x the second argument. + (a,b) : tuple + The limits of integration in x: a < b + gfun : callable + The lower boundary curve in y which is a function taking a single + floating point argument (x) and returning a floating point result: a + lambda function can be useful here. + hfun : callable + The upper boundary curve in y (same requirements as `gfun`). + args : sequence, optional + Extra arguments to pass to `func2d`. + epsabs : float, optional + Absolute tolerance passed directly to the inner 1-D quadrature + integration. Default is 1.49e-8. + epsrel : float + Relative tolerance of the inner 1-D integrals. Default is 1.49e-8. - Returns - ----------- - y : float - the resultant integral. - abserr : float - an estimate of the error. + ------- + y : float + The resultant integral. + abserr : float + An estimate of the error. - See also: - quad - single integral - tplquad - triple integral - fixed_quad - fixed-order Gaussian quadrature - quadrature - adaptive Gaussian quadrature - odeint, ode - ODE integrators - simps, trapz, romb - integrators for sampled data - scipy.special - for coefficients and roots of orthogonal polynomials + See also + -------- + quad : single integral + tplquad : triple integral + fixed_quad : fixed-order Gaussian quadrature + quadrature : adaptive Gaussian quadrature + odeint, ode : ODE integrators + simps, trapz, romb : integrators for sampled data + scipy.special : for coefficients and roots of orthogonal polynomials """ return quad(_infunc,a,b,(func,gfun,hfun,args),epsabs=epsabs,epsrel=epsrel) @@ -430,12 +430,12 @@ """ Compute a triple (definite) integral. - Return the triple integral of func3d(z, y,x) from + Return the triple integral of func(z, y, x) from x=a..b, y=gfun(x)..hfun(x), and z=qfun(x,y)..rfun(x,y) Parameters ---------- - func3d : function + func : function A Python function or method of at least three variables in the order (z, y, x). (a,b) : tuple @@ -453,11 +453,11 @@ The upper boundary surface in z. (Same requirements as qfun.) args : Arguments Extra arguments to pass to func3d. - epsabs : float + epsabs : float, optional Absolute tolerance passed directly to the innermost 1-D quadrature - integration. - epsrel : float - Relative tolerance of the innermost 1-D integrals. + integration. Default is 1.49e-8. + epsrel : float, optional + Relative tolerance of the innermost 1-D integrals. Default is 1.49e-8. Returns ------- Modified: trunk/scipy/integrate/quadrature.py =================================================================== --- trunk/scipy/integrate/quadrature.py 2010-09-23 09:18:06 UTC (rev 6820) +++ trunk/scipy/integrate/quadrature.py 2010-09-23 15:27:54 UTC (rev 6821) @@ -176,7 +176,7 @@ def cumtrapz(y, x=None, dx=1.0, axis=-1): """ Cumulatively integrate y(x) using samples along the given axis - and the composite trapezoidal rule. If x is None, spacing given by dx + and the composite trapezoidal rule. If x is None, spacing given by `dx` is assumed. Parameters @@ -196,19 +196,18 @@ See Also -------- + quad: adaptive quadrature using QUADPACK + romberg: adaptive Romberg quadrature + quadrature: adaptive Gaussian quadrature + fixed_quad: fixed-order Gaussian quadrature + dblquad: double integrals + tplquad: triple integrals + romb: integrators for sampled data + trapz: integrators for sampled data + cumtrapz: cumulative integration for sampled data + ode: ODE integrators + odeint: ODE integrators - quad: adaptive quadrature using QUADPACK - romberg: adaptive Romberg quadrature - quadrature: adaptive Gaussian quadrature - fixed_quad: fixed-order Gaussian quadrature - dblquad: double integrals - tplquad: triple integrals - romb: integrators for sampled data - trapz: integrators for sampled data - cumtrapz: cumulative integration for sampled data - ode: ODE integrators - odeint: ODE integrators - """ y = asarray(y) if x is None: @@ -359,41 +358,37 @@ def romb(y, dx=1.0, axis=-1, show=False): """ - Romberg integration using samples of a function + Romberg integration using samples of a function. Parameters ----------- - y : array like - a vector of 2**k + 1 equally-spaced samples of a function - - dx : array like - the sample spacing. - - axis : array like? - the axis along which to integrate - - show : Boolean - When y is a single 1-d array, then if this argument is True + y : array_like + A vector of ``2**k + 1`` equally-spaced samples of a function. + dx : array_like, optional + The sample spacing. Default is 1. + axis : array_like?, optional + The axis along which to integrate. Default is -1 (last axis). + show : bool, optional + When y is a single 1-D array, then if this argument is True print the table showing Richardson extrapolation from the - samples. + samples. Default is False. Returns - ----------- + ------- + ret : array_like? + The integrated result for each axis. - ret : array_like? - The integrated result for each axis. + See also + -------- + quad - adaptive quadrature using QUADPACK + romberg - adaptive Romberg quadrature + quadrature - adaptive Gaussian quadrature + fixed_quad - fixed-order Gaussian quadrature + dblquad, tplquad - double and triple integrals + simps, trapz - integrators for sampled data + cumtrapz - cumulative integration for sampled data + ode, odeint - ODE integrators - See also: - - quad - adaptive quadrature using QUADPACK - romberg - adaptive Romberg quadrature - quadrature - adaptive Gaussian quadrature - fixed_quad - fixed-order Gaussian quadrature - dblquad, tplquad - double and triple integrals - simps, trapz - integrators for sampled data - cumtrapz - cumulative integration for sampled data - ode, odeint - ODE integrators - """ y = asarray(y) nd = len(y.shape) @@ -570,7 +565,7 @@ Examples -------- - Integrate a gaussian from 0,1 and compare to the error function. + Integrate a gaussian from 0 to 1 and compare to the error function. >>> from scipy.special import erf >>> gaussian = lambda x: 1/np.sqrt(np.pi) * np.exp(-x**2) @@ -686,7 +681,7 @@ 1275983280000) } -def newton_cotes(rn,equal=0): +def newton_cotes(rn, equal=0): """ Return weights and error coefficient for Newton-Cotes integration. @@ -705,22 +700,20 @@ Parameters ---------- - rn : int - The integer order for equally-spaced data - or the relative positions of the samples with - the first sample at 0 and the last at N, where - N+1 is the length of rn. N is the order of the Newton + The integer order for equally-spaced data or the relative positions of + the samples with the first sample at 0 and the last at N, where N+1 is + the length of `rn`. N is the order of the Newton-Cotes integration. equal: int, optional - Set to 1 to enforce equally spaced data + Set to 1 to enforce equally spaced data. Returns ------- - an : array - 1-d array of weights to apply to the function at - the provided sample positions. - B : float - error coefficient + an : ndarray + 1-D array of weights to apply to the function at the provided sample + positions. + B : float + Error coefficient. Notes ----- From scipy-svn at scipy.org Fri Sep 24 03:48:33 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Fri, 24 Sep 2010 02:48:33 -0500 (CDT) Subject: [Scipy-svn] r6822 - trunk/scipy/interpolate Message-ID: <20100924074833.2D1E239CC3F@scipy.org> Author: rgommers Date: 2010-09-24 02:48:32 -0500 (Fri, 24 Sep 2010) New Revision: 6822 Modified: trunk/scipy/interpolate/fitpack.py trunk/scipy/interpolate/fitpack2.py trunk/scipy/interpolate/interpolate.py Log: DOC: merge wiki edits for interpolate module. Modified: trunk/scipy/interpolate/fitpack.py =================================================================== --- trunk/scipy/interpolate/fitpack.py 2010-09-23 15:27:54 UTC (rev 6821) +++ trunk/scipy/interpolate/fitpack.py 2010-09-24 07:48:32 UTC (rev 6822) @@ -105,83 +105,101 @@ def splprep(x,w=None,u=None,ub=None,ue=None,k=3,task=0,s=None,t=None, full_output=0,nest=None,per=0,quiet=1): - """Find the B-spline representation of an N-dimensional curve. + """ + Find the B-spline representation of an N-dimensional curve. - Description: + Given a list of N rank-1 arrays, x, which represent a curve in + N-dimensional space parametrized by u, find a smooth approximating + spline curve g(u). Uses the FORTRAN routine parcur from FITPACK. - Given a list of N rank-1 arrays, x, which represent a curve in N-dimensional - space parametrized by u, find a smooth approximating spline curve g(u). - Uses the FORTRAN routine parcur from FITPACK - - Inputs: - - x -- A list of sample vector arrays representing the curve. - u -- An array of parameter values. If not given, these values are - calculated automatically as (M = len(x[0])): + Parameters + ---------- + x : array_like + A list of sample vector arrays representing the curve. + u : array_like, optional + An array of parameter values. If not given, these values are + calculated automatically as ``M = len(x[0])``: v[0] = 0 v[i] = v[i-1] + distance(x[i],x[i-1]) u[i] = v[i] / v[M-1] - ub, ue -- The end-points of the parameters interval. Defaults to - u[0] and u[-1]. - k -- Degree of the spline. Cubic splines are recommended. Even values of - k should be avoided especially with a small s-value. - 1 <= k <= 5. - task -- If task==0 find t and c for a given smoothing factor, s. - If task==1 find t and c for another value of the smoothing factor, - s. There must have been a previous call with task=0 or task=1 - for the same set of data. - If task=-1 find the weighted least square spline for a given set of - knots, t. - s -- A smoothing condition. The amount of smoothness is determined by - satisfying the conditions: sum((w * (y - g))**2,axis=0) <= s where - g(x) is the smoothed interpolation of (x,y). The user can use s to - control the tradeoff between closeness and smoothness of fit. Larger - s means more smoothing while smaller values of s indicate less - smoothing. Recommended values of s depend on the weights, w. If the - weights represent the inverse of the standard-deviation of y, then a - good s value should be found in the range (m-sqrt(2*m),m+sqrt(2*m)) - where m is the number of datapoints in x, y, and w. - t -- The knots needed for task=-1. - full_output -- If non-zero, then return optional outputs. - nest -- An over-estimate of the total number of knots of the spline to - help in determining the storage space. By default nest=m/2. - Always large enough is nest=m+k+1. - per -- If non-zero, data points are considered periodic with period - x[m-1] - x[0] and a smooth periodic spline approximation is returned. - Values of y[m-1] and w[m-1] are not used. - quiet -- Non-zero to suppress messages. + ub, ue : int, optional + The end-points of the parameters interval. Defaults to + u[0] and u[-1]. + k : int, optional + Degree of the spline. Cubic splines are recommended. + Even values of `k` should be avoided especially with a small s-value. + ``1 <= k <= 5``, default is 3. + task : int, optional + If task==0 (default), find t and c for a given smoothing factor, s. + If task==1, find t and c for another value of the smoothing factor, s. + There must have been a previous call with task=0 or task=1 + for the same set of data. + If task=-1 find the weighted least square spline for a given set of + knots, t. + s : float, optional + A smoothing condition. + The amount of smoothness is determined by + satisfying the conditions: ``sum((w * (y - g))**2,axis=0) <= s``, + where g(x) is the smoothed interpolation of (x,y). The user can + use `s` to control the trade-off between closeness and smoothness + of fit. Larger `s` means more smoothing while smaller values of `s` + indicate less smoothing. Recommended values of `s` depend on the + weights, w. If the weights represent the inverse of the + standard-deviation of y, then a good `s` value should be found in + the range ``(m-sqrt(2*m),m+sqrt(2*m))``, where m is the number of + data points in x, y, and w. + t : int, optional + The knots needed for task=-1. + full_output : int, optional + If non-zero, then return optional outputs. + nest : int, optional + An over-estimate of the total number of knots of the spline to + help in determining the storage space. By default nest=m/2. + Always large enough is nest=m+k+1. + per : int, optional + If non-zero, data points are considered periodic with period + x[m-1] - x[0] and a smooth periodic spline approximation is returned. + Values of y[m-1] and w[m-1] are not used. + quiet : int, optional + Non-zero to suppress messages. - Outputs: (tck, u, {fp, ier, msg}) + Returns + ------- + tck : tuple + A tuple (t,c,k) containing the vector of knots, the B-spline + coefficients, and the degree of the spline. + u : array + An array of the values of the parameter. + fp : float + The weighted sum of squared residuals of the spline approximation. + ier : int + An integer flag about splrep success. Success is indicated + if ier<=0. If ier in [1,2,3] an error occurred but was not raised. + Otherwise an error is raised. + msg : str + A message corresponding to the integer flag, ier. - tck -- (t,c,k) a tuple containing the vector of knots, the B-spline - coefficients, and the degree of the spline. - u -- An array of the values of the parameter. + See Also + -------- + splrep, splev, sproot, spalde, splint, + bisplrep, bisplev + UnivariateSpline, BivariateSpline - fp -- The weighted sum of squared residuals of the spline approximation. - ier -- An integer flag about splrep success. Success is indicated - if ier<=0. If ier in [1,2,3] an error occurred but was not raised. - Otherwise an error is raised. - msg -- A message corresponding to the integer flag, ier. + Notes + ----- + See `splev` for evaluation of the spline and its derivatives. - Remarks: + References + ---------- + .. [1] P. Dierckx, "Algorithms for smoothing data with periodic and + parametric splines, Computer Graphics and Image Processing", + 20 (1982) 171-184. + .. [2] P. Dierckx, "Algorithms for smoothing data with periodic and + parametric splines", report tw55, Dept. Computer Science, + K.U.Leuven, 1981. + .. [3] P. Dierckx, "Curve and surface fitting with splines", Monographs on + Numerical Analysis, Oxford University Press, 1993. - SEE splev for evaluation of the spline and its derivatives. - - See also: - splrep, splev, sproot, spalde, splint - evaluation, roots, integral - bisplrep, bisplev - bivariate splines - UnivariateSpline, BivariateSpline - an alternative wrapping - of the FITPACK functions - - Notes: - Dierckx P. : Algorithms for smoothing data with periodic and - parametric splines, Computer Graphics and Image - Processing 20 (1982) 171-184. - Dierckx P. : Algorithms for smoothing data with periodic and param- - etric splines, report tw55, Dept. Computer Science, - K.U.Leuven, 1981. - Dierckx P. : Curve and surface fitting with splines, Monographs on - Numerical Analysis, Oxford University Press, 1993. """ if task<=0: _parcur_cache = {'t': array([],float), 'wrk': array([],float), @@ -264,98 +282,116 @@ 'iwrk':array([],int32)} def splrep(x,y,w=None,xb=None,xe=None,k=3,task=0,s=None,t=None, full_output=0,per=0,quiet=1): - """Find the B-spline representation of 1-D curve. + """ + Find the B-spline representation of 1-D curve. - Description: + Given the set of data points (x[i], y[i]) determine a smooth spline + approximation of degree k on the interval xb <= x <= xe. The coefficients, + c, and the knot points, t, are returned. Uses the FORTRAN routine + curfit from FITPACK. - Given the set of data points (x[i], y[i]) determine a smooth spline - approximation of degree k on the interval xb <= x <= xe. The coefficients, - c, and the knot points, t, are returned. Uses the FORTRAN routine - curfit from FITPACK. + Parameters + ---------- + x, y : array_like + The data points defining a curve y = f(x). + w : array_like + Strictly positive rank-1 array of weights the same length as x and y. + The weights are used in computing the weighted least-squares spline + fit. If the errors in the y values have standard-deviation given by the + vector d, then w should be 1/d. Default is ones(len(x)). + xb, xe : float + The interval to fit. If None, these default to x[0] and x[-1] + respectively. + k : int + The order of the spline fit. It is recommended to use cubic splines. + Even order splines should be avoided especially with small s values. + 1 <= k <= 5 + task : {1, 0, -1} + If task==0 find t and c for a given smoothing factor, s. - Inputs: + If task==1 find t and c for another value of the smoothing factor, s. + There must have been a previous call with task=0 or task=1 for the same + set of data (t will be stored an used internally) - x, y -- The data points defining a curve y = f(x). - w -- Strictly positive rank-1 array of weights the same length as x and y. - The weights are used in computing the weighted least-squares spline - fit. If the errors in the y values have standard-deviation given by the - vector d, then w should be 1/d. Default is ones(len(x)). - xb, xe -- The interval to fit. If None, these default to x[0] and x[-1] - respectively. - k -- The order of the spline fit. It is recommended to use cubic splines. - Even order splines should be avoided especially with small s values. - 1 <= k <= 5 - task -- If task==0 find t and c for a given smoothing factor, s. - If task==1 find t and c for another value of the - smoothing factor, s. There must have been a previous - call with task=0 or task=1 for the same set of data - (t will be stored an used internally) - If task=-1 find the weighted least square spline for - a given set of knots, t. These should be interior knots - as knots on the ends will be added automatically. - s -- A smoothing condition. The amount of smoothness is determined by - satisfying the conditions: sum((w * (y - g))**2,axis=0) <= s where - g(x) is the smoothed interpolation of (x,y). The user can use s to - control the tradeoff between closeness and smoothness of fit. Larger - s means more smoothing while smaller values of s indicate less - smoothing. Recommended values of s depend on the weights, w. If the - weights represent the inverse of the standard-deviation of y, then a - good s value should be found in the range (m-sqrt(2*m),m+sqrt(2*m)) - where m is the number of datapoints in x, y, and w. - default : s=m-sqrt(2*m) if weights are supplied. - s = 0.0 (interpolating) if no weights are supplied. - t -- The knots needed for task=-1. If given then task is automatically - set to -1. - full_output -- If non-zero, then return optional outputs. - per -- If non-zero, data points are considered periodic with period - x[m-1] - x[0] and a smooth periodic spline approximation is returned. - Values of y[m-1] and w[m-1] are not used. - quiet -- Non-zero to suppress messages. + If task=-1 find the weighted least square spline for a given set of + knots, t. These should be interior knots as knots on the ends will be + added automatically. + s : float + A smoothing condition. The amount of smoothness is determined by + satisfying the conditions: sum((w * (y - g))**2,axis=0) <= s where g(x) + is the smoothed interpolation of (x,y). The user can use s to control + the tradeoff between closeness and smoothness of fit. Larger s means + more smoothing while smaller values of s indicate less smoothing. + Recommended values of s depend on the weights, w. If the weights + represent the inverse of the standard-deviation of y, then a good s + value should be found in the range (m-sqrt(2*m),m+sqrt(2*m)) where m is + the number of datapoints in x, y, and w. default : s=m-sqrt(2*m) if + weights are supplied. s = 0.0 (interpolating) if no weights are + supplied. + t : int + The knots needed for task=-1. If given then task is automatically set + to -1. + full_output : bool + If non-zero, then return optional outputs. + per : bool + If non-zero, data points are considered periodic with period x[m-1] - + x[0] and a smooth periodic spline approximation is returned. Values of + y[m-1] and w[m-1] are not used. + quiet : bool + Non-zero to suppress messages. - Outputs: (tck, {fp, ier, msg}) + Returns + ------- + tck : tuple + (t,c,k) a tuple containing the vector of knots, the B-spline + coefficients, and the degree of the spline. + fp : array, optional + The weighted sum of squared residuals of the spline approximation. + ier : int, optional + An integer flag about splrep success. Success is indicated if ier<=0. + If ier in [1,2,3] an error occurred but was not raised. Otherwise an + error is raised. + msg : str, optional + A message corresponding to the integer flag, ier. - tck -- (t,c,k) a tuple containing the vector of knots, the B-spline - coefficients, and the degree of the spline. + Notes + ----- - fp -- The weighted sum of squared residuals of the spline approximation. - ier -- An integer flag about splrep success. Success is indicated if - ier<=0. If ier in [1,2,3] an error occurred but was not raised. - Otherwise an error is raised. - msg -- A message corresponding to the integer flag, ier. + See splev for evaluation of the spline and its derivatives. - Remarks: + See Also + -------- - See splev for evaluation of the spline and its derivatives. + UnivariateSpline, BivariateSpline + splprep, splev, sproot, spalde, splint + bisplrep, bisplev - Example: + References + ---------- - x = linspace(0, 10, 10) - y = sin(x) - tck = splrep(x, y) - x2 = linspace(0, 10, 200) - y2 = splev(x2, tck) - plot(x, y, 'o', x2, y2) + Based on algorithms described in [1], [2], [3], and [4]: - See also: - splprep, splev, sproot, spalde, splint - evaluation, roots, integral - bisplrep, bisplev - bivariate splines - UnivariateSpline, BivariateSpline - an alternative wrapping - of the FITPACK functions + .. [1] P. Dierckx, "An algorithm for smoothing, differentiation and + integration of experimental data using spline functions", + J.Comp.Appl.Maths 1 (1975) 165-184. + .. [2] P. Dierckx, "A fast algorithm for smoothing data on a rectangular + grid while using spline functions", SIAM J.Numer.Anal. 19 (1982) + 1286-1304. + .. [3] P. Dierckx, "An improved algorithm for curve fitting with spline + functions", report tw54, Dept. Computer Science,K.U. Leuven, 1981. + .. [4] P. Dierckx, "Curve and surface fitting with splines", Monographs on + Numerical Analysis, Oxford University Press, 1993. - Notes: + Examples + -------- - Based on algorithms described in: - Dierckx P. : An algorithm for smoothing, differentiation and integ- - ration of experimental data using spline functions, - J.Comp.Appl.Maths 1 (1975) 165-184. - Dierckx P. : A fast algorithm for smoothing data on a rectangular - grid while using spline functions, SIAM J.Numer.Anal. - 19 (1982) 1286-1304. - Dierckx P. : An improved algorithm for curve fitting with spline - functions, report tw54, Dept. Computer Science,K.U. - Leuven, 1981. - Dierckx P. : Curve and surface fitting with splines, Monographs on - Numerical Analysis, Oxford University Press, 1993. + >>> x = linspace(0, 10, 10) + >>> y = sin(x) + >>> tck = splrep(x, y) + >>> x2 = linspace(0, 10, 200) + >>> y2 = splev(x2, tck) + >>> plot(x, y, 'o', x2, y2) + """ if task<=0: _curfit_cache = {} @@ -432,21 +468,22 @@ #return l[0] def splev(x, tck, der=0, ext=0): - """Evaluate a B-spline or its derivatives. + """ + Evaluate a B-spline or its derivatives. Given the knots and coefficients of a B-spline representation, evaluate - the value of the smoothing polynomial and it's derivatives. This is a + the value of the smoothing polynomial and its derivatives. This is a wrapper around the FORTRAN routines splev and splder of FITPACK. Parameters ---------- x : array_like A 1-D array of points at which to return the value of the smoothed - spline or its derivatives. If tck was returned from splprep, then - the parameter values, u should be given. + spline or its derivatives. If `tck` was returned from `splprep`, + then the parameter values, u should be given. tck : tuple - A sequence of length 3 returned by splrep or splprep containg the - knots, coefficients, and degree of the spline. + A sequence of length 3 returned by `splrep` or `splprep` containing + the knots, coefficients, and degree of the spline. der : int The order of derivative of the spline to compute (must be less than or equal to k). @@ -464,15 +501,13 @@ ------- y : ndarray or list of ndarrays An array of values representing the spline function evaluated at - the points in ``x``. If tck was returned from splrep, then this is - a list of arrays representing the curve in N-dimensional space. + the points in ``x``. If `tck` was returned from splrep, then this + is a list of arrays representing the curve in N-dimensional space. See Also -------- - splprep, splrep, sproot, spalde, splint : evaluation, roots, integral - bisplrep, bisplev : bivariate splines - UnivariateSpline, BivariateSpline : - An alternative wrapping of the FITPACK functions. + splprep, splrep, sproot, spalde, splint + bisplrep, bisplev References ---------- @@ -519,23 +554,27 @@ Parameters ---------- - a, b -- The end-points of the integration interval. - tck -- A length 3 sequence describing the given spline (See splev). - full_output -- Non-zero to return optional output. + a, b : float + The end-points of the integration interval. + tck : tuple + A tuple (t,c,k) containing the vector of knots, the B-spline + coefficients, and the degree of the spline (see `splev`). + full_output : int, optional + Non-zero to return optional output. Returns ------- - integral -- The resulting integral. + integral : float + The resulting integral. + wrk : ndarray + An array containing the integrals of the normalized B-splines + defined on the set of knots. - wrk -- An array containing the integrals of the - normalized B-splines defined on the set of knots. - See Also -------- - splprep, splrep, sproot, spalde, splev : evaluation, roots, integral - bisplrep, bisplev : bivariate splines - UnivariateSpline, BivariateSpline : - An alternative wrapping of the FITPACK functions. + splprep, splrep, sproot, spalde, splev + bisplrep, bisplev + UnivariateSpline, BivariateSpline References ---------- @@ -567,28 +606,26 @@ Parameters ---------- + tck : tuple + A tuple (t,c,k) containing the vector of knots, + the B-spline coefficients, and the degree of the spline. + The number of knots must be >= 8. + The knots must be a montonically increasing sequence. + mest : int + An estimate of the number of zeros (Default is 10). - tck -- A length 3 sequence describing the given spline (See splev). - The number of knots must be >= 8. The knots must be a montonically - increasing sequence. - - mest -- An estimate of the number of zeros (Default is 10) - - Returns ------- + zeros : ndarray + An array giving the roots of the spline. - zeros -- An array giving the roots of the spline. - See also -------- - splprep, splrep, splint, spalde, splev : - evaluation, roots, integral - bisplrep, bisplev : - bivariate splines - UnivariateSpline, BivariateSpline : - An alternative wrapping of the FITPACK functions. + splprep, splrep, splint, spalde, splev + bisplrep, bisplev + UnivariateSpline, BivariateSpline + References ---------- .. [1] C. de Boor, "On calculating with b-splines", J. Approximation @@ -622,37 +659,41 @@ raise TypeError,"Unknown error" def spalde(x,tck): - """Evaluate all derivatives of a B-spline. + """ + Evaluate all derivatives of a B-spline. - Description: + Given the knots and coefficients of a cubic B-spline compute all + derivatives up to order k at a point (or set of points). - Given the knots and coefficients of a cubic B-spline compute all - derivatives up to order k at a point (or set of points). + Parameters + ---------- + tck : tuple + A tuple (t,c,k) containing the vector of knots, + the B-spline coefficients, and the degree of the spline. + x : array_like + A point or a set of points at which to evaluate the derivatives. + Note that ``t(k) <= x <= t(n-k+1)`` must hold for each `x`. - Inputs: + Returns + ------- + results : array_like + An array (or a list of arrays) containing all derivatives + up to order k inclusive for each point x. - tck -- A length 3 sequence describing the given spline (See splev). - x -- A point or a set of points at which to evaluate the derivatives. - Note that t(k) <= x <= t(n-k+1) must hold for each x. + See Also + -------- + splprep, splrep, splint, sproot, splev, bisplrep, bisplev, + UnivariateSpline, BivariateSpline - Outputs: (results, ) + References + ---------- + .. [1] de Boor C : On calculating with b-splines, J. Approximation Theory + 6 (1972) 50-62. + .. [2] Cox M.G. : The numerical evaluation of b-splines, J. Inst. Maths + applics 10 (1972) 134-149. + .. [3] Dierckx P. : Curve and surface fitting with splines, Monographs on + Numerical Analysis, Oxford University Press, 1993. - results -- An array (or a list of arrays) containing all derivatives - up to order k inclusive for each point x. - - See also: - splprep, splrep, splint, sproot, splev - evaluation, roots, integral - bisplrep, bisplev - bivariate splines - UnivariateSpline, BivariateSpline - an alternative wrapping - of the FITPACK functions - Notes: - Based on algorithms from: - de Boor C : On calculating with b-splines, J. Approximation Theory - 6 (1972) 50-62. - Cox M.G. : The numerical evaluation of b-splines, J. Inst. Maths - applics 10 (1972) 134-149. - Dierckx P. : Curve and surface fitting with splines, Monographs on - Numerical Analysis, Oxford University Press, 1993. """ t,c,k=tck try: @@ -680,73 +721,89 @@ def bisplrep(x,y,z,w=None,xb=None,xe=None,yb=None,ye=None,kx=3,ky=3,task=0, s=None,eps=1e-16,tx=None,ty=None,full_output=0, nxest=None,nyest=None,quiet=1): - """Find a bivariate B-spline representation of a surface. + """ + Find a bivariate B-spline representation of a surface. - Description: + Given a set of data points (x[i], y[i], z[i]) representing a surface + z=f(x,y), compute a B-spline representation of the surface. Based on + the routine SURFIT from FITPACK. - Given a set of data points (x[i], y[i], z[i]) representing a surface - z=f(x,y), compute a B-spline representation of the surface. Based on - the routine SURFIT from FITPACK. + Parameters + ---------- + x, y, z : ndarray + Rank-1 arrays of data points. + w : ndarray, optional + Rank-1 array of weights. By default ``w=np.ones(len(x))``. + xb, xe : float, optional + End points of approximation interval in `x`. + By default ``xb = x.min(), xe=x.max()``. + yb, ye : float, optional + End points of approximation interval in `y`. + By default ``yb=y.min(), ye = y.max()``. + kx, ky : int, optional + The degrees of the spline (1 <= kx, ky <= 5). + Third order (kx=ky=3) is recommended. + task : int, optional + If task=0, find knots in x and y and coefficients for a given + smoothing factor, s. + If task=1, find knots and coefficients for another value of the + smoothing factor, s. bisplrep must have been previously called + with task=0 or task=1. + If task=-1, find coefficients for a given set of knots tx, ty. + s : float, optional + A non-negative smoothing factor. If weights correspond + to the inverse of the standard-deviation of the errors in z, + then a good s-value should be found in the range + ``(m-sqrt(2*m),m+sqrt(2*m))`` where m=len(x). + eps : float, optional + A threshold for determining the effective rank of an + over-determined linear system of equations (0 < eps < 1). + `eps` is not likely to need changing. + tx, ty : ndarray, optional + Rank-1 arrays of the knots of the spline for task=-1 + full_output : int, optional + Non-zero to return optional outputs. + nxest, nyest : int, optional + Over-estimates of the total number of knots. If None then + ``nxest = max(kx+sqrt(m/2),2*kx+3)``, + ``nyest = max(ky+sqrt(m/2),2*ky+3)``. + quiet : int, optional + Non-zero to suppress printing of messages. - Inputs: + Returns + ------- + tck : array_like + A list [tx, ty, c, kx, ky] containing the knots (tx, ty) and + coefficients (c) of the bivariate B-spline representation of the + surface along with the degree of the spline. + fp : ndarray + The weighted sum of squared residuals of the spline approximation. + ier : int + An integer flag about splrep success. Success is indicated if + ier<=0. If ier in [1,2,3] an error occurred but was not raised. + Otherwise an error is raised. + msg : str + A message corresponding to the integer flag, ier. - x, y, z -- Rank-1 arrays of data points. - w -- Rank-1 array of weights. By default w=ones(len(x)). - xb, xe -- End points of approximation interval in x. - yb, ye -- End points of approximation interval in y. - By default xb, xe, yb, ye = x.min(), x.max(), y.min(), y.max() - kx, ky -- The degrees of the spline (1 <= kx, ky <= 5). Third order - (kx=ky=3) is recommended. - task -- If task=0, find knots in x and y and coefficients for a given - smoothing factor, s. - If task=1, find knots and coefficients for another value of the - smoothing factor, s. bisplrep must have been previously called - with task=0 or task=1. - If task=-1, find coefficients for a given set of knots tx, ty. - s -- A non-negative smoothing factor. If weights correspond - to the inverse of the standard-deviation of the errors in z, - then a good s-value should be found in the range - (m-sqrt(2*m),m+sqrt(2*m)) where m=len(x) - eps -- A threshold for determining the effective rank of an - over-determined linear system of equations (0 < eps < 1) - --- not likely to need changing. - tx, ty -- Rank-1 arrays of the knots of the spline for task=-1 - full_output -- Non-zero to return optional outputs. - nxest, nyest -- Over-estimates of the total number of knots. - If None then nxest = max(kx+sqrt(m/2),2*kx+3), - nyest = max(ky+sqrt(m/2),2*ky+3) - quiet -- Non-zero to suppress printing of messages. + See Also + -------- + splprep, splrep, splint, sproot, splev + UnivariateSpline, BivariateSpline - Outputs: (tck, {fp, ier, msg}) + Notes + ----- + See `bisplev` to evaluate the value of the B-spline given its tck + representation. - tck -- A list [tx, ty, c, kx, ky] containing the knots (tx, ty) and - coefficients (c) of the bivariate B-spline representation of the - surface along with the degree of the spline. + References + ---------- + .. [1] Dierckx P.:An algorithm for surface fitting with spline functions + Ima J. Numer. Anal. 1 (1981) 267-283. + .. [2] Dierckx P.:An algorithm for surface fitting with spline functions + report tw50, Dept. Computer Science,K.U.Leuven, 1980. + .. [3] Dierckx P.:Curve and surface fitting with splines, Monographs on + Numerical Analysis, Oxford University Press, 1993. - fp -- The weighted sum of squared residuals of the spline approximation. - ier -- An integer flag about splrep success. Success is indicated if - ier<=0. If ier in [1,2,3] an error occurred but was not raised. - Otherwise an error is raised. - msg -- A message corresponding to the integer flag, ier. - - Remarks: - - SEE bisplev to evaluate the value of the B-spline given its tck - representation. - - See also: - splprep, splrep, splint, sproot, splev - evaluation, roots, integral - UnivariateSpline, BivariateSpline - an alternative wrapping - of the FITPACK functions - - Notes: - Based on algorithms from: - Dierckx P. : An algorithm for surface fitting with spline functions - Ima J. Numer. Anal. 1 (1981) 267-283. - Dierckx P. : An algorithm for surface fitting with spline functions - report tw50, Dept. Computer Science,K.U.Leuven, 1980. - Dierckx P. : Curve and surface fitting with splines, Monographs on - Numerical Analysis, Oxford University Press, 1993. """ x,y,z=map(myasarray,[x,y,z]) x,y,z=map(ravel,[x,y,z]) # ensure 1-d arrays. @@ -827,46 +884,52 @@ return tck def bisplev(x,y,tck,dx=0,dy=0): - """Evaluate a bivariate B-spline and its derivatives. + """ + Evaluate a bivariate B-spline and its derivatives. - Description: + Return a rank-2 array of spline function values (or spline derivative + values) at points given by the cross-product of the rank-1 arrays x and + y. In special cases, return an array or just a float if either x or y or + both are floats. Based on BISPEV from FITPACK. - Return a rank-2 array of spline function values (or spline derivative - values) at points given by the cross-product of the rank-1 arrays x and y. - In special cases, return an array or just a float if either x or y or - both are floats. Based on BISPEV from FITPACK. + Parameters + ---------- + x, y : ndarray + Rank-1 arrays specifying the domain over which to evaluate the + spline or its derivative. + tck : tuple + A sequence of length 5 returned by `bisplrep` containing the knot + locations, the coefficients, and the degree of the spline: + [tx, ty, c, kx, ky]. + dx, dy : int, optional + The orders of the partial derivatives in `x` and `y` respectively. - Inputs: + Returns + ------- + vals : ndarray + The B-spline or its derivative evaluated over the set formed by + the cross-product of `x` and `y`. - x, y -- Rank-1 arrays specifying the domain over which to evaluate the - spline or its derivative. - tck -- A sequence of length 5 returned by bisplrep containing the knot - locations, the coefficients, and the degree of the spline: - [tx, ty, c, kx, ky]. - dx, dy -- The orders of the partial derivatives in x and y respectively. + See Also + -------- + splprep, splrep, splint, sproot, splev + UnivariateSpline, BivariateSpline - Outputs: (vals, ) + Notes + ----- + See `bisplrep` to generate the `tck` representation. - vals -- The B-pline or its derivative evaluated over the set formed by - the cross-product of x and y. + References + ---------- + .. [1] Dierckx P. : An algorithm for surface fitting + with spline functions + Ima J. Numer. Anal. 1 (1981) 267-283. + .. [2] Dierckx P. : An algorithm for surface fitting + with spline functions + report tw50, Dept. Computer Science,K.U.Leuven, 1980. + .. [3] Dierckx P. : Curve and surface fitting with splines, + Monographs on Numerical Analysis, Oxford University Press, 1993. - Remarks: - - SEE bisprep to generate the tck representation. - - See also: - splprep, splrep, splint, sproot, splev - evaluation, roots, integral - UnivariateSpline, BivariateSpline - an alternative wrapping - of the FITPACK functions - - Notes: - Based on algorithms from: - Dierckx P. : An algorithm for surface fitting with spline functions - Ima J. Numer. Anal. 1 (1981) 267-283. - Dierckx P. : An algorithm for surface fitting with spline functions - report tw50, Dept. Computer Science,K.U.Leuven, 1980. - Dierckx P. : Curve and surface fitting with splines, Monographs on - Numerical Analysis, Oxford University Press, 1993. """ tx,ty,c,kx,ky=tck if not (0<=dx>> from numpy import linspace,exp >>> from numpy.random import randn >>> from scipy.interpolate import UnivariateSpline - >>> x = linspace(-3,3,100) + >>> x = linspace(-3, 3, 100) >>> y = exp(-x**2) + randn(100)/10 - >>> s = UnivariateSpline(x,y,s=1) - >>> xs = linspace(-3,3,1000) + >>> s = UnivariateSpline(x, y, s=1) + >>> xs = linspace(-3, 3, 1000) >>> ys = s(xs) - xs,ys is now a smoothed, super-sampled version of the noisy gaussian x,y + xs,ys is now a smoothed, super-sampled version of the noisy gaussian x,y. """ @@ -272,26 +273,25 @@ """ One-dimensional interpolating spline for a given set of data points. - Fits a spline y=s(x) of degree `k` to the provided `x`,`y` data. Spline + Fits a spline y=s(x) of degree `k` to the provided `x`, `y` data. Spline function passes through all provided points. Equivalent to `UnivariateSpline` with s=0. Parameters ---------- - x : sequence + x : array_like input dimension of data points -- must be increasing - y : sequence - input dimension of data points - w : sequence or None, optional - weights for spline fitting. Must be positive. If None (default), + y : array_like + input dimension of data points + w : array_like, optional + Weights for spline fitting. Must be positive. If None (default), weights are all equal. - bbox : sequence or None, optional + bbox : array_like, optional 2-sequence specifying the boundary of the approximation interval. If None (default), bbox=[x[0],x[-1]]. k : int, optional Degree of the smoothing spline. Must be <= 5. - See Also -------- UnivariateSpline : Superclass -- allows knots to be selected by a @@ -301,17 +301,19 @@ splev, sproot, splint, spalde BivariateSpline : A similar class for two-dimensional spline interpolation + Notes + ----- + The number of data points must be larger than the spline degree `k`. - Examples -------- >>> from numpy import linspace,exp >>> from numpy.random import randn >>> from scipy.interpolate import UnivariateSpline - >>> x = linspace(-3,3,100) + >>> x = linspace(-3, 3, 100) >>> y = exp(-x**2) + randn(100)/10 - >>> s = UnivariateSpline(x,y,s=1) - >>> xs = linspace(-3,3,1000) + >>> s = UnivariateSpline(x, y, s=1) + >>> xs = linspace(-3, 3, 1000) >>> ys = s(xs) xs,ys is now a smoothed, super-sampled version of the noisy gaussian x,y @@ -340,22 +342,22 @@ """ One-dimensional spline with explicit internal knots. - Fits a spline y=s(x) of degree `k` to the provided `x`,`y` data. `t` + Fits a spline y=s(x) of degree `k` to the provided `x`, `y` data. `t` specifies the internal knots of the spline Parameters ---------- - x : sequence + x : array_like input dimension of data points -- must be increasing - y : sequence + y : array_like input dimension of data points - t: sequence + t: array_like interior knots of the spline. Must be in ascending order and bbox[0]>> from numpy import linspace,exp Modified: trunk/scipy/interpolate/interpolate.py =================================================================== --- trunk/scipy/interpolate/interpolate.py 2010-09-23 15:27:54 UTC (rev 6821) +++ trunk/scipy/interpolate/interpolate.py 2010-09-24 07:48:32 UTC (rev 6822) @@ -144,56 +144,69 @@ class interp1d(object): - """ Interpolate a 1D function. + """ + interp1d(x, y, kind='linear', axis=-1, copy=True, bounds_error=True, + fill_value=np.nan) + Interpolate a 1D function. + + `x` and `y` are arrays of values used to approximate some function f: + y = f(x) + This class returns a function whose call method uses linear interpolation + to find the value of new points. + + Parameters + ---------- + x : array_like + A 1-D array of monotonically increasing real values. + y : array_like + A N-D array of real values. The length of `y` along the interpolation + axis must be equal to the length of `x`. + kind : str or int, optional + Specifies the kind of interpolation as a string + ('linear','nearest', 'zero', 'slinear', 'quadratic, 'cubic') + or as an integer specifying the order of the spline interpolator + to use. Default is 'linear'. + axis : int, optional + Specifies the axis of `y` along which to interpolate. + Interpolation defaults to the last axis of `y`. + copy : bool, optional + If True, the class makes internal copies of x and y. + If False, references to `x` and `y` are used. The default is to copy. + bounds_error : bool, optional + If True, an error is thrown any time interpolation is attempted on + a value outside of the range of x (where extrapolation is + necessary). If False, out of bounds values are assigned `fill_value`. + By default, an error is raised. + fill_value : float, optional + If provided, then this value will be used to fill in for requested + points outside of the data range. If not provided, then the default + is NaN. + See Also -------- - splrep, splev - spline interpolation based on FITPACK - UnivariateSpline - a more recent wrapper of the FITPACK routines + UnivariateSpline : A more recent wrapper of the FITPACK routines. + splrep, splev + Spline interpolation based on FITPACK. + + Examples + -------- + >>> import scipy.interpolate + + >>> x = np.arange(0, 10) + >>> y = np.exp(-x/3.0) + >>> f = sp.interpolate.interp1d(x, y) + + >>> xnew = np.arange(0,9, 0.1) + >>> ynew = f(xnew) + >>> plt.plot(x, y, 'o', xnew, ynew, '-') + """ def __init__(self, x, y, kind='linear', axis=-1, copy=True, bounds_error=True, fill_value=np.nan): - """ Initialize a 1D linear interpolation class. + """ Initialize a 1D linear interpolation class.""" - Description - ----------- - x and y are arrays of values used to approximate some function f: - y = f(x) - This class returns a function whose call method uses linear - interpolation to find the value of new points. - - Parameters - ---------- - x : array - A 1D array of monotonically increasing real values. x cannot - include duplicate values (otherwise f is overspecified) - y : array - An N-D array of real values. y's length along the interpolation - axis must be equal to the length of x. - kind : str or int - Specifies the kind of interpolation as a string ('linear', - 'nearest', 'zero', 'slinear', 'quadratic, 'cubic') or as an integer - specifying the order of the spline interpolator to use. - axis : int - Specifies the axis of y along which to interpolate. Interpolation - defaults to the last axis of y. - copy : bool - If True, the class makes internal copies of x and y. - If False, references to x and y are used. - The default is to copy. - bounds_error : bool - If True, an error is thrown any time interpolation is attempted on - a value outside of the range of x (where extrapolation is - necessary). - If False, out of bounds values are assigned fill_value. - By default, an error is raised. - fill_value : float - If provided, then this value will be used to fill in for requested - points outside of the data range. - If not provided, then the default is NaN. - """ - self.copy = copy self.bounds_error = bounds_error self.fill_value = fill_value From scipy-svn at scipy.org Sat Sep 25 20:56:47 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 25 Sep 2010 19:56:47 -0500 (CDT) Subject: [Scipy-svn] r6823 - in trunk/scipy/optimize: . tests Message-ID: <20100926005647.7FD7439CD52@scipy.org> Author: warren.weckesser Date: 2010-09-25 19:56:47 -0500 (Sat, 25 Sep 2010) New Revision: 6823 Modified: trunk/scipy/optimize/minpack.py trunk/scipy/optimize/tests/test_minpack.py Log: BUG: optimize: stopping condition for the fixed_point function was missing 'abs' around relerr. Modified: trunk/scipy/optimize/minpack.py =================================================================== --- trunk/scipy/optimize/minpack.py 2010-09-24 07:48:32 UTC (rev 6822) +++ trunk/scipy/optimize/minpack.py 2010-09-26 00:56:47 UTC (rev 6823) @@ -3,7 +3,7 @@ from numpy import atleast_1d, dot, take, triu, shape, eye, \ transpose, zeros, product, greater, array, \ - all, where, isscalar, asarray, inf + all, where, isscalar, asarray, inf, abs error = _minpack.error @@ -480,7 +480,7 @@ d = p2 - 2.0 * p1 + p0 p = where(d == 0, p2, p0 - (p1 - p0)*(p1 - p0) / d) relerr = where(p0 == 0, p, (p-p0)/p0) - if all(relerr < xtol): + if all(abs(relerr) < xtol): return p p0 = p else: @@ -497,7 +497,7 @@ relerr = p else: relerr = (p - p0)/p0 - if relerr < xtol: + if abs(relerr) < xtol: return p p0 = p msg = "Failed to converge after %d iterations, value is %s" % (maxiter, p) Modified: trunk/scipy/optimize/tests/test_minpack.py =================================================================== --- trunk/scipy/optimize/tests/test_minpack.py 2010-09-24 07:48:32 UTC (rev 6822) +++ trunk/scipy/optimize/tests/test_minpack.py 2010-09-26 00:56:47 UTC (rev 6823) @@ -8,8 +8,9 @@ from numpy import array, float64 from scipy import optimize -from scipy.optimize.minpack import leastsq, curve_fit +from scipy.optimize.minpack import leastsq, curve_fit, fixed_point + class TestFSolve(object): def pressure_network(self, flow_rates, Qtot, k): """Evaluate non-linear equation system representing @@ -82,6 +83,7 @@ fprime=self.pressure_network_jacobian) assert_array_almost_equal(final_flows, np.ones(4)) + class TestLeastSq(TestCase): def setUp(self): x = np.linspace(0, 10, 40) @@ -123,6 +125,7 @@ assert_(ier in (1,2,3,4), 'solution not found: %s'%mesg) assert_array_equal(p0, p0_copy) + class TestCurveFit(TestCase): def setUp(self): self.y = array([1.0, 3.2, 9.5, 13.7]) @@ -147,7 +150,57 @@ assert_array_almost_equal(pcov, [[0.0852, -0.1260],[-0.1260, 0.1912]], decimal=4) +class TestFixedPoint(TestCase): + def text_scalar_trivial(self): + """f(x) = 2x; fixed point should be x=0""" + def func(x): + return 2.0*x + x0 = 1.0 + x = fixed_point(func, x0) + assert_almost_equal(x, 0.0) + def test_scalar_basic1(self): + """f(x) = x**2; x0=1.05; fixed point should be x=1""" + def func(x): + return x**2 + x0 = 1.05 + x = fixed_point(func, x0) + assert_almost_equal(x, 1.0) + + def test_scalar_basic2(self): + """f(x) = x**0.5; x0=1.05; fixed point should be x=1""" + def func(x): + return x**0.5 + x0 = 1.05 + x = fixed_point(func, x0) + assert_almost_equal(x, 1.0) + + def test_array_trivial(self): + def func(x): + return 2.0*x + x0 = [0.3, 0.15] + x = fixed_point(func, x0) + assert_almost_equal(x, [0.0, 0.0]) + + def test_array_basic1(self): + """f(x) = c * x**2; fixed point should be x=1/c""" + def func(x, c): + return c * x**2 + c = array([0.75, 1.0, 1.25]) + x0 = [1.1, 1.15, 0.9] + x = fixed_point(func, x0, args=(c,)) + assert_almost_equal(x, 1.0/c) + + def test_array_basic2(self): + """f(x) = c * x**0.5; fixed point should be x=c**2""" + def func(x, c): + return c * x**0.5 + c = array([0.75, 1.0, 1.25]) + x0 = [0.8, 1.1, 1.1] + x = fixed_point(func, x0, args=(c,)) + assert_almost_equal(x, c**2) + + if __name__ == "__main__": run_module_suite() From scipy-svn at scipy.org Sat Sep 25 22:48:28 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 25 Sep 2010 21:48:28 -0500 (CDT) Subject: [Scipy-svn] r6824 - in trunk/scipy/optimize: . tests Message-ID: <20100926024828.7EBE339CCFF@scipy.org> Author: warren.weckesser Date: 2010-09-25 21:48:28 -0500 (Sat, 25 Sep 2010) New Revision: 6824 Modified: trunk/scipy/optimize/minpack.py trunk/scipy/optimize/tests/test_minpack.py Log: BUG: optimize: AttributeError in check_func() in minpack.py (ticket #1287) Modified: trunk/scipy/optimize/minpack.py =================================================================== --- trunk/scipy/optimize/minpack.py 2010-09-26 00:56:47 UTC (rev 6823) +++ trunk/scipy/optimize/minpack.py 2010-09-26 02:48:28 UTC (rev 6824) @@ -9,15 +9,20 @@ __all__ = ['fsolve', 'leastsq', 'fixed_point', 'curve_fit'] -def check_func(thefunc, x0, args, numinputs, output_shape=None): - res = atleast_1d(thefunc(*((x0[:numinputs],)+args))) +def _check_func(checker, argname, thefunc, x0, args, numinputs, output_shape=None): + res = atleast_1d(thefunc(*((x0[:numinputs],) + args))) if (output_shape is not None) and (shape(res) != output_shape): if (output_shape[0] != 1): if len(output_shape) > 1: if output_shape[1] == 1: return shape(res) - msg = "There is a mismatch between the input and output " \ - "shape of %s." % thefunc.func_name + msg = "%s: there is a mismatch between the input and output " \ + "shape of the '%s' argument" % (checker, argname) + func_name = getattr(thefunc, 'func_name', None) + if func_name: + msg += " '%s'." % func_name + else: + msg += "." raise TypeError(msg) return shape(res) @@ -107,7 +112,8 @@ x0 = array(x0, ndmin=1) n = len(x0) if type(args) != type(()): args = (args,) - check_func(func, x0, args, n, (n,)) + _check_func('fsolve', 'func', func, x0, args, n, (n,)) + #check_func(func, x0, args, n, (n,)) Dfun = fprime if Dfun is None: if band is None: @@ -119,7 +125,8 @@ retval = _minpack._hybrd(func, x0, args, full_output, xtol, maxfev, ml, mu, epsfcn, factor, diag) else: - check_func(Dfun,x0,args,n,(n,n)) + _check_func('fsolve', 'fprime', Dfun, x0, args, n, (n,n)) + # check_func(Dfun,x0,args,n,(n,n)) if (maxfev == 0): maxfev = 100*(n + 1) retval = _minpack._hybrj(func, Dfun, x0, args, full_output, @@ -253,7 +260,8 @@ n = len(x0) if type(args) != type(()): args = (args,) - m = check_func(func, x0, args, n)[0] + m = _check_func('leastsq', 'func', func, x0, args, n)[0] + # m = check_func(func, x0, args, n)[0] if n > m: raise TypeError('Improper input: N=%s must not exceed M=%s' % (n,m)) if Dfun is None: @@ -263,9 +271,11 @@ gtol, maxfev, epsfcn, factor, diag) else: if col_deriv: - check_func(Dfun, x0, args, n, (n,m)) + _check_func('leastsq', 'Dfun', Dfun, x0, args, n, (n,m)) + # check_func(Dfun, x0, args, n, (n,m)) else: - check_func(Dfun, x0, args, n, (m,n)) + _check_func('leastsq', 'Dfun', Dfun, x0, args, n, (m,n)) + # check_func(Dfun, x0, args, n, (m,n)) if (maxfev == 0): maxfev = 100*(n + 1) retval = _minpack._lmder(func, Dfun, x0, args, full_output, col_deriv, Modified: trunk/scipy/optimize/tests/test_minpack.py =================================================================== --- trunk/scipy/optimize/tests/test_minpack.py 2010-09-26 00:56:47 UTC (rev 6823) +++ trunk/scipy/optimize/tests/test_minpack.py 2010-09-26 02:48:28 UTC (rev 6824) @@ -3,7 +3,7 @@ """ from numpy.testing import assert_, assert_almost_equal, assert_array_equal, \ - assert_array_almost_equal, TestCase, run_module_suite + assert_array_almost_equal, TestCase, run_module_suite, assert_raises import numpy as np from numpy import array, float64 @@ -11,6 +11,25 @@ from scipy.optimize.minpack import leastsq, curve_fit, fixed_point +class ReturnShape(object): + """This class exists to create a callable that does not have a 'func_name' attribute. + + __init__ takes the argument 'shape', which should be a tuple of ints. When an instance + it called with a single argument 'x', it returns numpy.ones(shape). + """ + def __init__(self, shape): + self.shape = shape + + def __call__(self, x): + return np.ones(self.shape) + +def dummy_func(x, shape): + """A function that returns an array of ones of the given shape. + `x` is ignored. + """ + return np.ones(shape) + + class TestFSolve(object): def pressure_network(self, flow_rates, Qtot, k): """Evaluate non-linear equation system representing @@ -83,7 +102,32 @@ fprime=self.pressure_network_jacobian) assert_array_almost_equal(final_flows, np.ones(4)) + def test_wrong_shape_func_callable(self): + """The callable 'func' has no 'func_name' attribute.""" + func = ReturnShape(1) + # x0 is a list of two elements, but func will return an array with + # length 1, so this should result in a TypeError. + x0 = [1.5, 2.0] + assert_raises(TypeError, optimize.fsolve, func, x0) + def test_wrong_shape_func_function(self): + # x0 is a list of two elements, but func will return an array with + # length 1, so this should result in a TypeError. + x0 = [1.5, 2.0] + assert_raises(TypeError, optimize.fsolve, dummy_func, x0, args=((1,),)) + + def test_wrong_shape_fprime_callable(self): + """The callables 'func' and 'deriv_func' have no 'func_name' attribute.""" + func = ReturnShape(1) + deriv_func = ReturnShape((2,2)) + assert_raises(TypeError, optimize.fsolve, func, x0=[0,1], fprime=deriv_func) + + def test_wrong_shape_fprime_function(self): + func = lambda x: dummy_func(x, (2,)) + deriv_func = lambda x: dummy_func(x, (3,3)) + assert_raises(TypeError, optimize.fsolve, func, x0=[0,1], fprime=deriv_func) + + class TestLeastSq(TestCase): def setUp(self): x = np.linspace(0, 10, 40) @@ -125,7 +169,32 @@ assert_(ier in (1,2,3,4), 'solution not found: %s'%mesg) assert_array_equal(p0, p0_copy) + def test_wrong_shape_func_callable(self): + """The callable 'func' has no 'func_name' attribute.""" + func = ReturnShape(1) + # x0 is a list of two elements, but func will return an array with + # length 1, so this should result in a TypeError. + x0 = [1.5, 2.0] + assert_raises(TypeError, optimize.leastsq, func, x0) + def test_wrong_shape_func_function(self): + # x0 is a list of two elements, but func will return an array with + # length 1, so this should result in a TypeError. + x0 = [1.5, 2.0] + assert_raises(TypeError, optimize.leastsq, dummy_func, x0, args=((1,),)) + + def test_wrong_shape_Dfun_callable(self): + """The callables 'func' and 'deriv_func' have no 'func_name' attribute.""" + func = ReturnShape(1) + deriv_func = ReturnShape((2,2)) + assert_raises(TypeError, optimize.leastsq, func, x0=[0,1], Dfun=deriv_func) + + def test_wrong_shape_Dfun_function(self): + func = lambda x: dummy_func(x, (2,)) + deriv_func = lambda x: dummy_func(x, (3,3)) + assert_raises(TypeError, optimize.leastsq, func, x0=[0,1], Dfun=deriv_func) + + class TestCurveFit(TestCase): def setUp(self): self.y = array([1.0, 3.2, 9.5, 13.7]) From scipy-svn at scipy.org Sat Sep 25 22:51:26 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sat, 25 Sep 2010 21:51:26 -0500 (CDT) Subject: [Scipy-svn] r6825 - trunk/scipy/optimize Message-ID: <20100926025126.A21C639CCFF@scipy.org> Author: warren.weckesser Date: 2010-09-25 21:51:25 -0500 (Sat, 25 Sep 2010) New Revision: 6825 Modified: trunk/scipy/optimize/minpack.py Log: Removed commented code accidentally left in the previous commit. Modified: trunk/scipy/optimize/minpack.py =================================================================== --- trunk/scipy/optimize/minpack.py 2010-09-26 02:48:28 UTC (rev 6824) +++ trunk/scipy/optimize/minpack.py 2010-09-26 02:51:25 UTC (rev 6825) @@ -113,7 +113,6 @@ n = len(x0) if type(args) != type(()): args = (args,) _check_func('fsolve', 'func', func, x0, args, n, (n,)) - #check_func(func, x0, args, n, (n,)) Dfun = fprime if Dfun is None: if band is None: @@ -126,7 +125,6 @@ maxfev, ml, mu, epsfcn, factor, diag) else: _check_func('fsolve', 'fprime', Dfun, x0, args, n, (n,n)) - # check_func(Dfun,x0,args,n,(n,n)) if (maxfev == 0): maxfev = 100*(n + 1) retval = _minpack._hybrj(func, Dfun, x0, args, full_output, @@ -261,7 +259,6 @@ if type(args) != type(()): args = (args,) m = _check_func('leastsq', 'func', func, x0, args, n)[0] - # m = check_func(func, x0, args, n)[0] if n > m: raise TypeError('Improper input: N=%s must not exceed M=%s' % (n,m)) if Dfun is None: @@ -272,10 +269,8 @@ else: if col_deriv: _check_func('leastsq', 'Dfun', Dfun, x0, args, n, (n,m)) - # check_func(Dfun, x0, args, n, (n,m)) else: _check_func('leastsq', 'Dfun', Dfun, x0, args, n, (m,n)) - # check_func(Dfun, x0, args, n, (m,n)) if (maxfev == 0): maxfev = 100*(n + 1) retval = _minpack._lmder(func, Dfun, x0, args, full_output, col_deriv, From scipy-svn at scipy.org Sun Sep 26 10:17:17 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Sun, 26 Sep 2010 09:17:17 -0500 (CDT) Subject: [Scipy-svn] r6826 - in trunk/scipy/fftpack: . tests Message-ID: <20100926141717.A451F39CCFF@scipy.org> Author: ptvirtan Date: 2010-09-26 09:17:17 -0500 (Sun, 26 Sep 2010) New Revision: 6826 Modified: trunk/scipy/fftpack/basic.py trunk/scipy/fftpack/tests/test_basic.py Log: BUG: fftpack: use single-precision FFT implementation only for "easy" sizes For large "difficult" sizes, the current single precision implementation apparently falls back to a non-optimal algorithm, and can produce large rounding errors. (bug #1212) This commit provides a work-around, by enabling the single-precision algorithms only for sizes that are composite numbers of 2, 3, and 5, for which FFTPACK has explicit support. This is probably a rather conservative approach. (cherry picked from r6570) Modified: trunk/scipy/fftpack/basic.py =================================================================== --- trunk/scipy/fftpack/basic.py 2010-09-26 02:51:25 UTC (rev 6825) +++ trunk/scipy/fftpack/basic.py 2010-09-26 14:17:17 UTC (rev 6826) @@ -22,22 +22,73 @@ def istype(arr, typeclass): return issubclass(arr.dtype.type, typeclass) +# XXX: single precision FFTs partially disabled due to accuracy issues +# for large prime-sized inputs. +# +# See http://permalink.gmane.org/gmane.comp.python.scientific.devel/13834 +# ("fftpack test failures for 0.8.0b1", Ralf Gommers, 17 Jun 2010, +# @ scipy-dev) +# +# These should be re-enabled once the problems are resolved + +def _is_safe_size(n): + """ + Is the size of FFT such that FFTPACK can handle it in single precision + with sufficient accuracy? + + Composite numbers of 2, 3, and 5 are accepted, as FFTPACK has those + """ + n = int(n) + for c in (2, 3, 5): + while n % c == 0: + n /= c + return (n <= 1) + +def _fake_crfft(x, n, *a, **kw): + if _is_safe_size(n): + return _fftpack.crfft(x, n, *a, **kw) + else: + return _fftpack.zrfft(x, n, *a, **kw).astype(numpy.complex64) + +def _fake_cfft(x, n, *a, **kw): + if _is_safe_size(n): + return _fftpack.cfft(x, n, *a, **kw) + else: + return _fftpack.zfft(x, n, *a, **kw).astype(numpy.complex64) + +def _fake_rfft(x, n, *a, **kw): + if _is_safe_size(n): + return _fftpack.rfft(x, n, *a, **kw) + else: + return _fftpack.drfft(x, n, *a, **kw).astype(numpy.float32) + +def _fake_cfftnd(x, shape, *a, **kw): + if numpy.all(map(_is_safe_size, shape)): + return _fftpack.cfftnd(x, shape, *a, **kw) + else: + return _fftpack.zfftnd(x, shape, *a, **kw).astype(numpy.complex64) + _DTYPE_TO_FFT = { - numpy.dtype(numpy.float32): _fftpack.crfft, +# numpy.dtype(numpy.float32): _fftpack.crfft, + numpy.dtype(numpy.float32): _fake_crfft, numpy.dtype(numpy.float64): _fftpack.zrfft, - numpy.dtype(numpy.complex64): _fftpack.cfft, +# numpy.dtype(numpy.complex64): _fftpack.cfft, + numpy.dtype(numpy.complex64): _fake_cfft, numpy.dtype(numpy.complex128): _fftpack.zfft, } _DTYPE_TO_RFFT = { - numpy.dtype(numpy.float32): _fftpack.rfft, +# numpy.dtype(numpy.float32): _fftpack.rfft, + numpy.dtype(numpy.float32): _fake_rfft, numpy.dtype(numpy.float64): _fftpack.drfft, } _DTYPE_TO_FFTN = { - numpy.dtype(numpy.complex64): _fftpack.cfftnd, +# numpy.dtype(numpy.complex64): _fftpack.cfftnd, + numpy.dtype(numpy.complex64): _fake_cfftnd, numpy.dtype(numpy.complex128): _fftpack.zfftnd, - numpy.dtype(numpy.float32): _fftpack.cfftnd, +# numpy.dtype(numpy.float32): _fftpack.cfftnd, + numpy.dtype(numpy.float32): _fake_cfftnd, numpy.dtype(numpy.float64): _fftpack.zfftnd, } Modified: trunk/scipy/fftpack/tests/test_basic.py =================================================================== --- trunk/scipy/fftpack/tests/test_basic.py 2010-09-26 02:51:25 UTC (rev 6825) +++ trunk/scipy/fftpack/tests/test_basic.py 2010-09-26 14:17:17 UTC (rev 6826) @@ -12,7 +12,8 @@ """ from numpy.testing import assert_, assert_equal, assert_array_almost_equal, \ - assert_array_almost_equal_nulp, assert_raises, run_module_suite, TestCase + assert_array_almost_equal_nulp, assert_raises, run_module_suite, \ + TestCase, dec from scipy.fftpack import ifft,fft,fftn,ifftn,rfft,irfft, fft2 from scipy.fftpack import _fftpack as fftpack @@ -21,6 +22,25 @@ import numpy as np import numpy.fft +# "large" composite numbers supported by FFTPACK +LARGE_COMPOSITE_SIZES = [ + 2**13, + 2**5 * 3**5, + 2**3 * 3**3 * 5**2, +] +SMALL_COMPOSITE_SIZES = [ + 2, + 2*3*5, + 2*2*3*3, +] +# prime +LARGE_PRIME_SIZES = [ + 2011 +] +SMALL_PRIME_SIZES = [ + 29 +] + from numpy.random import rand def random(size): return rand(*size) @@ -136,7 +156,6 @@ y = fftpack.zrfft(x) assert_array_almost_equal(y,y2) - class TestDoubleFFT(_TestFFTBase): def setUp(self): self.cdt = np.cdouble @@ -147,6 +166,10 @@ self.cdt = np.complex64 self.rdt = np.float32 + @dec.knownfailureif(True, "single-precision FFT implementation is partially disabled, until accuracy issues with large prime powers are resolved") + def test_notice(self): + pass + class _TestIFFTBase(TestCase): def setUp(self): np.random.seed(1234) @@ -210,6 +233,31 @@ assert_array_almost_equal (y1, x) assert_array_almost_equal (y2, x) + def test_size_accuracy(self): + # Sanity check for the accuracy for prime and non-prime sized inputs + if self.rdt == np.float32: + rtol = 1e-5 + elif self.rdt == np.float64: + rtol = 1e-10 + + for size in LARGE_COMPOSITE_SIZES + LARGE_PRIME_SIZES: + np.random.seed(1234) + x = np.random.rand(size).astype(self.rdt) + y = ifft(fft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + y = fft(ifft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + + x = (x + 1j*np.random.rand(size)).astype(self.cdt) + y = ifft(fft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + y = fft(ifft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + class TestDoubleIFFT(_TestIFFTBase): def setUp(self): self.cdt = np.cdouble @@ -303,9 +351,28 @@ "Output dtype is %s, expected %s" % (y1.dtype, self.rdt)) self.assertTrue(y2.dtype == self.rdt, "Output dtype is %s, expected %s" % (y2.dtype, self.rdt)) - assert_array_almost_equal (y1, x, decimal=self.ndec) - assert_array_almost_equal (y2, x, decimal=self.ndec) + assert_array_almost_equal (y1, x, decimal=self.ndec, + err_msg="size=%d" % size) + assert_array_almost_equal (y2, x, decimal=self.ndec, + err_msg="size=%d" % size) + def test_size_accuracy(self): + # Sanity check for the accuracy for prime and non-prime sized inputs + if self.rdt == np.float32: + rtol = 1e-5 + elif self.rdt == np.float64: + rtol = 1e-10 + + for size in LARGE_COMPOSITE_SIZES + LARGE_PRIME_SIZES: + np.random.seed(1234) + x = np.random.rand(size).astype(self.rdt) + y = irfft(rfft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + y = rfft(irfft(x)) + self.failUnless(np.linalg.norm(x - y) < rtol*np.linalg.norm(x), + (size, self.rdt)) + # self.ndec is bogus; we should have a assert_array_approx_equal for number of # significant digits class TestIRFFTDouble(_TestIRFFTBase): @@ -346,6 +413,25 @@ y_r = np.array(fftn(x), np.complex64) assert_array_almost_equal_nulp(y, y_r) + def test_size_accuracy(self): + for size in SMALL_COMPOSITE_SIZES + SMALL_PRIME_SIZES: + np.random.seed(1234) + x = np.random.rand(size, size) + 1j*np.random.rand(size, size) + y1 = fftn(x.astype(np.float32)) + y2 = fftn(x.astype(np.float64)).astype(np.complex64) + + self.failUnless(y1.dtype == np.complex64) + assert_array_almost_equal_nulp(y1, y2, 2000) + + for size in LARGE_COMPOSITE_SIZES + LARGE_PRIME_SIZES: + np.random.seed(1234) + x = np.random.rand(size, 3) + 1j*np.random.rand(size, 3) + y1 = fftn(x.astype(np.float32)) + y2 = fftn(x.astype(np.float64)).astype(np.complex64) + + self.failUnless(y1.dtype == np.complex64) + assert_array_almost_equal_nulp(y1, y2, 2000) + class TestFftn(TestCase): def setUp(self): np.random.seed(1234) @@ -529,7 +615,7 @@ class TestIfftnSingle(_TestIfftn): dtype = np.float32 cdtype = np.complex64 - maxnlp = 2000 + maxnlp = 3500 class TestLongDoubleFailure(TestCase): def setUp(self): From scipy-svn at scipy.org Mon Sep 27 22:08:27 2010 From: scipy-svn at scipy.org (scipy-svn at scipy.org) Date: Mon, 27 Sep 2010 21:08:27 -0500 (CDT) Subject: [Scipy-svn] r6827 - trunk/scipy/spatial/tests Message-ID: <20100928020827.17FD66E005@scipy.org> Author: warren.weckesser Date: 2010-09-27 21:08:26 -0500 (Mon, 27 Sep 2010) New Revision: 6827 Modified: trunk/scipy/spatial/tests/test_distance.py Log: TST: spatial: increase the tolerance the in test test_pdist_minkowski_3_2_iris_float32 (ticket #1278) Modified: trunk/scipy/spatial/tests/test_distance.py =================================================================== --- trunk/scipy/spatial/tests/test_distance.py 2010-09-26 14:17:17 UTC (rev 6826) +++ trunk/scipy/spatial/tests/test_distance.py 2010-09-28 02:08:26 UTC (rev 6827) @@ -828,7 +828,7 @@ def test_pdist_minkowski_3_2_iris_float32(self): "Tests pdist(X, 'minkowski') on iris data. (float32)" - eps = 1e-07 + eps = 1e-06 # Get the data: the input matrix and the right output. X = np.float32(eo['iris']) Y_right = eo['pdist-minkowski-3.2-iris']