Skip to content

Commit 990acf0

Browse files
committed
fix docstrings after blosc upgrade
1 parent 5f7e616 commit 990acf0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

docs/tutorial.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ scalar value::
4444
>>> z[:] = 42
4545
>>> z
4646
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
47-
nbytes: 381.5M; nbytes_stored: 2.2M; ratio: 170.4; initialized: 100/100
47+
nbytes: 381.5M; nbytes_stored: 1.8M; ratio: 215.1; initialized: 100/100
4848
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
4949
store: dict
5050

@@ -116,7 +116,7 @@ Check that the data have been written and can be read again::
116116
>>> z2 = zarr.open('example.zarr', mode='r')
117117
>>> z2
118118
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
119-
nbytes: 381.5M; nbytes_stored: 2.3M; ratio: 163.9; initialized: 100/100
119+
nbytes: 381.5M; nbytes_stored: 1.9M; ratio: 204.5; initialized: 100/100
120120
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
121121
store: DirectoryStore
122122
>>> np.all(z1[:] == z2[:])
@@ -135,7 +135,7 @@ can be increased or decreased in length. For example::
135135
>>> z.resize(20000, 10000)
136136
>>> z
137137
Array((20000, 10000), float64, chunks=(1000, 1000), order=C)
138-
nbytes: 1.5G; nbytes_stored: 5.7M; ratio: 268.5; initialized: 100/200
138+
nbytes: 1.5G; nbytes_stored: 3.6M; ratio: 422.3; initialized: 100/200
139139
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
140140
store: dict
141141

@@ -151,19 +151,19 @@ which can be used to append data to any axis. E.g.::
151151
>>> z = zarr.array(a, chunks=(1000, 100))
152152
>>> z
153153
Array((10000, 1000), int32, chunks=(1000, 100), order=C)
154-
nbytes: 38.1M; nbytes_stored: 1.9M; ratio: 20.0; initialized: 100/100
154+
nbytes: 38.1M; nbytes_stored: 1.9M; ratio: 20.3; initialized: 100/100
155155
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
156156
store: dict
157157
>>> z.append(a)
158158
>>> z
159159
Array((20000, 1000), int32, chunks=(1000, 100), order=C)
160-
nbytes: 76.3M; nbytes_stored: 3.8M; ratio: 20.0; initialized: 200/200
160+
nbytes: 76.3M; nbytes_stored: 3.8M; ratio: 20.3; initialized: 200/200
161161
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
162162
store: dict
163163
>>> z.append(np.vstack([a, a]), axis=1)
164164
>>> z
165165
Array((20000, 2000), int32, chunks=(1000, 100), order=C)
166-
nbytes: 152.6M; nbytes_stored: 7.6M; ratio: 20.0; initialized: 400/400
166+
nbytes: 152.6M; nbytes_stored: 7.5M; ratio: 20.3; initialized: 400/400
167167
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
168168
store: dict
169169

@@ -190,7 +190,7 @@ accepted by all array creation functions. For example::
190190
... compressor=zarr.Blosc(cname='zstd', clevel=3, shuffle=2))
191191
>>> z
192192
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
193-
nbytes: 381.5M; nbytes_stored: 3.1M; ratio: 121.1; initialized: 100/100
193+
nbytes: 381.5M; nbytes_stored: 4.4M; ratio: 87.6; initialized: 100/100
194194
compressor: Blosc(cname='zstd', clevel=3, shuffle=2)
195195
store: dict
196196

@@ -261,7 +261,7 @@ Here is an example using the Zarr delta filter with the Blosc compressor:
261261
... chunks=(1000, 1000), filters=filters, compressor=compressor)
262262
>>> z
263263
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
264-
nbytes: 381.5M; nbytes_stored: 381.9K; ratio: 1022.9; initialized: 100/100
264+
nbytes: 381.5M; nbytes_stored: 633.4K; ratio: 616.7; initialized: 100/100
265265
filters: Delta(dtype=int32)
266266
compressor: Blosc(cname='zstd', clevel=1, shuffle=1)
267267
store: dict
@@ -480,7 +480,7 @@ data. E.g.::
480480
store: dict
481481
>>> zarr.array(a, chunks=(1000, 1000), order='F')
482482
Array((10000, 10000), int32, chunks=(1000, 1000), order=F)
483-
nbytes: 381.5M; nbytes_stored: 9.5M; ratio: 40.1; initialized: 100/100
483+
nbytes: 381.5M; nbytes_stored: 9.2M; ratio: 41.6; initialized: 100/100
484484
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
485485
store: dict
486486

@@ -510,20 +510,20 @@ Here is an example storing an array directly into a Zip file::
510510
>>> z[:] = 42
511511
>>> z
512512
Array((1000, 1000), int32, chunks=(100, 100), order=C)
513-
nbytes: 3.8M; nbytes_stored: 25.7K; ratio: 152.0; initialized: 100/100
513+
nbytes: 3.8M; nbytes_stored: 21.8K; ratio: 179.2; initialized: 100/100
514514
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
515515
store: ZipStore
516516
>>> import os
517517
>>> os.path.getsize('example.zip')
518-
34721
518+
30721
519519

