Exemple #1
0
 def test_recarray(self):
     arr = np.rec.fromarrays(np.arange(6).reshape(2, 3), names='x, y').view(np.recarray)
     assert arr.dtype.type is np.record
     stream = io.BytesIO()
     write_blosc(stream, arr)
     stream.seek(0)
     out = read_blosc(stream)
     assert isinstance(out, np.recarray)
     assert out.dtype == arr.dtype
     assert out.dtype.type is np.record
Exemple #2
0
 def test_comp_name(self, array, compression, shuffle, stream, length):
     stream2 = io.BytesIO()
     length2 = write_blosc(stream2, array, 'blosc:' + compression, 5, shuffle)
     assert length2 == length
     assert stream2.getvalue() == stream.getvalue()
Exemple #3
0
def write_result(array, compression, shuffle):
    stream = io.BytesIO()
    length = write_blosc(stream, array, compression, 5, shuffle)
    return (stream, length)