Add explicit test for recarray format descriptors

This commit is contained in:
Ivan Smirnov
2016-06-19 16:54:07 +01:00
parent 7f913aecab
commit bdc9902041
3 changed files with 15 additions and 1 deletions

View File

@@ -2,12 +2,16 @@
from __future__ import print_function
import numpy as np
from example import create_rec_simple, create_rec_packed, create_rec_nested
from example import (
create_rec_simple, create_rec_packed, create_rec_nested, print_format_descriptors
)
def check_eq(arr, data, dtype):
np.testing.assert_equal(arr, np.array(data, dtype=dtype))
print_format_descriptors()
simple_dtype = np.dtype({'names': ['x', 'y', 'z'],
'formats': ['?', 'u4', 'f4'],
'offsets': [0, 4, 8]})