Skip to content

Commit b30b5a6

Browse files
committed
fix PY2 compat; workaround zict.Zip example
1 parent bacae68 commit b30b5a6

File tree

3 files changed

+327
-195
lines changed

3 files changed

+327
-195
lines changed

docs/tutorial.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,24 +355,25 @@ Here is an example storing an array directly into a Zip file via the
355355
>>> import zict
356356
>>> import os
357357
>>> store = zict.Zip('example.zip', mode='w')
358-
>>> z = zarr.zeros((1000, 1000), chunks=(100, 100), dtype='i4', store=store)
358+
>>> z = zarr.zeros((1000, 1000), chunks=(100, 100), dtype='i4',
359+
... compression='zlib', compression_opts=1, store=store)
359360
>>> z
360361
zarr.core.Array((1000, 1000), int32, chunks=(100, 100), order=C)
361-
compression: blosc; compression_opts: {'clevel': 5, 'cname': 'blosclz', 'shuffle': 1}
362+
compression: zlib; compression_opts: 1
362363
nbytes: 3.8M; initialized: 0/100
363364
store: zict.zip.Zip
364365
>>> z[:] = 42
365366
>>> store.flush() # only required for zict.Zip
366367
>>> os.path.getsize('example.zip')
367-
34805
368+
30828
368369

369370
Re-open and check that data have been written::
370371

371372
>>> store = zict.Zip('example.zip', mode='r')
372373
>>> z = zarr.Array(store)
373374
>>> z
374375
zarr.core.Array((1000, 1000), int32, chunks=(100, 100), order=C)
375-
compression: blosc; compression_opts: {'clevel': 5, 'cname': 'blosclz', 'shuffle': 1}
376+
compression: zlib; compression_opts: 1
376377
nbytes: 3.8M; initialized: 100/100
377378
store: zict.zip.Zip
378379
>>> z[:]

0 commit comments

Comments
 (0)