You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In zarr-python 3, arrays and groups don't have their own read / write permission model, instead all of that is handled by the storage layer.
Thus the read_only property was added for backwards compatibility with v2, and it doesn't do what you would expect -- it reports whether the array is backed by a read-only store.. So in your example, because you are re-using a store instance, it keeps its original mode (which is probably a). I agree that this is confusing.
i believe open_array has a mode parameter for backwards compatibility reasons. Since we are controlling access modes with the storage layer, IMO it doesn't make sense to pretend that it's also controlled by the array / group layer, and we should deprecate the mode keyword argument.
Activity
d-v-b commentedon Apr 3, 2025
In zarr-python 3, arrays and groups don't have their own read / write permission model, instead all of that is handled by the storage layer.
Thus the
read_onlyproperty was added for backwards compatibility with v2, and it doesn't do what you would expect -- it reports whether the array is backed by a read-only store.. So in your example, because you are re-using a store instance, it keeps its original mode (which is probablya). I agree that this is confusing.dstansby commentedon Apr 3, 2025
Hmm, in that case should passing a mode to
open_arrayraise an exception, when the passed mode is different to the mode the store is open with?d-v-b commentedon Apr 3, 2025
i believe
open_arrayhas amodeparameter for backwards compatibility reasons. Since we are controlling access modes with the storage layer, IMO it doesn't make sense to pretend that it's also controlled by the array / group layer, and we should deprecate themodekeyword argument.dstansby commentedon Apr 3, 2025
👍 - I think it's pretty bad that it silently does nothing at the moment!