[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Jan 27 09:13:15 PST 2016
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/12c837fedc3d/
Changeset: 12c837fedc3d
Branch: yt
User: MatthewTurk
Date: 2016-01-22 17:22:05+00:00
Summary: Make _MPL.c numpy clean and remove warnings and errors.
Affected #: 1 file
diff -r eff6841ae4004a3ecb8040858e57badbd3b00021 -r 12c837fedc3d50d77f718706834e51413be611cc yt/visualization/_MPL.c
--- a/yt/visualization/_MPL.c
+++ b/yt/visualization/_MPL.c
@@ -18,6 +18,7 @@
#include <signal.h>
#include <ctype.h>
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "numpy/ndarrayobject.h"
#define min(X,Y) ((X) < (Y) ? (X) : (Y))
@@ -102,10 +103,7 @@
}
// Check dimensions match
- int nx = x->dimensions[0];
- int ny = y->dimensions[0];
- int ndx = dx->dimensions[0];
- int ndy = dy->dimensions[0];
+ int nx = PyArray_DIMS(x)[0];
// Calculate the pointer arrays to map input x to output x
int i, j, p, xi, yi;
@@ -300,7 +298,7 @@
goto _fail;
}
center = (PyArrayObject *) PyArray_FromAny(centerp,
- PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_C_CONTIGUOUS, NULL);
+ PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_ARRAY_C_CONTIGUOUS, NULL);
if ((dz == NULL) || (PyArray_SIZE(center) != 3)) {
PyErr_Format( _pixelizeError, "Center must have three points");
goto _fail;
@@ -319,7 +317,7 @@
}
// Check dimensions match
- int nx = x->dimensions[0];
+ int nx = PyArray_DIMS(x)[0];
// Calculate the pointer arrays to map input x to output x
int i, j, p;
@@ -327,14 +325,13 @@
long double md, cxpx, cypx;
long double cx, cy, cz;
- npy_float64 xsp, ysp, zsp, pxsp, pysp, dxsp, dysp, dzsp, dsp;
npy_float64 *centers = (npy_float64 *) PyArray_GETPTR1(center,0);
npy_intp dims[] = {rows, cols};
PyArrayObject *my_array =
(PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
PyArray_DescrFromType(NPY_FLOAT64));
- npy_float64 *gridded = (npy_float64 *) my_array->data;
+ npy_float64 *gridded = (npy_float64 *) PyArray_DATA(my_array);
npy_float64 *mask = malloc(sizeof(npy_float64)*rows*cols);
npy_float64 inv_mats[3][3];
@@ -342,7 +339,6 @@
inv_mats[i][j]=*(npy_float64*)PyArray_GETPTR2(inv_mat,i,j);
int pp;
- npy_float64 radius;
for(p=0;p<cols*rows;p++)gridded[p]=mask[p]=0.0;
for(pp=0; pp<nx; pp++)
{
https://bitbucket.org/yt_analysis/yt/commits/7b3234d68c60/
Changeset: 7b3234d68c60
Branch: yt
User: ngoldbaum
Date: 2016-01-27 17:13:09+00:00
Summary: Merged in MatthewTurk/yt (pull request #1954)
Make _MPL.c numpy clean and remove warnings and errors, and require numpy 1.7 or higher
Affected #: 1 file
diff -r 0522add7213b7a461a68756692177872680b6027 -r 7b3234d68c60aa8d575160408559fbc03089b058 yt/visualization/_MPL.c
--- a/yt/visualization/_MPL.c
+++ b/yt/visualization/_MPL.c
@@ -18,6 +18,7 @@
#include <signal.h>
#include <ctype.h>
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include "numpy/ndarrayobject.h"
#define min(X,Y) ((X) < (Y) ? (X) : (Y))
@@ -102,10 +103,7 @@
}
// Check dimensions match
- int nx = x->dimensions[0];
- int ny = y->dimensions[0];
- int ndx = dx->dimensions[0];
- int ndy = dy->dimensions[0];
+ int nx = PyArray_DIMS(x)[0];
// Calculate the pointer arrays to map input x to output x
int i, j, p, xi, yi;
@@ -300,7 +298,7 @@
goto _fail;
}
center = (PyArrayObject *) PyArray_FromAny(centerp,
- PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_C_CONTIGUOUS, NULL);
+ PyArray_DescrFromType(NPY_FLOAT64), 1, 1, NPY_ARRAY_C_CONTIGUOUS, NULL);
if ((dz == NULL) || (PyArray_SIZE(center) != 3)) {
PyErr_Format( _pixelizeError, "Center must have three points");
goto _fail;
@@ -319,7 +317,7 @@
}
// Check dimensions match
- int nx = x->dimensions[0];
+ int nx = PyArray_DIMS(x)[0];
// Calculate the pointer arrays to map input x to output x
int i, j, p;
@@ -327,14 +325,13 @@
long double md, cxpx, cypx;
long double cx, cy, cz;
- npy_float64 xsp, ysp, zsp, pxsp, pysp, dxsp, dysp, dzsp, dsp;
npy_float64 *centers = (npy_float64 *) PyArray_GETPTR1(center,0);
npy_intp dims[] = {rows, cols};
PyArrayObject *my_array =
(PyArrayObject *) PyArray_SimpleNewFromDescr(2, dims,
PyArray_DescrFromType(NPY_FLOAT64));
- npy_float64 *gridded = (npy_float64 *) my_array->data;
+ npy_float64 *gridded = (npy_float64 *) PyArray_DATA(my_array);
npy_float64 *mask = malloc(sizeof(npy_float64)*rows*cols);
npy_float64 inv_mats[3][3];
@@ -342,7 +339,6 @@
inv_mats[i][j]=*(npy_float64*)PyArray_GETPTR2(inv_mat,i,j);
int pp;
- npy_float64 radius;
for(p=0;p<cols*rows;p++)gridded[p]=mask[p]=0.0;
for(pp=0; pp<nx; pp++)
{
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list