File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -231,3 +231,24 @@ def create_chunk(self, **kwargs):
231
231
lambda : os .remove (path ) if os .path .exists (path ) else None
232
232
)
233
233
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
You can’t perform that action at this time.
0 commit comments