My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 6: Using Python 2.6 triggers depreciation warnings
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Mar 2011


 
Reported by jorn.baa...@gmail.com, Apr 1, 2009
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
yes, it doesnot support py2.6 very well
Aug 25, 2009
Project Member #2 xu.mathena
(No comment was entered for this change.)
Labels: -Type-Defect Type-Task
Dec 29, 2010
Project Member #3 herbschi...@gmail.com
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
Project Member #4 xu.mathena
fixed according to herbschilling's suggestions. 
Status: Fixed

Powered by Google Project Hosting