zarr-python
zarr-python copied to clipboard
V3 array creation dtype parameter
In V2, an array can be created with no dtype. The default dtype is f8: https://zarr.readthedocs.io/en/stable/api/creation.html#zarr.creation.create
In V3, dtype is mandatory.
import zarr
arr = zarr.Array.create(store=zarr.store.MemoryStore(), shape=(10,), chunks=(5,))
# -> TypeError: Array.create() missing 1 required keyword-only argument: 'dtype'
I think we should consider bringing back the default for backwards compatibility.
I can handle this in #1884 where we will be handling most of the API compatibility for creation.
This is working now:
In [1]: import zarr
In [2]: zarr.__version__
Out[2]: '3.0.0a4'
In [3]: a = zarr.create(shape=(10, ))
In [4]: a.dtype
Out[4]: dtype('float64')