We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 663cfe1 commit 2f332b1Copy full SHA for 2f332b1
1 file changed
src/blosc2/dict_store.py
@@ -397,7 +397,20 @@ def __setitem__(
397
398
# Save the value to the destination path
399
if not external_file:
400
- if hasattr(value, "save"):
+ if isinstance(value, blosc2.NDArray) and "b2o" in value.schunk.meta:
401
+ carrier = blosc2.empty(
402
+ value.shape,
403
+ value.dtype,
404
+ chunks=value.chunks,
405
+ blocks=value.blocks,
406
+ cparams=value.cparams,
407
+ urlpath=dest_path,
408
+ mode="w",
409
+ meta={"b2o": value.schunk.meta["b2o"]},
410
+ )
411
+ for meta_key, meta_value in value.schunk.vlmeta[:].items():
412
+ carrier.schunk.vlmeta[meta_key] = meta_value
413
+ elif hasattr(value, "save"):
414
value.save(urlpath=dest_path)
415
else:
416
# SChunk, VLArray and BatchStore can all be persisted via their cframe.
0 commit comments