Skip to content

Commit 8bf3915

Browse files
committed
(fix): ensure no typesize in the Blosc config
1 parent 3438e16 commit 8bf3915

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

numcodecs/blosc.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ class Blosc(Codec):
489489
self.clevel = clevel
490490
self.shuffle = shuffle
491491
self.blocksize = blocksize
492-
self.typesize = typesize
492+
self._typesize = typesize
493493

494494
def encode(self, buf):
495495
buf = ensure_contiguous_ndarray(buf, self.max_buffer_size)
496-
return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize, self.typesize)
496+
return compress(buf, self._cname_bytes, self.clevel, self.shuffle, self.blocksize, self._typesize)
497497

498498
def decode(self, buf, out=None):
499499
buf = ensure_contiguous_ndarray(buf, self.max_buffer_size)

numcodecs/tests/test_blosc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,9 @@ def test_typesize_less_than_1():
282282
arr = np.arange(100)
283283
with pytest.raises(ValueError, match=r"Cannot use typesize"):
284284
compressor.encode(arr.tobytes())
285+
286+
287+
def test_config_no_typesize():
288+
codec = Blosc(shuffle=Blosc.SHUFFLE, typesize=5)
289+
config = codec.get_config()
290+
assert "typesize" not in config

0 commit comments

Comments
 (0)