@@ -328,7 +328,7 @@ void Triangulation::calculate_edges()
328328
329329 // Convert to python _edges array.
330330 npy_intp dims[2 ] = {static_cast <npy_intp>(edge_set.size ()), 2 };
331- _edges = (PyArrayObject*)PyArray_SimpleNew (2 , dims, PyArray_INT );
331+ _edges = (PyArrayObject*)PyArray_SimpleNew (2 , dims, NPY_INT );
332332 int * edges_ptr = (int *)PyArray_DATA (_edges);
333333 for (EdgeSet::const_iterator it = edge_set.begin (); it != edge_set.end (); ++it) {
334334 *edges_ptr++ = it->start ;
@@ -343,7 +343,7 @@ void Triangulation::calculate_neighbors()
343343
344344 // Create _neighbors array with shape (ntri,3) and initialise all to -1.
345345 npy_intp dims[2 ] = {_ntri,3 };
346- _neighbors = (PyArrayObject*)PyArray_SimpleNew (2 , dims, PyArray_INT );
346+ _neighbors = (PyArrayObject*)PyArray_SimpleNew (2 , dims, NPY_INT );
347347 int * neighbors_ptr = (int *)PyArray_DATA (_neighbors);
348348 std::fill (neighbors_ptr, neighbors_ptr + 3 *_ntri, -1 );
349349
@@ -386,7 +386,7 @@ Py::Object Triangulation::calculate_plane_coefficients(const Py::Tuple &args)
386386 args.verify_length (1 );
387387
388388 PyArrayObject* z = (PyArrayObject*)PyArray_ContiguousFromObject (
389- args[0 ].ptr (), PyArray_DOUBLE , 1 , 1 );
389+ args[0 ].ptr (), NPY_DOUBLE , 1 , 1 );
390390 if (z == 0 || PyArray_DIM (z,0 ) != PyArray_DIM (_x,0 )) {
391391 Py_XDECREF (z);
392392 throw Py::ValueError (
@@ -401,7 +401,7 @@ Py::Object Triangulation::calculate_plane_coefficients(const Py::Tuple &args)
401401
402402 npy_intp dims[2 ] = {_ntri, 3 };
403403 planes_array = (PyArrayObject*)PyArray_SimpleNew (2 , dims,
404- PyArray_DOUBLE );
404+ NPY_DOUBLE );
405405 double * planes = (double *)PyArray_DATA (planes_array);
406406 const int * tris = get_triangles_ptr ();
407407 const double * xs = (const double *)PyArray_DATA (_x);
@@ -624,7 +624,7 @@ Py::Object Triangulation::set_mask(const Py::Tuple &args)
624624 if (args[0 ] != Py::None ())
625625 {
626626 _mask = (PyArrayObject*)PyArray_ContiguousFromObject (
627- args[0 ].ptr (), PyArray_BOOL , 1 , 1 );
627+ args[0 ].ptr (), NPY_BOOL , 1 , 1 );
628628 if (_mask == 0 || PyArray_DIM (_mask,0 ) != PyArray_DIM (_triangles,0 )) {
629629 Py_XDECREF (_mask);
630630 throw Py::ValueError (
@@ -712,7 +712,7 @@ Py::Object TriContourGenerator::contour_to_segs(const Contour& contour)
712712 const ContourLine& line = contour[i];
713713 npy_intp dims[2 ] = {static_cast <npy_intp>(line.size ()),2 };
714714 PyArrayObject* py_line = (PyArrayObject*)PyArray_SimpleNew (
715- 2 , dims, PyArray_DOUBLE );
715+ 2 , dims, NPY_DOUBLE );
716716 double * p = (double *)PyArray_DATA (py_line);
717717 for (ContourLine::const_iterator it = line.begin (); it != line.end (); ++it) {
718718 *p++ = it->x ;
@@ -736,13 +736,13 @@ Py::Object TriContourGenerator::contour_to_segs_and_kinds(const Contour& contour
736736 // Create segs array for point coordinates.
737737 npy_intp segs_dims[2 ] = {n_points, 2 };
738738 PyArrayObject* segs = (PyArrayObject*)PyArray_SimpleNew (
739- 2 , segs_dims, PyArray_DOUBLE );
739+ 2 , segs_dims, NPY_DOUBLE );
740740 double * segs_ptr = (double *)PyArray_DATA (segs);
741741
742742 // Create kinds array for code types.
743743 npy_intp kinds_dims[1 ] = {n_points};
744744 PyArrayObject* kinds = (PyArrayObject*)PyArray_SimpleNew (
745- 1 , kinds_dims, PyArray_UBYTE );
745+ 1 , kinds_dims, NPY_UBYTE );
746746 unsigned char * kinds_ptr = (unsigned char *)PyArray_DATA (kinds);
747747
748748 for (line = contour.begin (); line != contour.end (); ++line) {
@@ -1367,9 +1367,9 @@ TrapezoidMapTriFinder::find_many(const Py::Tuple& args)
13671367
13681368 // Check input arguments.
13691369 PyArrayObject* x = (PyArrayObject*)PyArray_ContiguousFromObject (
1370- args[0 ].ptr (), PyArray_DOUBLE , 0 , 0 );
1370+ args[0 ].ptr (), NPY_DOUBLE , 0 , 0 );
13711371 PyArrayObject* y = (PyArrayObject*)PyArray_ContiguousFromObject (
1372- args[1 ].ptr (), PyArray_DOUBLE , 0 , 0 );
1372+ args[1 ].ptr (), NPY_DOUBLE , 0 , 0 );
13731373 bool ok = (x != 0 && y != 0 && PyArray_NDIM (x) == PyArray_NDIM (y));
13741374 int ndim = x == 0 ? 0 : PyArray_NDIM (x);
13751375 for (int i = 0 ; ok && i < ndim; ++i)
@@ -1383,7 +1383,7 @@ TrapezoidMapTriFinder::find_many(const Py::Tuple& args)
13831383
13841384 // Create integer array to return.
13851385 PyArrayObject* tri = (PyArrayObject*)PyArray_SimpleNew (
1386- ndim, PyArray_DIMS (x), PyArray_INT );
1386+ ndim, PyArray_DIMS (x), NPY_INT );
13871387
13881388 // Fill returned array.
13891389 double * x_ptr = (double *)PyArray_DATA (x);
@@ -2234,9 +2234,9 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
22342234
22352235 // x and y.
22362236 PyArrayObject* x = (PyArrayObject*)PyArray_ContiguousFromObject (
2237- args[0 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2237+ args[0 ].ptr (), NPY_DOUBLE , 1 , 1 );
22382238 PyArrayObject* y = (PyArrayObject*)PyArray_ContiguousFromObject (
2239- args[1 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2239+ args[1 ].ptr (), NPY_DOUBLE , 1 , 1 );
22402240 if (x == 0 || y == 0 || PyArray_DIM (x,0 ) != PyArray_DIM (y,0 )) {
22412241 Py_XDECREF (x);
22422242 Py_XDECREF (y);
@@ -2245,7 +2245,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
22452245
22462246 // triangles.
22472247 PyArrayObject* triangles = (PyArrayObject*)PyArray_ContiguousFromObject (
2248- args[2 ].ptr (), PyArray_INT , 2 , 2 );
2248+ args[2 ].ptr (), NPY_INT , 2 , 2 );
22492249 if (triangles == 0 || PyArray_DIM (triangles,1 ) != 3 ) {
22502250 Py_XDECREF (x);
22512251 Py_XDECREF (y);
@@ -2258,7 +2258,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
22582258 if (args[3 ].ptr () != 0 && args[3 ] != Py::None ())
22592259 {
22602260 mask = (PyArrayObject*)PyArray_ContiguousFromObject (
2261- args[3 ].ptr (), PyArray_BOOL , 1 , 1 );
2261+ args[3 ].ptr (), NPY_BOOL , 1 , 1 );
22622262 if (mask == 0 || PyArray_DIM (mask,0 ) != PyArray_DIM (triangles,0 )) {
22632263 Py_XDECREF (x);
22642264 Py_XDECREF (y);
@@ -2274,7 +2274,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
22742274 if (args[4 ].ptr () != 0 && args[4 ] != Py::None ())
22752275 {
22762276 edges = (PyArrayObject*)PyArray_ContiguousFromObject (
2277- args[4 ].ptr (), PyArray_INT , 2 , 2 );
2277+ args[4 ].ptr (), NPY_INT , 2 , 2 );
22782278 if (edges == 0 || PyArray_DIM (edges,1 ) != 2 ) {
22792279 Py_XDECREF (x);
22802280 Py_XDECREF (y);
@@ -2290,7 +2290,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
22902290 if (args[5 ].ptr () != 0 && args[5 ] != Py::None ())
22912291 {
22922292 neighbors = (PyArrayObject*)PyArray_ContiguousFromObject (
2293- args[5 ].ptr (), PyArray_INT , 2 , 2 );
2293+ args[5 ].ptr (), NPY_INT , 2 , 2 );
22942294 if (neighbors == 0 ||
22952295 PyArray_DIM (neighbors,0 ) != PyArray_DIM (triangles,0 ) ||
22962296 PyArray_DIM (neighbors,1 ) != PyArray_DIM (triangles,1 )) {
@@ -2318,7 +2318,7 @@ Py::Object TriModule::new_tricontourgenerator(const Py::Tuple &args)
23182318 throw Py::ValueError (" Expecting a C++ Triangulation object" );
23192319
23202320 PyArrayObject* z = (PyArrayObject*)PyArray_ContiguousFromObject (
2321- args[1 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2321+ args[1 ].ptr (), NPY_DOUBLE , 1 , 1 );
23222322 if (z == 0 ||
23232323 PyArray_DIM (z,0 ) != ((Triangulation*)tri.ptr ())->get_npoints ()) {
23242324 Py_XDECREF (z);
0 commit comments