[Numpy-discussion] strange test failure in Cython code with numpy master

Mark Wiebe mwwiebe at gmail.com
Thu Sep 8 16:24:37 EDT 2011


Probably has something to do with 'arr' having a statically defined type of
cnp.ndarray.

-Mark

On Thu, Sep 8, 2011 at 12:59 PM, Ralf Gommers
<ralf.gommers at googlemail.com>wrote:

> Hi,
>
> There's a test failure in scipy/io/matlab/mio_utils that shows up with
> numpy master but not 1.5.1, see
> http://projects.scipy.org/scipy/ticket/1512
> I have a fix here:
> https://github.com/rgommers/scipy/commit/4ade7829649b9e2c251f5f7f370781b16fc13612, but I don't really understand why the code is failing in the first place.
> This is the relevant part:
>
> -    arr = np.squeeze(arr)
> -    if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar
> -        return arr.item()
> -    return arr
> +    arr2 = np.squeeze(arr)
> +    if (not arr2.shape) and arr2.dtype.isbuiltin: # 0d coverted to scalar
> +        return arr2.item()
> +    return arr2
>
> All it does is rename arr to arr2. It fails with both Cython 0.13 and 0.15.
> Any idea?
>
> Ralf
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110908/438f0dea/attachment.html>


More information about the NumPy-Discussion mailing list