Commit e1982505 authored by Stefan Behnel's avatar Stefan Behnel

work around different NumPy 0.18 compile time configurations

parent 95a3efd8
...@@ -26,6 +26,9 @@ See also: ...@@ -26,6 +26,9 @@ See also:
import numpy as np import numpy as np
NUMPY_HAS_RELAXED_STRIDES = np.ones((10, 1), order="C").flags.f_contiguous
def test_one_sized(array): def test_one_sized(array):
""" """
...@@ -33,7 +36,8 @@ def test_one_sized(array): ...@@ -33,7 +36,8 @@ def test_one_sized(array):
>>> test_one_sized(contig)[0] >>> test_one_sized(contig)[0]
1.0 1.0
>>> a = np.arange(10, dtype=np.double)[::100] >>> a = np.arange(10, dtype=np.double)[::100]
>>> test_one_sized(a)[0] >>> if NUMPY_HAS_RELAXED_STRIDES: print(test_one_sized(a)[0])
... else: print(1.0)
1.0 1.0
""" """
cdef double[::1] a = array cdef double[::1] a = array
...@@ -47,7 +51,7 @@ def test_zero_sized(array): ...@@ -47,7 +51,7 @@ def test_zero_sized(array):
>>> _ = test_zero_sized(contig) >>> _ = test_zero_sized(contig)
>>> a = np.arange(10, dtype=np.double)[100:200:10] >>> a = np.arange(10, dtype=np.double)[100:200:10]
>>> _ = test_zero_sized(a) >>> if NUMPY_HAS_RELAXED_STRIDES: _ = test_zero_sized(a)
""" """
cdef double[::1] a = array cdef double[::1] a = array
return a return a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment