Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asdf_compression/blsc/compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ class BloscCompressor(Compressor):
def compress(self, data, **kwargs):
import blosc

yield blosc.compress(data, **kwargs)
# Type size, necessary for shuffle filter efficiency
# TODO: This should be the type size of the data actually stored, not just "byte" or "uint8"
typesize = data.itemsize

yield blosc.compress(data, typesize=typesize, **kwargs)

def decompress(self, data, out, **kwargs):
import blosc

# TODO: call `self._api.decompress_ptr` instead to avoid copying the output
out[:] = blosc.decompress(b"".join(data), **kwargs)
return out.nbytes