Skip to content

Commit c4f9b83

Browse files
committed
review docs
1 parent b7144aa commit c4f9b83

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

docs/spec/v2.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Zarr storage specification version 2
44
====================================
55

66
This document provides a technical specification of the protocol and format
7-
used for storing a Zarr array. The key words "MUST", "MUST NOT", "REQUIRED",
7+
used for storing Zarr arrays. The key words "MUST", "MUST NOT", "REQUIRED",
88
"SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
99
"OPTIONAL" in this document are to be interpreted as described in `RFC 2119
1010
<https://www.ietf.org/rfc/rfc2119.txt>`_.
@@ -56,12 +56,10 @@ chunks
5656
dtype
5757
A string or list defining a valid data type for the array. See also
5858
the subsection below on data type encoding.
59-
compression
60-
A string identifying the primary compression library used to compress
61-
each chunk of the array.
62-
compression_opts
63-
An integer, string or dictionary providing options to the primary
64-
compression library.
59+
compressor
60+
A JSON object identifying the primary compression codec and providing
61+
configuration parameters, or ``null`` if no compressor is to be used.
62+
The object MUST contain an ``"id"`` key identifying the codec to be used.
6563
fill_value
6664
A scalar value providing the default value to use for uninitialized
6765
portions of the array, or ``null`` if no fill_value is to be used.
@@ -70,9 +68,9 @@ order
7068
array. "C" means row-major order, i.e., the last dimension varies fastest;
7169
"F" means column-major order, i.e., the first dimension varies fastest.
7270
filters
73-
A list of JSON objects providing filter configurations, or ``null`` if no
74-
filters are to be applied. Each filter configuration object MUST contain a
75-
``"name"`` key identifying the filter to be used.
71+
A list of JSON objects providing codec configurations, or ``null`` if no
72+
filters are to be applied. Each codec configuration object MUST contain a
73+
``"id"`` key identifying the codec to be used.
7674

7775
Other keys MUST NOT be present within the metadata object.
7876

@@ -88,16 +86,16 @@ using the Blosc compression library prior to storage::
8886
1000,
8987
1000
9088
],
91-
"compression": "blosc",
92-
"compression_opts": {
93-
"clevel": 5,
89+
"compressor": {
90+
"id": "blosc",
9491
"cname": "lz4",
92+
"clevel": 5,
9593
"shuffle": 1
9694
},
9795
"dtype": "<f8",
9896
"fill_value": "NaN",
9997
"filters": [
100-
{"name": "delta", "dtype": "<f8", "astype": "<f4"}
98+
{"id": "delta", "dtype": "<f8", "astype": "<f4"}
10199
],
102100
"order": "C",
103101
"shape": [

docs/tutorial.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ the delta filter::
236236

237237
To disable compression, set ``compressor=None`` when creating an array.
238238

239-
To disable compression, set ``compression=None`` when creating an array.
240-
241239
.. _tutorial_filters:
242240

243241
Filters
@@ -270,7 +268,7 @@ Here is an example using the Zarr delta filter with the Blosc compressor:
270268

271269
Zarr comes with implementations of delta, scale-offset, quantize, packbits and
272270
categorize filters. It is also relatively straightforward to implement custom
273-
filters. For more information see the :mod:`zarr.filters` API docs.
271+
filters. For more information see the :mod:`zarr.codecs` API docs.
274272

275273
.. _tutorial_sync:
276274

@@ -583,6 +581,14 @@ to find a compromise, e.g.::
583581
>>> z3.chunks
584582
(1000, 1000)
585583

584+
If you are feeling lazy, you can let Zarr guess a chunk shape for your data,
585+
although please note that the algorithm for guessing a chunk shape is based on
586+
simple heuristics and may by far from optimal. E.g.::
587+
588+
>>> z4 = zarr.zeros((10000, 10000), dtype='i4')
589+
>>> z4.chunks
590+
(313, 313)
591+
586592
.. _tutorial_tips_blosc:
587593

588594
Configuring Blosc

0 commit comments

Comments
 (0)