module documentation

Test the .npy file format.

Set up:

>>> import sys
>>> from io import BytesIO
>>> from numpy.lib import format
>>>
>>> scalars = [
...     np.uint8,
...     np.int8,
...     np.uint16,
...     np.int16,
...     np.uint32,
...     np.int32,
...     np.uint64,
...     np.int64,
...     np.float32,
...     np.float64,
...     np.complex64,
...     np.complex128,
...     object,
... ]
>>>
>>> basic_arrays = []
>>>
>>> for scalar in scalars:
...     for endian in '<>':
...         dtype = np.dtype(scalar).newbyteorder(endian)
...         basic = np.arange(15).astype(dtype)
...         basic_arrays.extend([
...             np.array([], dtype=dtype),
...             np.array(10, dtype=dtype),
...             basic,
...             basic.reshape((3,5)),
...             basic.reshape((3,5)).T,
...             basic.reshape((3,5))[::-1,::2],
...         ])
...
>>>
>>> Pdescr = [
...     ('x', 'i4', (2,)),
...     ('y', 'f8', (2, 2)),
...     ('z', 'u1')]
>>>
>>>
>>> PbufferT = [
...     ([3,2], [[6.,4.],[6.,4.]], 8),
...     ([4,3], [[7.,5.],[7.,5.]], 9),
...     ]
>>>
>>>
>>> Ndescr = [
...     ('x', 'i4', (2,)),
...     ('Info', [
...         ('value', 'c16'),
...         ('y2', 'f8'),
...         ('Info2', [
...             ('name', 'S2'),
...             ('value', 'c16', (2,)),
...             ('y3', 'f8', (2,)),
...             ('z3', 'u4', (2,))]),
...         ('name', 'S2'),
...         ('z2', 'b1')]),
...     ('color', 'S2'),
...     ('info', [
...         ('Name', 'U8'),
...         ('Value', 'c16')]),
...     ('y', 'f8', (2, 2)),
...     ('z', 'u1')]
>>>
>>>
>>> NbufferT = [
...     ([3,2], (6j, 6., ('nn', [6j,4j], [6.,4.], [1,2]), 'NN', True), 'cc', ('NN', 6j), [[6.,4.],[6.,4.]], 8),
...     ([4,3], (7j, 7., ('oo', [7j,5j], [7.,5.], [2,1]), 'OO', False), 'dd', ('OO', 7j), [[7.,5.],[7.,5.]], 9),
...     ]
>>>
>>>
>>> record_arrays = [
...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('<')),
...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('<')),
...     np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('>')),
...     np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('>')),
... ]

Test the magic string writing.

>>> format.magic(1, 0)
'\x93NUMPY\x01\x00'
>>> format.magic(0, 0)
'\x93NUMPY\x00\x00'
>>> format.magic(255, 255)
'\x93NUMPY\xff\xff'
>>> format.magic(2, 5)
'\x93NUMPY\x02\x05'

Test the magic string reading.

>>> format.read_magic(BytesIO(format.magic(1, 0)))
(1, 0)
>>> format.read_magic(BytesIO(format.magic(0, 0)))
(0, 0)
>>> format.read_magic(BytesIO(format.magic(255, 255)))
(255, 255)
>>> format.read_magic(BytesIO(format.magic(2, 5)))
(2, 5)

Test the header writing.

