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
add init_array, and data kwarg for create_array (#2761)
* add init_array, and data kwarg for create_array
* clean up some type hints and docstrings
* add release notes
* add tests for synchronous create_array
* Update src/zarr/api/synchronous.py
Co-authored-by: Deepak Cherian <[email protected]>
* error if shape / dtype and data are provided
---------
Co-authored-by: Deepak Cherian <[email protected]>
Adds a new function ``init_array`` for initializing an array in storage, and refactors ``create_array``
2
+
to use ``init_array``. ``create_array`` takes two a new parameters: ``data``, an optional array-like object, and ``write_data``, a bool which defaults to ``True``.
3
+
If ``data`` is given to ``create_array``, then the ``dtype`` and ``shape`` attributes of ``data`` are used to define the
4
+
corresponding attributes of the resulting Zarr array. Additionally, if ``data`` given and ``write_data`` is ``True``,
5
+
then the values in ``data`` will be written to the newly created array.
0 commit comments