[Cython] "relaxed_strides" test broken with NumPy 1.8
robertwb at gmail.com
Sat Jan 4 17:40:16 CET 2014
Excellent, thanks. I'll make sure this gets into the release.
On Sat, Jan 4, 2014 at 6:46 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Stefan Behnel, 04.01.2014 12:53:
>> mark florisson, 03.01.2014 23:28:
>>> On 3 January 2014 18:22, Stefan Behnel wrote:
>>>> I enabled the NumPy build for our Py3.3 test runs and while I was at it, I
>>>> got it to use the latest NumPy release 1.8. This made one of the tests fail:
>>>> Traceback (most recent call last):
>>>> File ".../doctest.py", line 1313, in __run
>>>> compileflags, 1), test.globs)
>>>> File "<doctest relaxed_strides.__test__.test_one_sized (line
>>>> 29)>", line 1, in <module>
>>>> File "relaxed_strides.pyx", line 38, in
>>>> relaxed_strides.test_one_sized (relaxed_strides.cpp:1414)
>>>> File "stringsource", line 622, in View.MemoryView.memoryview_cwrapper
>>>> File "stringsource", line 327, in
>>>> View.MemoryView.memoryview.__cinit__ (relaxed_strides.cpp:3717)
>>>> ValueError: ndarray is not C-contiguous
>>>> According to the comments in the test file and the corresponding NumPy pull
>>>> request, this seems to be somewhat expected.
>>>> Does someone know enough about this to figure out what to do?
>>> It seems to come from the call to __Pyx_GetBuffer, which is
>>> PyObject_GetBuffer in python 3. Maybe this is Python 3 not checking
>>> for an extent of 1, but instead only checking the stride (which is a
>>> multiple of the itemsize)?
>> No, Py3 doesn't do any validation here, it does a straight call into the
>> object's slot function, i.e. into the NumPy array itself.
>> So, the question is: who's wrong here? The test or NumPy?
>> Hmm, or maybe just me. I didn't define the NPY_RELAXED_STRIDES_CHECKING
>> environment variable for the NumPy build. Let's try that first.
> Yep, that was it. Seems to work nicely now.
> cython-devel mailing list
> cython-devel at python.org
More information about the cython-devel