Skip to content

Commit 0cdff6d

Browse files
committed
tweak repr
1 parent 1722c38 commit 0cdff6d

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Create an array::
3434
>>> import zarr
3535
>>> z = zarr.empty((10000, 1000), dtype='i4', chunks=(1000, 100))
3636
>>> z
37-
zarr.ext.Array((10000, 1000), int32, chunks=(1000, 100), nbytes=38.1M, cbytes=0, cname=blosclz, clevel=5, shuffle=1)
37+
zarr.ext.Array((10000, 1000), int32, chunks=(1000, 100), cname='blosclz', clevel=5, shuffle=1)
38+
nbytes: 38.1M; cbytes: 0
3839

3940
Fill it with some data::
4041

@@ -80,7 +81,8 @@ Tuning
8081
------
8182

8283
``zarr`` is designed for use in parallel computations working chunk-wise
83-
over data. Try it with [dask.array](http://dask.pydata.org/en/latest/array.html).
84+
over data. Try it with `dask.array <http://dask.pydata.org/en/latest/array>`_
85+
.html).
8486

8587
``zarr`` is optimised for accessing and storing data in contiguous slices,
8688
of the same size or larger than chunks. It is not and will never be
@@ -92,6 +94,6 @@ the correlation structure in your data.
9294
Acknowledgments
9395
---------------
9496

95-
``zarr`` uses [c-blosc](https://github.com/Blosc/c-blosc) internally for
97+
``zarr`` uses `c-blosc <https://github.com/Blosc/c-blosc>`_ internally for
9698
compression and decompression and borrows code heavily from
97-
[bcolz](http://bcolz.blosc.org/).
99+
`bcolz <http://bcolz.blosc.org/>`_.

notebooks/benchmarks_synthetic.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"output_type": "stream",
1313
"text": [
1414
"numpy 1.10.2\n",
15-
"zarr 0.1.1.dev7+dirty blosc 1.7.0 $Date:: 2015-07-05 #$\n",
15+
"zarr 0.2.6.dev0+dirty blosc 1.7.0 $Date:: 2015-07-05 #$\n",
1616
"bcolz 0.12.2.dev22+dirty blosc 1.7.0 $Date:: 2015-07-05 #$\n"
1717
]
1818
},
@@ -104,7 +104,8 @@
104104
{
105105
"data": {
106106
"text/plain": [
107-
"zarr.ext.Array((100000000,), int32, chunks=(262144,), nbytes=381.5M, cbytes=6.6M, cratio=57.4, cname=lz4, clevel=5, shuffle=1)"
107+
"zarr.ext.Array((100000000,), int32, chunks=(262144,), cname='lz4', clevel=5, shuffle=1)\n",
108+
" nbytes: 381.5M; cbytes: 6.6M; ratio: 57.4"
108109
]
109110
},
110111
"execution_count": 4,

zarr/ext.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,14 @@ cdef class Array:
572572
r += '%s' % str(self.shape)
573573
r += ', %s' % str(self.dtype)
574574
r += ', chunks=%s' % str(self.chunks)
575-
r += ', nbytes=%s' % _util.human_readable_size(self.nbytes)
576-
r += ', cbytes=%s' % _util.human_readable_size(self.cbytes)
577-
if self.cbytes > 0:
578-
r += ', cratio=%.1f' % (self.nbytes / self.cbytes)
579-
r += ', cname=%s' % str(self.cname, 'ascii')
575+
r += ', cname=%r' % str(self.cname, 'ascii')
580576
r += ', clevel=%s' % self.clevel
581577
r += ', shuffle=%s' % self.shuffle
582578
r += ')'
579+
r += '\n nbytes: %s' % _util.human_readable_size(self.nbytes)
580+
r += '; cbytes: %s' % _util.human_readable_size(self.cbytes)
581+
if self.cbytes > 0:
582+
r += '; ratio: %.1f' % (self.nbytes / self.cbytes)
583583
return r
584584

585585
def resize(self, *args):

0 commit comments

Comments
 (0)