Skip to content

Commit 9865932

Browse files
committed
Merge pull request #12 from alimanfoo/upgrade_blosc_1_8_1
Upgrade blosc v1.8.1; close #10.
2 parents 6b215fa + fb807b9 commit 9865932

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

zarr/tests/test_chunk.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,24 @@ def create_chunk(self, **kwargs):
231231
lambda: os.remove(path) if os.path.exists(path) else None
232232
)
233233
return SynchronizedPersistentChunk(**kwargs)
234+
235+
236+
def test_shuffles():
237+
238+
# setup
239+
a = np.arange(256, dtype='u1')
240+
# no shuffle
241+
c0 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=0)
242+
c0[:] = a
243+
# byte shuffle
244+
c1 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=1)
245+
c1[:] = a
246+
# bit shuffle
247+
c2 = Chunk(shape=a.shape, dtype=a.dtype, shuffle=2)
248+
c2[:] = a
249+
250+
# expect no effect of byte shuffle because using single byte dtype
251+
assert c0.cbytes == c1.cbytes
252+
253+
# expect improvement from bitshuffle
254+
assert c2.cbytes < c1.cbytes

0 commit comments

Comments
 (0)