From 244a1e1482631db89e7290047c18066df66ecd4b Mon Sep 17 00:00:00 2001 From: Alistair Miles Date: Mon, 11 Apr 2016 21:20:34 +0100 Subject: [PATCH 1/2] move c-blosc to v1.8.1 --- c-blosc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-blosc b/c-blosc index 824f31b540..25780abdec 160000 --- a/c-blosc +++ b/c-blosc @@ -1 +1 @@ -Subproject commit 824f31b5401904d82a74aa86fbde18db9fc48a4a +Subproject commit 25780abdec0c63c7188df1e66ce92ca6a60eebe1 From fb807b943bdc13a0970c62edb80718b155704648 Mon Sep 17 00:00:00 2001 From: Alistair Miles Date: Mon, 11 Apr 2016 21:42:12 +0100 Subject: [PATCH 2/2] add test for effect of bitshuffle --- zarr/tests/test_chunk.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/zarr/tests/test_chunk.py b/zarr/tests/test_chunk.py index 233ae6ef05..32f3899acb 100644 --- a/zarr/tests/test_chunk.py +++ b/zarr/tests/test_chunk.py @@ -231,3 +231,24 @@ def create_chunk(self, **kwargs): lambda: os.remove(path) if os.path.exists(path) else None ) return SynchronizedPersistentChunk(**kwargs) + + +def test_shuffles(): + + # setup + a = np.arange(256, dtype='u1') + # no shuffle + c0 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=0) + c0[:] = a + # byte shuffle + c1 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=1) + c1[:] = a + # bit shuffle + c2 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=2) + c2[:] = a + + # expect no effect of byte shuffle because using single byte dtype + assert c0.cbytes == c1.cbytes + + # expect improvement from bitshuffle + assert c2.cbytes < c1.cbytes