520520
Re-open and check that data have been written::
521521

522522
>>> store = zarr.ZipStore('example.zip', mode='r')
523523
>>> z = zarr.Array(store)
524524
>>> z
525525
Array((1000, 1000), int32, chunks=(100, 100), order=C)
526-
nbytes: 3.8M; nbytes_stored: 25.7K; ratio: 152.0; initialized: 100/100
526+
nbytes: 3.8M; nbytes_stored: 21.8K; ratio: 179.2; initialized: 100/100
527527
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
528528
store: ZipStore
529529
>>> z[:]

zarr/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def __getitem__(self, item):
308308
>>> z = zarr.array(np.arange(100000000), chunks=1000000, dtype='i4')
309309
>>> z
310310
Array((100000000,), int32, chunks=(1000000,), order=C)
311-
nbytes: 381.5M; nbytes_stored: 6.7M; ratio: 56.8; initialized: 100/100
311+
nbytes: 381.5M; nbytes_stored: 6.4M; ratio: 59.9; initialized: 100/100
312312
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
313313
store: dict
314314
@@ -333,7 +333,7 @@ def __getitem__(self, item):
333333
... chunks=(1000, 1000), dtype='i4')
334334
>>> z
335335
Array((10000, 10000), int32, chunks=(1000, 1000), order=C)
336-
nbytes: 381.5M; nbytes_stored: 9.5M; ratio: 40.1; initialized: 100/100
336+
nbytes: 381.5M; nbytes_stored: 9.2M; ratio: 41.6; initialized: 100/100
337337
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
338338
store: dict
339339
@@ -863,19 +863,19 @@ def append(self, data, axis=0):
863863
>>> z = zarr.array(a, chunks=(1000, 100))
864864
>>> z
865865
Array((10000, 1000), int32, chunks=(1000, 100), order=C)
866-
nbytes: 38.1M; nbytes_stored: 1.9M; ratio: 20.0; initialized: 100/100
866+
nbytes: 38.1M; nbytes_stored: 1.9M; ratio: 20.3; initialized: 100/100
867867
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
868868
store: dict
869869
>>> z.append(a)
870870
>>> z
871871
Array((20000, 1000), int32, chunks=(1000, 100), order=C)
872-
nbytes: 76.3M; nbytes_stored: 3.8M; ratio: 20.0; initialized: 200/200
872+
nbytes: 76.3M; nbytes_stored: 3.8M; ratio: 20.3; initialized: 200/200
873873
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
874874
store: dict
875875
>>> z.append(np.vstack([a, a]), axis=1)
876876
>>> z
877877
Array((20000, 2000), int32, chunks=(1000, 100), order=C)
878-
nbytes: 152.6M; nbytes_stored: 7.6M; ratio: 20.0; initialized: 400/400
878+
nbytes: 152.6M; nbytes_stored: 7.5M; ratio: 20.3; initialized: 400/400
879879
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
880880
store: dict
881881

zarr/creation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def array(data, **kwargs):
237237
>>> z = zarr.array(a, chunks=(1000, 1000))
238238
>>> z
239239
Array((10000, 10000), int64, chunks=(1000, 1000), order=C)
240-
nbytes: 762.9M; nbytes_stored: 17.1M; ratio: 44.7; initialized: 100/100
240+
nbytes: 762.9M; nbytes_stored: 15.2M; ratio: 50.2; initialized: 100/100
241241
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
242242
store: dict
243243
@@ -320,13 +320,13 @@ def open_array(path, mode='a', shape=None, chunks=None, dtype=None,
320320
>>> z1[:] = np.arange(100000000).reshape(10000, 10000)
321321
>>> z1
322322
Array((10000, 10000), float64, chunks=(1000, 1000), order=C)
323-
nbytes: 762.9M; nbytes_stored: 24.8M; ratio: 30.8; initialized: 100/100
323+
nbytes: 762.9M; nbytes_stored: 23.0M; ratio: 33.2; initialized: 100/100
324324
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
325325
store: DirectoryStore
326326
>>> z2 = zarr.open_array('example.zarr', mode='r')
327327
>>> z2
328328
Array((10000, 10000), float64, chunks=(1000, 1000), order=C)
329-
nbytes: 762.9M; nbytes_stored: 24.8M; ratio: 30.8; initialized: 100/100
329+
nbytes: 762.9M; nbytes_stored: 23.0M; ratio: 33.2; initialized: 100/100
330330
compressor: Blosc(cname='lz4', clevel=5, shuffle=1)
331331
store: DirectoryStore
332332
>>> np.all(z1[:] == z2[:])

0 commit comments

Comments
 (0)