-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
4 changed files
with
419 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Adds a new function ``init_array`` for initializing an array in storage, and refactors ``create_array`` | ||
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``. | ||
If ``data`` is given to ``create_array``, then the ``dtype`` and ``shape`` attributes of ``data`` are used to define the | ||
corresponding attributes of the resulting Zarr array. Additionally, if ``data`` given and ``write_data`` is ``True``, | ||
then the values in ``data`` will be written to the newly created array. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.