@@ -328,7 +328,7 @@ void Triangulation::calculate_edges()
328
328
329
329
// Convert to python _edges array.
330
330
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 );
332
332
int * edges_ptr = (int *)PyArray_DATA (_edges);
333
333
for (EdgeSet::const_iterator it = edge_set.begin (); it != edge_set.end (); ++it) {
334
334
*edges_ptr++ = it->start ;
@@ -343,7 +343,7 @@ void Triangulation::calculate_neighbors()
343
343
344
344
// Create _neighbors array with shape (ntri,3) and initialise all to -1.
345
345
npy_intp dims[2 ] = {_ntri,3 };
346
- _neighbors = (PyArrayObject*)PyArray_SimpleNew (2 , dims, PyArray_INT );
346
+ _neighbors = (PyArrayObject*)PyArray_SimpleNew (2 , dims, NPY_INT );
347
347
int * neighbors_ptr = (int *)PyArray_DATA (_neighbors);
348
348
std::fill (neighbors_ptr, neighbors_ptr + 3 *_ntri, -1 );
349
349
@@ -386,7 +386,7 @@ Py::Object Triangulation::calculate_plane_coefficients(const Py::Tuple &args)
386
386
args.verify_length (1 );
387
387
388
388
PyArrayObject* z = (PyArrayObject*)PyArray_ContiguousFromObject (
389
- args[0 ].ptr (), PyArray_DOUBLE , 1 , 1 );
389
+ args[0 ].ptr (), NPY_DOUBLE , 1 , 1 );
390
390
if (z == 0 || PyArray_DIM (z,0 ) != PyArray_DIM (_x,0 )) {
391
391
Py_XDECREF (z);
392
392
throw Py::ValueError (
@@ -401,7 +401,7 @@ Py::Object Triangulation::calculate_plane_coefficients(const Py::Tuple &args)
401
401
402
402
npy_intp dims[2 ] = {_ntri, 3 };
403
403
planes_array = (PyArrayObject*)PyArray_SimpleNew (2 , dims,
404
- PyArray_DOUBLE );
404
+ NPY_DOUBLE );
405
405
double * planes = (double *)PyArray_DATA (planes_array);
406
406
const int * tris = get_triangles_ptr ();
407
407
const double * xs = (const double *)PyArray_DATA (_x);
@@ -624,7 +624,7 @@ Py::Object Triangulation::set_mask(const Py::Tuple &args)
624
624
if (args[0 ] != Py::None ())
625
625
{
626
626
_mask = (PyArrayObject*)PyArray_ContiguousFromObject (
627
- args[0 ].ptr (), PyArray_BOOL , 1 , 1 );
627
+ args[0 ].ptr (), NPY_BOOL , 1 , 1 );
628
628
if (_mask == 0 || PyArray_DIM (_mask,0 ) != PyArray_DIM (_triangles,0 )) {
629
629
Py_XDECREF (_mask);
630
630
throw Py::ValueError (
@@ -712,7 +712,7 @@ Py::Object TriContourGenerator::contour_to_segs(const Contour& contour)
712
712
const ContourLine& line = contour[i];
713
713
npy_intp dims[2 ] = {static_cast <npy_intp>(line.size ()),2 };
714
714
PyArrayObject* py_line = (PyArrayObject*)PyArray_SimpleNew (
715
- 2 , dims, PyArray_DOUBLE );
715
+ 2 , dims, NPY_DOUBLE );
716
716
double * p = (double *)PyArray_DATA (py_line);
717
717
for (ContourLine::const_iterator it = line.begin (); it != line.end (); ++it) {
718
718
*p++ = it->x ;
@@ -736,13 +736,13 @@ Py::Object TriContourGenerator::contour_to_segs_and_kinds(const Contour& contour
736
736
// Create segs array for point coordinates.
737
737
npy_intp segs_dims[2 ] = {n_points, 2 };
738
738
PyArrayObject* segs = (PyArrayObject*)PyArray_SimpleNew (
739
- 2 , segs_dims, PyArray_DOUBLE );
739
+ 2 , segs_dims, NPY_DOUBLE );
740
740
double * segs_ptr = (double *)PyArray_DATA (segs);
741
741
742
742
// Create kinds array for code types.
743
743
npy_intp kinds_dims[1 ] = {n_points};
744
744
PyArrayObject* kinds = (PyArrayObject*)PyArray_SimpleNew (
745
- 1 , kinds_dims, PyArray_UBYTE );
745
+ 1 , kinds_dims, NPY_UBYTE );
746
746
unsigned char * kinds_ptr = (unsigned char *)PyArray_DATA (kinds);
747
747
748
748
for (line = contour.begin (); line != contour.end (); ++line) {
@@ -1367,9 +1367,9 @@ TrapezoidMapTriFinder::find_many(const Py::Tuple& args)
1367
1367
1368
1368
// Check input arguments.
1369
1369
PyArrayObject* x = (PyArrayObject*)PyArray_ContiguousFromObject (
1370
- args[0 ].ptr (), PyArray_DOUBLE , 0 , 0 );
1370
+ args[0 ].ptr (), NPY_DOUBLE , 0 , 0 );
1371
1371
PyArrayObject* y = (PyArrayObject*)PyArray_ContiguousFromObject (
1372
- args[1 ].ptr (), PyArray_DOUBLE , 0 , 0 );
1372
+ args[1 ].ptr (), NPY_DOUBLE , 0 , 0 );
1373
1373
bool ok = (x != 0 && y != 0 && PyArray_NDIM (x) == PyArray_NDIM (y));
1374
1374
int ndim = x == 0 ? 0 : PyArray_NDIM (x);
1375
1375
for (int i = 0 ; ok && i < ndim; ++i)
@@ -1383,7 +1383,7 @@ TrapezoidMapTriFinder::find_many(const Py::Tuple& args)
1383
1383
1384
1384
// Create integer array to return.
1385
1385
PyArrayObject* tri = (PyArrayObject*)PyArray_SimpleNew (
1386
- ndim, PyArray_DIMS (x), PyArray_INT );
1386
+ ndim, PyArray_DIMS (x), NPY_INT );
1387
1387
1388
1388
// Fill returned array.
1389
1389
double * x_ptr = (double *)PyArray_DATA (x);
@@ -2234,9 +2234,9 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
2234
2234
2235
2235
// x and y.
2236
2236
PyArrayObject* x = (PyArrayObject*)PyArray_ContiguousFromObject (
2237
- args[0 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2237
+ args[0 ].ptr (), NPY_DOUBLE , 1 , 1 );
2238
2238
PyArrayObject* y = (PyArrayObject*)PyArray_ContiguousFromObject (
2239
- args[1 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2239
+ args[1 ].ptr (), NPY_DOUBLE , 1 , 1 );
2240
2240
if (x == 0 || y == 0 || PyArray_DIM (x,0 ) != PyArray_DIM (y,0 )) {
2241
2241
Py_XDECREF (x);
2242
2242
Py_XDECREF (y);
@@ -2245,7 +2245,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
2245
2245
2246
2246
// triangles.
2247
2247
PyArrayObject* triangles = (PyArrayObject*)PyArray_ContiguousFromObject (
2248
- args[2 ].ptr (), PyArray_INT , 2 , 2 );
2248
+ args[2 ].ptr (), NPY_INT , 2 , 2 );
2249
2249
if (triangles == 0 || PyArray_DIM (triangles,1 ) != 3 ) {
2250
2250
Py_XDECREF (x);
2251
2251
Py_XDECREF (y);
@@ -2258,7 +2258,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
2258
2258
if (args[3 ].ptr () != 0 && args[3 ] != Py::None ())
2259
2259
{
2260
2260
mask = (PyArrayObject*)PyArray_ContiguousFromObject (
2261
- args[3 ].ptr (), PyArray_BOOL , 1 , 1 );
2261
+ args[3 ].ptr (), NPY_BOOL , 1 , 1 );
2262
2262
if (mask == 0 || PyArray_DIM (mask,0 ) != PyArray_DIM (triangles,0 )) {
2263
2263
Py_XDECREF (x);
2264
2264
Py_XDECREF (y);
@@ -2274,7 +2274,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
2274
2274
if (args[4 ].ptr () != 0 && args[4 ] != Py::None ())
2275
2275
{
2276
2276
edges = (PyArrayObject*)PyArray_ContiguousFromObject (
2277
- args[4 ].ptr (), PyArray_INT , 2 , 2 );
2277
+ args[4 ].ptr (), NPY_INT , 2 , 2 );
2278
2278
if (edges == 0 || PyArray_DIM (edges,1 ) != 2 ) {
2279
2279
Py_XDECREF (x);
2280
2280
Py_XDECREF (y);
@@ -2290,7 +2290,7 @@ Py::Object TriModule::new_triangulation(const Py::Tuple &args)
2290
2290
if (args[5 ].ptr () != 0 && args[5 ] != Py::None ())
2291
2291
{
2292
2292
neighbors = (PyArrayObject*)PyArray_ContiguousFromObject (
2293
- args[5 ].ptr (), PyArray_INT , 2 , 2 );
2293
+ args[5 ].ptr (), NPY_INT , 2 , 2 );
2294
2294
if (neighbors == 0 ||
2295
2295
PyArray_DIM (neighbors,0 ) != PyArray_DIM (triangles,0 ) ||
2296
2296
PyArray_DIM (neighbors,1 ) != PyArray_DIM (triangles,1 )) {
@@ -2318,7 +2318,7 @@ Py::Object TriModule::new_tricontourgenerator(const Py::Tuple &args)
2318
2318
throw Py::ValueError (" Expecting a C++ Triangulation object" );
2319
2319
2320
2320
PyArrayObject* z = (PyArrayObject*)PyArray_ContiguousFromObject (
2321
- args[1 ].ptr (), PyArray_DOUBLE , 1 , 1 );
2321
+ args[1 ].ptr (), NPY_DOUBLE , 1 , 1 );
2322
2322
if (z == 0 ||
2323
2323
PyArray_DIM (z,0 ) != ((Triangulation*)tri.ptr ())->get_npoints ()) {
2324
2324
Py_XDECREF (z);
0 commit comments