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

Ralf Gommers ralf.gommers@googlemail....
Thu Sep 8 14:59:50 CDT 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110908/320732b5/attachment.html 


More information about the NumPy-Discussion mailing list