Commit b22b91af authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Better check for broken NumPy install

parent 12f3971c
...@@ -17,6 +17,8 @@ try: ...@@ -17,6 +17,8 @@ try:
import numpy as np import numpy as np
__doc__ = u""" __doc__ = u"""
>>> assert_dtype_sizes()
>>> basic() >>> basic()
[[0 1 2 3 4] [[0 1 2 3 4]
[5 6 7 8 9]] [5 6 7 8 9]]
...@@ -209,6 +211,20 @@ except: ...@@ -209,6 +211,20 @@ except:
__doc__ = u"" __doc__ = u""
def assert_dtype_sizes():
assert sizeof(np.int8_t) == 1
assert sizeof(np.int16_t) == 2
assert sizeof(np.int32_t) == 4
assert sizeof(np.int64_t) == 8
assert sizeof(np.uint8_t) == 1
assert sizeof(np.uint16_t) == 2
assert sizeof(np.uint32_t) == 4
assert sizeof(np.uint64_t) == 8
assert sizeof(np.float32_t) == 4
assert sizeof(np.float64_t) == 8
assert sizeof(np.complex64_t) == 8
assert sizeof(np.complex128_t) == 16
def ndarray_str(arr): def ndarray_str(arr):
u""" u"""
Since Py2.3 doctest don't support <BLANKLINE>, manually replace blank lines Since Py2.3 doctest don't support <BLANKLINE>, manually replace blank lines
......
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