Skip to content

Commit 1a58948

Browse files
authored
Clarify memory conversion in blosc encoding
Add comments to clarify memory conversion in encoding.
1 parent f27c2a2 commit 1a58948

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/zarr/codecs/blosc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ def _encode_sync(
318318
chunk_bytes: Buffer,
319319
chunk_spec: ArraySpec,
320320
) -> Buffer | None:
321+
# Since blosc only support host memory, we convert the input and output of the encoding
322+
# between numpy array and buffer
321323
return chunk_spec.prototype.buffer.from_bytes(
322324
self._blosc_codec.encode(chunk_bytes.as_numpy_array())
323325
)

0 commit comments

Comments
 (0)