strange test failure in Cython code with numpy master
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/4ade7829649b9e2c251f5f7f370781b16fc..., 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
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@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/4ade7829649b9e2c251f5f7f370781b16fc..., 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@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
Mark Wiebe
-
Ralf Gommers