Open
Description
Thank you for the efforts that have gone into hardening Zarr-Python's approach to read/write modes!
Now that it's no longer possible to open an array in read mode with a store with read_only=False
, I'm wondering if it would be possible/advisable to add a public setter method to modify a store's mode? This is the code that I had been working with. It'd be convenient to open a read only array without needing to create a new store instance:
def array_roundtrip(store):
"""
Round trip an array using a Zarr store
Args:
store: Store-Like object
"""
data = np.ones((3,3))
arr = zarr.create_array(store=store, overwrite=True, data=data)
assert isinstance(arr, Array)
# Read set values
arr2 = zarr.open_array(store=store, mode="r")
assert isinstance(arr2, Array)
np.testing.assert_array_equal(arr[:], data)