[Numpy-discussion] ticket 788: possible blocker

Eric Firing efiring at hawaii.edu
Sat May 10 18:09:00 EDT 2008


I have added a patch to the ticket.  I believe it fixes the problem.  It 
required mirroring a very complicated logical expression from 
PyArray_CastToType in array_cast.  I suspect that for readability, this 
expression should be encapsulated somewhere as a function, with a 
signature like

int PyArray_EquivDescr(PyArray_Descr *descr1, PyArray_Descr *descr2)

returning True if they are equivalent.  I don't understand the 
conditions well enough to be confident about this, however.

Eric

Eric Firing wrote:
> Jarrod et al.,
> 
> I just ran into a nasty bug, described in ticket 788: under some 
> circumstances, which I don't understand, the astype method fails to 
> return a copy and returns the original array instead. It causes bizarre 
> behavior in basemap (Jeff Whitaker's mapping toolkit for matplotlib), 
> which is where I stumbled over it.
> 
> The ticket includes a pickled array that illustrates the behavior with 
> 1.2.0.dev5150--at least on my system (ubuntu feisty, 32-bit).
> 
> Eric
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list