<p dir="ltr">On 4 Jan 2014 17:07, "Robert Bradshaw" <<a href="mailto:robertwb@gmail.com">robertwb@gmail.com</a>> wrote:<br>
><br>
> Yes, that'd be good. Do you know how? I won't have time to look at this 'till next week.</p>
<p dir="ltr">Something like</p>
<p dir="ltr">if not np.ones((10, 1), order="C").flags.f_contiguous:<br>
  # numpy without relaxed stride support<br>
  raise SkipTest</p>
<p dir="ltr">> On Jan 4, 2014 9:54 AM, "Nathaniel Smith" <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
>><br>
>> On 4 Jan 2014 11:53, "Stefan Behnel" <<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>> wrote:<br>
>> ><br>
>> > mark florisson, 03.01.2014 23:28:<br>
>> > > On 3 January 2014 18:22, Stefan Behnel wrote:<br>
>> > >> I enabled the NumPy build for our Py3.3 test runs and while I was at it, I<br>
>> > >> got it to use the latest NumPy release 1.8. This made one of the tests fail:<br>
>> > >><br>
>> > >> """<br>
>> > >>     Traceback (most recent call last):<br>
>> > >>       File ".../doctest.py", line 1313, in __run<br>
>> > >>         compileflags, 1), test.globs)<br>
>> > >>       File "<doctest relaxed_strides.__test__.test_one_sized (line<br>
>> > >> 29)[3]>", line 1, in <module><br>
>> > >>         test_one_sized(a)[0]<br>
>> > >>       File "relaxed_strides.pyx", line 38, in<br>
>> > >> relaxed_strides.test_one_sized (relaxed_strides.cpp:1414)<br>
>> > >>       File "stringsource", line 622, in View.MemoryView.memoryview_cwrapper<br>
>> > >> (relaxed_strides.cpp:7568)<br>
>> > >>       File "stringsource", line 327, in<br>
>> > >> View.MemoryView.memoryview.__cinit__ (relaxed_strides.cpp:3717)<br>
>> > >><br>
>> > >>     ValueError: ndarray is not C-contiguous<br>
>> > >> """<br>
>> > >><br>
>> > >> <a href="https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests/1787/ARCH=m64,BACKEND=cpp,PYVERSION=py33m/console">https://sage.math.washington.edu:8091/hudson/job/cython-devel-tests/1787/ARCH=m64,BACKEND=cpp,PYVERSION=py33m/console</a><br>

>> > >><br>
>> > >> According to the comments in the test file and the corresponding NumPy pull<br>
>> > >> request, this seems to be somewhat expected.<br>
>> > >><br>
>> > >> <a href="https://github.com/cython/cython/blob/master/tests/memoryview/relaxed_strides.pyx">https://github.com/cython/cython/blob/master/tests/memoryview/relaxed_strides.pyx</a><br>
>> > >><br>
>> > >> <a href="https://github.com/numpy/numpy/pull/3162">https://github.com/numpy/numpy/pull/3162</a><br>
>> > >><br>
>> > >> Does someone know enough about this to figure out what to do?<br>
>> > ><br>
>> > > It seems to come from the call to __Pyx_GetBuffer, which is<br>
>> > > PyObject_GetBuffer in python 3. Maybe this is Python 3 not checking<br>
>> > > for an extent of 1, but instead only checking the stride (which is a<br>
>> > > multiple of the itemsize)?<br>
>> ><br>
>> > No, Py3 doesn't do any validation here, it does a straight call into the<br>
>> > object's slot function, i.e. into the NumPy array itself.<br>
>> ><br>
>> > So, the question is: who's wrong here? The test or NumPy?<br>
>> ><br>
>> > Hmm, or maybe just me. I didn't define the NPY_RELAXED_STRIDES_CHECKING<br>
>> > environment variable for the NumPy build. Let's try that first.<br>
>> ><br>
>> > <a href="http://docs.scipy.org/doc/numpy/release.html#npy-relaxed-strides-checking">http://docs.scipy.org/doc/numpy/release.html#npy-relaxed-strides-checking</a><br>
>><br>
>> It's probably nicer though to write the Cython tests in such a way that they can pass against a default numpy installation? To avoid user confusion and all that.<br>
>><br>
>> If those tests depend on numpy having relaxed strides enabled, then I'd suggest checking for this a test time and skipping the tests if not found. The relaxed strides docs give a recipe for determining how numpy was built.<br>

>><br>
>> -n<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cython-devel mailing list<br>
>> <a href="mailto:cython-devel@python.org">cython-devel@python.org</a><br>
>> <a href="https://mail.python.org/mailman/listinfo/cython-devel">https://mail.python.org/mailman/listinfo/cython-devel</a><br>
>><br>
><br>
> _______________________________________________<br>
> cython-devel mailing list<br>
> <a href="mailto:cython-devel@python.org">cython-devel@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/cython-devel">https://mail.python.org/mailman/listinfo/cython-devel</a><br>
><br>
</p>