Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db89f5b

Browse files
committed
more fixes for numpy svn deprecation warnings
svn path=/trunk/matplotlib/; revision=5781
1 parent 57b8e5a commit db89f5b

8 files changed

Lines changed: 14 additions & 14 deletions

File tree

examples/pylab_examples/nan_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
plot(t, s, '-', lw=2)
2323

2424
xlabel('time (s)')
25-
ylabel('voltage (mV)')
26-
title('More NaNs at 0.0 and 1.0')
25+
ylabel('more nans')
2726
grid(True)
2827

2928
show()

examples/pylab_examples/quadmesh_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
# Or use the default, which is transparent:
4141
col = ax.pcolormesh(Qx,Qz,Zm)
4242
ax.set_title('With masked values')
43-
show()
43+
4444

4545
savefig("quadmesh_demo")
46+
show()

lib/matplotlib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"""
9090
from __future__ import generators
9191

92-
__version__ = '0.98.2'
92+
__version__ = '0.98.3'
9393
__revision__ = '$Revision$'
9494
__date__ = '$Date$'
9595

src/_backend_gdk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pixbuf_get_pixels_array(PyObject *self, PyObject *args)
2828
PyGObject *py_pixbuf;
2929
GdkPixbuf *gdk_pixbuf;
3030
PyArrayObject *array;
31-
int dims[3] = { 0, 0, 3 };
31+
npy_intp dims[3] = { 0, 0, 3 };
3232

3333
if (!PyArg_ParseTuple(args, "O!:pixbuf_get_pixels_array",
3434
&PyGdkPixbuf_Type, &py_pixbuf))

src/_path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ Py::Object _path_module::clip_path_to_rect(const Py::Tuple &args)
846846

847847
::clip_to_rect(path, x0, y0, x1, y1, inside, results);
848848

849-
int dims[2];
849+
npy_intp dims[2];
850850
dims[1] = 2;
851851
PyObject* py_results = PyList_New(results.size());
852852
if (!py_results)

src/_png.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ _png_module::read_png(const Py::Tuple& args) {
249249

250250

251251

252-
int dimensions[3];
252+
npy_intp dimensions[3];
253253
dimensions[0] = height; //numrows
254254
dimensions[1] = width; //numcols
255255
dimensions[2] = 4;

src/cntr.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ build_cntr_list_v(long *np, double *xp, double *yp, int nparts, long ntotal)
13331333
{
13341334
PyObject *point, *all_contours;
13351335
PyArrayObject *xv, *yv;
1336-
int dims[1];
1336+
npy_intp dims[1];
13371337
int i;
13381338
long j, k;
13391339

@@ -1343,8 +1343,8 @@ build_cntr_list_v(long *np, double *xp, double *yp, int nparts, long ntotal)
13431343
for (i = 0; i < nparts; i++)
13441344
{
13451345
dims[0] = np[i];
1346-
xv = (PyArrayObject *) PyArray_FromDims(1, dims, PyArray_DOUBLE);
1347-
yv = (PyArrayObject *) PyArray_FromDims(1, dims, PyArray_DOUBLE);
1346+
xv = (PyArrayObject *) PyArray_SimpleNew(1, dims, PyArray_DOUBLE);
1347+
yv = (PyArrayObject *) PyArray_SimpleNew(1, dims, PyArray_DOUBLE);
13481348
if (xv == NULL || yv == NULL) goto error;
13491349
for (j = 0; j < dims[0]; j++)
13501350
{
@@ -1370,7 +1370,7 @@ build_cntr_list_v2(long *np, double *xp, double *yp, int nparts, long ntotal)
13701370
{
13711371
PyObject *all_contours;
13721372
PyArrayObject *xyv;
1373-
int dims[2];
1373+
npy_intp dims[2];
13741374
int i;
13751375
long j, k;
13761376

@@ -1381,7 +1381,7 @@ build_cntr_list_v2(long *np, double *xp, double *yp, int nparts, long ntotal)
13811381
{
13821382
dims[0] = np[i];
13831383
dims[1] = 2;
1384-
xyv = (PyArrayObject *) PyArray_FromDims(2, dims, PyArray_DOUBLE);
1384+
xyv = (PyArrayObject *) PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
13851385
if (xyv == NULL) goto error;
13861386
for (j = 0; j < dims[0]; j++)
13871387
{

src/nxutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ points_inside_poly(PyObject *self, PyObject *args)
108108
PyObject *xypointsarg, *vertsarg, *ret;
109109
PyArrayObject *xypoints, *verts;
110110
PyArrayObject *mask;
111-
int dimensions[1];
111+
npy_intp dimensions[1];
112112

113113
if (! PyArg_ParseTuple(args, "OO", &xypointsarg, &vertsarg))
114114
return NULL;
@@ -187,7 +187,7 @@ points_inside_poly(PyObject *self, PyObject *args)
187187
npoints = xypoints->dimensions[0];
188188
dimensions[0] = npoints;
189189

190-
mask = (PyArrayObject *)PyArray_FromDims(1,dimensions,PyArray_INT);
190+
mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions,PyArray_INT);
191191
if (mask==NULL) {
192192
Py_XDECREF(verts);
193193
Py_XDECREF(xypoints);

0 commit comments

Comments
 (0)