[Numpy-discussion] Ransom Proposals

Travis Oliphant oliphant at ee.byu.edu
Mon Mar 27 10:48:03 CST 2006


>
> Ravel in turn, returns self if the array is already flat (line 187 of 
> multiarray_module.c):
>
>        if (!fortran && PyArray_ISCONTIGUOUS(a)) {
>            if (a->nd == 1) {
>                Py_INCREF(a);
>                return (PyObject *)a;
>            }
>            return PyArray_Newshape(a, &newdim, PyArray_CORDER);
>        }


I just eliminated this so that .ravel() always returns a new view.  I 
can see this optimization leads to an undesirable inconsistency.

I also added a special case for FORTRANORDER arrays so that is 
consistent with the CORDER case as well.


-Travis





More information about the Numpy-discussion mailing list