zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

Deserializing arrays should not trigger load_metadata

Open rabernat opened this issue 1 year ago • 0 comments

Currently the __setstate__ method on Array just calls __init__.

https://github.com/zarr-developers/zarr-python/blob/6105ef203e3e5c5390aa01db613bc42e8fb98c1a/zarr/core.py#L2567-L2568

And __init__ contains a call to load_metadata

https://github.com/zarr-developers/zarr-python/blob/6105ef203e3e5c5390aa01db613bc42e8fb98c1a/zarr/core.py#L169-L170

This really doesn't make much sense. We should serialize the metadata up with the array.

rabernat avatar Apr 16 '24 01:04 rabernat