diff --git a/ocf_blosc2/__init__.py b/ocf_blosc2/__init__.py index a602d0c..116858a 100644 --- a/ocf_blosc2/__init__.py +++ b/ocf_blosc2/__init__.py @@ -1 +1,2 @@ +""" Main init file """ from .ocf_blosc2 import Blosc2 diff --git a/ocf_blosc2/ocf_blosc2.py b/ocf_blosc2/ocf_blosc2.py index c42b887..0e39fd7 100644 --- a/ocf_blosc2/ocf_blosc2.py +++ b/ocf_blosc2/ocf_blosc2.py @@ -1,3 +1,4 @@ +""" Main code file """ import blosc2 from numcodecs.abc import Codec from numcodecs.compat import ensure_contiguous_ndarray @@ -22,7 +23,7 @@ class Blosc2(Codec): codec_id = "blosc2" max_buffer_size = 2**31 - 1 - def __init__(self, cname="blosc2", clevel=5): + def __init__(self, cname="blosc2", clevel=5): # noqa self.cname = cname if cname == "zstd": self._codec = blosc2.Codec.ZSTD @@ -31,10 +32,12 @@ def __init__(self, cname="blosc2", clevel=5): self.clevel = clevel def encode(self, buf): + """ Encode method """ buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return blosc2.compress(buf, codec=self._codec, clevel=self.clevel) def decode(self, buf, out=None): + """ Decode method """ buf = ensure_contiguous_ndarray(buf, self.max_buffer_size) return blosc2.decompress(buf, out)