| Issue 6: | Using Python 2.6 triggers depreciation warnings | |
| 1 person starred this issue and may be notified of changes. | Back to list |
optimize.py:62: DeprecationWarning: PyArray_FromDims: use PyArray_SimpleNew. opt, zl, zu, obj = nlp.solve(x_0) optimize.py:62: DeprecationWarning: PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr.
May 1, 2009
Project Member
#1
xu.mathena
Aug 25, 2009
(No comment was entered for this change.)
Labels:
-Type-Defect Type-Task
Dec 29, 2010
This is pretty simple to fix.
For the dims and dims declarations, use npy_intp instead of int. e.g.
npy_intp dims[1];
Instead of using
PyObject *arrayx = PyArray_FromDimsAndData(1, dims, PyArray_DOUBLE , (char*) x);
use this
PyObject *arrayx = PyArray_SimpleNewFromData(1, dims, PyArray_DOUBLE, (char*) x);
Instead of using
x = (PyArrayObject *)PyArray_FromDims( 1, dX, PyArray_DOUBLE );
use this
x = (PyArrayObject *)PyArray_SimpleNew( 1, dX, PyArray_DOUBLE );
Mar 11, 2011
fixed according to herbschilling's suggestions.
Status:
Fixed
|