>>> for arr in basic_arrays + record_arrays:
...     f = BytesIO()
...     format.write_array_header_1_0(f, arr)   # XXX: arr is not a dict, items gets called on it
...     print(repr(f.getvalue()))
...
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '|u1', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '|u1', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '|u1', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '|i1', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '|i1', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '|i1', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<u2', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<u2', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<u2', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>u2', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>u2', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>u2', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<i2', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<i2', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<i2', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>i2', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>i2', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>i2', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<u4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<u4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<u4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>u4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>u4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>u4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<i4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<i4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<i4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>i4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>i4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>i4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<u8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<u8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<u8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>u8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>u8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>u8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<i8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<i8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<i8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>i8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>i8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>i8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<f4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<f4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<f4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>f4', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>f4', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>f4', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<f8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<f8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<f8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>f8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>f8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>f8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '<c8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '<c8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '<c8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': '>c8', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': '>c8', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': '>c8', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (0,)}             \n"
"F\x00{'descr': '<c16', 'fortran_order': False, 'shape': ()}               \n"
"F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (15,)}            \n"
"F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (3, 5)}           \n"
"F\x00{'descr': '<c16', 'fortran_order': True, 'shape': (5, 3)}            \n"
"F\x00{'descr': '<c16', 'fortran_order': False, 'shape': (3, 3)}           \n"
"F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (0,)}             \n"
"F\x00{'descr': '>c16', 'fortran_order': False, 'shape': ()}               \n"
"F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (15,)}            \n"
"F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (3, 5)}           \n"
"F\x00{'descr': '>c16', 'fortran_order': True, 'shape': (5, 3)}            \n"
"F\x00{'descr': '>c16', 'fortran_order': False, 'shape': (3, 3)}           \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': 'O', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 3)}            \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (0,)}              \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': ()}                \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (15,)}             \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 5)}            \n"
"F\x00{'descr': 'O', 'fortran_order': True, 'shape': (5, 3)}             \n"
"F\x00{'descr': 'O', 'fortran_order': False, 'shape': (3, 3)}            \n"
"v\x00{'descr': [('x', '<i4', (2,)), ('y', '<f8', (2, 2)), ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}         \n"
"\x16\x02{'descr': [('x', '<i4', (2,)),\n           ('Info',\n            [('value', '<c16'),\n             ('y2', '<f8'),\n             ('Info2',\n              [('name', '|S2'),\n               ('value', '<c16', (2,)),\n               ('y3', '<f8', (2,)),\n               ('z3', '<u4', (2,))]),\n             ('name', '|S2'),\n             ('z2', '|b1')]),\n           ('color', '|S2'),\n           ('info', [('Name', '<U8'), ('Value', '<c16')]),\n           ('y', '<f8', (2, 2)),\n           ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}      \n"
"v\x00{'descr': [('x', '>i4', (2,)), ('y', '>f8', (2, 2)), ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}         \n"
"\x16\x02{'descr': [('x', '>i4', (2,)),\n           ('Info',\n            [('value', '>c16'),\n             ('y2', '>f8'),\n             ('Info2',\n              [('name', '|S2'),\n               ('value', '>c16', (2,)),\n               ('y3', '>f8', (2,)),\n               ('z3', '>u4', (2,))]),\n             ('name', '|S2'),\n             ('z2', '|b1')]),\n           ('color', '|S2'),\n           ('info', [('Name', '>U8'), ('Value', '>c16')]),\n           ('y', '>f8', (2, 2)),\n           ('z', '|u1')],\n 'fortran_order': False,\n 'shape': (2,)}      \n"
Variable bad​_version​_magic Undocumented
Variable basic Undocumented
Variable basic​_arrays Undocumented
Variable dt1 Undocumented
Variable dt2 Undocumented
Variable dt3 Undocumented
Variable dt4 Undocumented
Variable dt5 Undocumented
Variable dt6 Undocumented
Variable dtype Undocumented
Variable malformed​_magic Undocumented
Variable ​Nbuffer​T Undocumented
Variable ​Ndescr Undocumented
Variable ​Pbuffer​T Undocumented
Variable ​Pdescr Undocumented
Variable record​_arrays Undocumented
Variable scalars Undocumented
Class ​Bytes​IOSRandom​Size Undocumented
Function assert​_equal​_ Undocumented
Function roundtrip Undocumented
Function roundtrip​_randsize Undocumented
Function roundtrip​_truncated Undocumented
Function test​_bad​_header Undocumented
Function test​_bad​_magic​_args Undocumented
Function test​_compressed​_roundtrip Undocumented
Function test​_descr​_to​_dtype Undocumented
Function test​_empty​_npz Undocumented
Function test​_large​_archive Undocumented
Function test​_large​_file​_support Undocumented
Function test​_large​_header Undocumented
Function test​_load​_padded​_dtype Undocumented
Function test​_long​_str Undocumented
Function test​_memmap​_roundtrip Undocumented
Function test​_metadata​_dtype Undocumented
Function test​_pickle​_disallow Undocumented
Function test​_pickle​_python2​_python3 Undocumented
Function test​_python2​_python3​_interoperability Undocumented
Function test​_read​_array​_header​_1​_0 Undocumented
Function test​_read​_array​_header​_2​_0 Undocumented
Function test​_read​_magic Undocumented
Function test​_read​_magic​_bad​_magic Undocumented
Function test​_read​_version​_1​_0​_bad​_magic Undocumented
Function test​_roundtrip Undocumented
Function test​_roundtrip​_randsize Undocumented
Function test​_roundtrip​_truncated Undocumented
Function test​_unicode​_field​_names Undocumented
Function test​_version​_2​_0 Undocumented
Function test​_version​_2​_0​_memmap Undocumented
Function test​_write​_version Undocumented
bad_version_magic: list[bytes] =

