@@ -168,8 +168,8 @@ argument accepted by all array creation functions. For example::
168168 >>> data = np.arange(100000000, dtype='int32').reshape(10000, 10000)
169169 >>> z = zarr.create_array(store='data/example-5.zarr', shape=data.shape, dtype=data.dtype, chunks=(1000, 1000), compressors=compressors)
170170 >>> z[:] = data
171- >>> z.metadata.codecs
172- [BytesCodec(endian=<Endian.little: 'little'>), BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0)]
171+ >>> z.compressors
172+ ( BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
173173
174174This array above will use Blosc as the primary compressor, using the Zstandard
175175algorithm (compression level 3) internally within Blosc, and with the
@@ -188,7 +188,9 @@ which can be used to print useful diagnostics, e.g.::
188188 Order : C
189189 Read-only : False
190190 Store type : LocalStore
191- Codecs : [{'endian': <Endian.little: 'little'>}, {'typesize': 4, 'cname': <BloscCname.zstd: 'zstd'>, 'clevel': 3, 'shuffle': <BloscShuffle.bitshuffle: 'bitshuffle'>, 'blocksize': 0}]
191+ Filters : ()
192+ Serializer : BytesCodec(endian=<Endian.little: 'little'>)
193+ Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
192194 No. bytes : 400000000 (381.5M)
193195
194196The :func: `zarr.Array.info_complete ` method inspects the underlying store and
@@ -203,7 +205,9 @@ prints additional diagnostics, e.g.::
203205 Order : C
204206 Read-only : False
205207 Store type : LocalStore
206- Codecs : [{'endian': <Endian.little: 'little'>}, {'typesize': 4, 'cname': <BloscCname.zstd: 'zstd'>, 'clevel': 3, 'shuffle': <BloscShuffle.bitshuffle: 'bitshuffle'>, 'blocksize': 0}]
208+ Filters : ()
209+ Serializer : BytesCodec(endian=<Endian.little: 'little'>)
210+ Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=3, shuffle=<BloscShuffle.bitshuffle: 'bitshuffle'>, blocksize=0),)
207211 No. bytes : 400000000 (381.5M)
208212 No. bytes stored : 9696302
209213 Storage ratio : 41.3
@@ -223,8 +227,8 @@ here is an array using Gzip compression, level 1::
223227 >>> data = np.arange(100000000, dtype='int32').reshape(10000, 10000)
224228 >>> z = zarr.create_array(store='data/example-6.zarr', shape=data.shape, dtype=data.dtype, chunks=(1000, 1000), compressors=zarr.codecs.GzipCodec(level=1))
225229 >>> z[:] = data
226- >>> z.metadata.codecs
227- [BytesCodec(endian=<Endian.little: 'little'>), GzipCodec(level=1)]
230+ >>> z.compressors
231+ ( GzipCodec(level=1),)
228232
229233Here is an example using LZMA from NumCodecs _ with a custom filter pipeline including LZMA's
230234built-in delta filter::
@@ -236,23 +240,24 @@ built-in delta filter::
236240 >>> compressors = LZMA(filters=lzma_filters)
237241 >>> data = np.arange(100000000, dtype='int32').reshape(10000, 10000)
238242 >>> z = zarr.create_array(store='data/example-7.zarr', shape=data.shape, dtype=data.dtype, chunks=(1000, 1000), compressors=compressors)
239- >>> z.metadata.codecs
240- [BytesCodec(endian=<Endian.little: 'little'>), _make_bytes_bytes_codec.<locals>._Codec(codec_name='numcodecs.lzma', codec_config={'id': 'lzma', 'filters': [{'id': 3, 'dist': 4}, {'id': 33, 'preset': 1}]})]
243+ >>> z.compressors
244+ ( _make_bytes_bytes_codec.<locals>._Codec(codec_name='numcodecs.lzma', codec_config={'id': 'lzma', 'filters': [{'id': 3, 'dist': 4}, {'id': 33, 'preset': 1}]}),)
241245
242246The default compressor can be changed by setting the value of the using Zarr's
243247:ref: `user-guide-config `, e.g.::
244248
245249 >>> with zarr.config.set({'array.v2_default_compressor.numeric': {'id': 'blosc'}}):
246250 ... z = zarr.create_array(store={}, shape=(100000000,), chunks=(1000000,), dtype='int32', zarr_format=2)
247- >>> z.metadata.filters
248- >>> z.metadata.compressor
249- Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0)
251+ >>> z.filters
252+ ()
253+ >>> z.compressors
254+ (Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0),)
250255
251256To disable compression, set ``compressors=None `` when creating an array, e.g.::
252257
253258 >>> z = zarr.create_array(store='data/example-8.zarr', shape=(100000000,), chunks=(1000000,), dtype='int32', compressors=None)
254- >>> z.metadata.codecs
255- [BytesCodec(endian=<Endian.little: 'little'>)]
259+ >>> z.compressors
260+ ()
256261
257262.. _user-guide-filters :
258263
@@ -287,7 +292,9 @@ Here is an example using a delta filter with the Blosc compressor::
287292 Order : C
288293 Read-only : False
289294 Store type : LocalStore
290- Codecs : [{'codec_name': 'numcodecs.delta', 'codec_config': {'id': 'delta', 'dtype': 'int32'}}, {'endian': <Endian.little: 'little'>}, {'typesize': 4, 'cname': <BloscCname.zstd: 'zstd'>, 'clevel': 1, 'shuffle': <BloscShuffle.shuffle: 'shuffle'>, 'blocksize': 0}]
295+ Filters : (_make_array_array_codec.<locals>._Codec(codec_name='numcodecs.delta', codec_config={'id': 'delta', 'dtype': 'int32'}),)
296+ Serializer : BytesCodec(endian=<Endian.little: 'little'>)
297+ Compressors : (BloscCodec(typesize=4, cname=<BloscCname.zstd: 'zstd'>, clevel=1, shuffle=<BloscShuffle.shuffle: 'shuffle'>, blocksize=0),)
291298 No. bytes : 400000000 (381.5M)
292299
293300For more information about available filter codecs, see the `Numcodecs
@@ -600,11 +607,13 @@ Sharded arrays can be created by providing the ``shards`` parameter to :func:`za
600607 Order : C
601608 Read-only : False
602609 Store type : LocalStore
603- Codecs : [{'chunk_shape': (100, 100), 'codecs': ({'endian': <Endian.little: 'little'>}, {'level': 0, 'checksum': False}), 'index_codecs': ({'endian': <Endian.little: 'little'>}, {}), 'index_location': <ShardingCodecIndexLocation.end: 'end'>}]
610+ Filters : ()
611+ Serializer : BytesCodec(endian=<Endian.little: 'little'>)
612+ Compressors : (ZstdCodec(level=0, checksum=False),)
604613 No. bytes : 100000000 (95.4M)
605614 No. bytes stored : 3981060
606615 Storage ratio : 25.1
607- Chunks Initialized : 100
616+ Shards Initialized : 100
608617
609618In this example a shard shape of (1000, 1000) and a chunk shape of (100, 100) is used.
610619This means that 10*10 chunks are stored in each shard, and there are 10*10 shards in total.
0 commit comments