Skip to content

Commit df593ea

Browse files
jhammannormanrz
authored andcommitted
Apply suggestions from code review
Co-authored-by: Norman Rzepka <[email protected]>
1 parent cac32c0 commit df593ea

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

docs/quickstart.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ large-scale data.
2020
Installation
2121
------------
2222

23-
Zarr requires Python 3.10 or higher. You can install it via `pip`:
23+
Zarr requires Python 3.11 or higher. You can install it via `pip`:
2424

2525
.. code-block:: bash
2626
@@ -43,7 +43,7 @@ To get started, you can create a simple Zarr array:
4343
import numpy as np
4444
4545
# Create a 2D Zarr array
46-
z = zarr.zeros(
46+
z = zarr.create_array(
4747
store="data/example-1.zarr",
4848
shape=(100, 100),
4949
chunks=(10, 10),
@@ -65,14 +65,11 @@ Zarr supports data compression and filters. For example, to use Blosc compressio
6565

6666
.. ipython:: python
6767
68-
from numcodecs import Blosc
69-
70-
z = zarr.open(
68+
z = zarr.create_array(
7169
"data/example-3.zarr",
7270
mode="w", shape=(100, 100),
7371
chunks=(10, 10), dtype="f4",
74-
compressor=Blosc(cname="zstd", clevel=3, shuffle=Blosc.SHUFFLE),
75-
zarr_format=2
72+
compressor=zarr.codecs.BloscCodec(cname="zstd", clevel=3, shuffle=zarr.codecs.BloscShuffle.SHUFFLE)
7673
)
7774
z[:, :] = np.random.random((100, 100))
7875
@@ -116,7 +113,7 @@ including the :class:`zarr.storage.ZipStore` and :class:`zarr.storage.FsspecStor
116113
# Store the array in a ZIP file
117114
store = zarr.storage.ZipStore("data/example-3.zip", mode='w')
118115
119-
z = zarr.open(
116+
z = zarr.create_array(
120117
store=store,
121118
mode="w",
122119
shape=(100, 100),
@@ -137,7 +134,7 @@ To open an existing array:
137134
# Open the ZipStore in read-only mode
138135
store = zarr.storage.ZipStore("data/example-3.zip", read_only=True)
139136
140-
z = zarr.open(store, mode='r')
137+
z = zarr.open_array(store, mode='r')
141138
142139
# read the data as a NumPy Array
143140
z[:]
@@ -156,7 +153,7 @@ For example, to use S3:
156153
157154
import s3fs
158155
159-
z = zarr.open("s3://example-bucket/foo", mode="w", shape=(100, 100), chunks=(10, 10))
156+
z = zarr.create_array("s3://example-bucket/foo", mode="w", shape=(100, 100), chunks=(10, 10))
160157
z[:, :] = np.random.random((100, 100))
161158
162159
Read more about Zarr's :ref:`tutorial_storage` options in the User Guide.

0 commit comments

Comments
 (0)