Skip to content

Commit

Permalink
Fix shuffle passing
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Jun 21, 2024
1 parent 16e1806 commit 1abe5d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numcodecs/blosc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def cbuffer_complib(source):
"""Return the name of the compression library used to compress `source`."""
return blosc2.get_clib(source)

def compress(source, cname: bytes, clevel, shuffle=SHUFFLE, blocksize=AUTOBLOCKS):
def compress(source, cname: bytes, clevel, shuffle: int=SHUFFLE, blocksize=AUTOBLOCKS):
cname = cname.decode('ascii')
blosc2.set_blocksize(blocksize)
return blosc2.compress(source, codec=getattr(blosc2.Codec, cname.upper()), clevel=clevel, filter=shuffle)
return blosc2.compress(source, codec=getattr(blosc2.Codec, cname.upper()), clevel=clevel, filter=_shuffles[shuffle])


class Blosc(Codec):
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(self, cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=AUTOBLOCKS)

def encode(self, buf):
buf = ensure_contiguous_ndarray(buf, self.max_buffer_size)
return compress(buf, bytes(self.cname, 'ascii'), self.clevel, _shuffles[self.shuffle], self.blocksize)
return compress(buf, bytes(self.cname, 'ascii'), self.clevel, self.shuffle, self.blocksize)

def decode(self, buf, out=None):
buf = ensure_contiguous_ndarray(buf, self.max_buffer_size)
Expand Down

0 comments on commit 1abe5d5

Please sign in to comment.