Skip to content

Commit

Permalink
zarr support
Browse files Browse the repository at this point in the history
  • Loading branch information
nritsche committed Apr 19, 2021
1 parent 0a0655a commit 1a61bcc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions caput/fileformats.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import bitshuffle.h5
import h5py
import numcodecs
import zarr

# Copied from https://github.com/kiyo-masui/bitshuffle/blob/master/src/bshuf_h5filter.h
BSHUF_H5FILTER = 32008
BSHUF_H5_COMPRESS_LZ4 = 2

class FileFormat:
"""Abstract base class for file formats supported by this module."""
Expand Down Expand Up @@ -68,9 +70,9 @@ def compression_kwargs(compression=None, compression_opts=None, compressor=None)
if compression:
if compression == "gzip":
return {"compressor": numcodecs.gzip.GZip(level=compression_opts)}
elif compression == bitshuffle.h5.H5FILTER:
elif compression == BSHUF_H5FILTER:
blocksize, c = compression_opts
if c == bitshuffle.h5.H5_COMPRESS_LZ4:
if c == BSHUF_H5_COMPRESS_LZ4:
cname = "lz4"
else:
raise ValueError(
Expand Down

0 comments on commit 1a61bcc

Please sign in to comment.