Undocumented

basic =

Undocumented

basic_arrays: list =

Undocumented

dt1 =

Undocumented

dt2 =

Undocumented

dt3 =

Undocumented

dt4 =

Undocumented

dt5 =

Undocumented

dt6 =

Undocumented

dtype =

Undocumented

malformed_magic: list[bytes] =

Undocumented

NbufferT: list[tuple] =

Undocumented

Ndescr: list =

Undocumented

PbufferT: list[tuple] =

Undocumented

Pdescr: list =

Undocumented

record_arrays =

Undocumented

scalars =

Undocumented

def assert_equal_(o1, o2):

Undocumented

def roundtrip(arr):

Undocumented

def roundtrip_randsize(arr):

Undocumented

def roundtrip_truncated(arr):

Undocumented

def test_bad_header():

Undocumented

def test_bad_magic_args():

Undocumented

def test_compressed_roundtrip(tmpdir):

Undocumented

@pytest.mark.parametrize('dt', [np.dtype(np.dtype([('a', np.int8), ('b', np.int16), ('c', np.int32)], align=True), (3)), np.dtype([('x', np.dtype({'names': ['a', 'b'], 'formats': ['i1', 'i1'], 'offsets': [0, 4], 'itemsize': 8}, (3)), (4))]), np.dtype([('x', ('<f8', (5)), (2))]), np.dtype([('x', np.dtype((np.dtype((np.dtype({'names': ['a', 'b'], 'formats': ['i1', 'i1'], 'offsets': [0, 4], 'itemsize': 8}), (3))), (4))))]), np.dtype([('a', np.dtype((np.dtype((np.dtype((np.dtype([('a', int), ('b', np.dtype({'names': ['a', 'b'], 'formats': ['i1', 'i1'], 'offsets': [0, 4], 'itemsize': 8}))]), (3))), (4))), (5))))])])
def test_descr_to_dtype(dt):

Undocumented

def test_empty_npz(tmpdir):

Undocumented

@pytest.mark.skipif((np.dtype(np.intp).itemsize < 8), reason='test requires 64-bit system')
@pytest.mark.slow
def test_large_archive(tmpdir):

Undocumented

def test_large_file_support(tmpdir):

Undocumented

def test_large_header():

Undocumented

@pytest.mark.parametrize('dt', [dt1, dt2, dt3, dt4, dt5, dt6])
def test_load_padded_dtype(tmpdir, dt):

Undocumented

def test_long_str():

Undocumented

def test_memmap_roundtrip(tmpdir):

Undocumented

@pytest.mark.parametrize('dt, fail', [(np.dtype({'names': ['a', 'b'], 'formats': [float, np.dtype('S3', metadata={'some': 'stuff'})]}), True), (np.dtype(int, metadata={'some': 'stuff'}), False), (np.dtype([('subarray', (int, (2)))], metadata={'some': 'stuff'}), False), (np.dtype({'names': ['a', 'b'], 'formats': [float, np.dtype({'names': ['c'], 'formats': [np.dtype(int, metadata={})]})]}), False)])
def test_metadata_dtype(dt, fail):

Undocumented

def test_pickle_disallow(tmpdir):

Undocumented

def test_pickle_python2_python3():

Undocumented

def test_python2_python3_interoperability():

Undocumented

def test_read_array_header_1_0():

Undocumented

def test_read_array_header_2_0():

Undocumented

def test_read_magic():

Undocumented

def test_read_magic_bad_magic():

Undocumented

def test_read_version_1_0_bad_magic():

Undocumented

def test_roundtrip():

Undocumented

def test_roundtrip_randsize():

Undocumented

def test_roundtrip_truncated():

Undocumented

def test_unicode_field_names(tmpdir):

Undocumented

def test_version_2_0():

Undocumented

def test_version_2_0_memmap(tmpdir):

Undocumented

def test_write_version():

Undocumented