[Numpy-discussion] strange test failure in Cython code with numpy master
Thu Sep 8 15:24:37 CDT 2011
Probably has something to do with 'arr' having a statically defined type of
On Thu, Sep 8, 2011 at 12:59 PM, Ralf Gommers
> There's a test failure in scipy/io/matlab/mio_utils that shows up with
> numpy master but not 1.5.1, see
> 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?
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion