Skip to content

Commit 4a39c97

Browse files
committed
Doctest seem to be stricter now, updating tostring() to tobytes()
1 parent 02e5683 commit 4a39c97

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/tutorial.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,14 @@ Here is an example using S3Map to read an array created previously::
797797
Compressor : Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0)
798798
Store type : fsspec.mapping.FSMap
799799
No. bytes : 21
800+
No. bytes stored : 382
801+
Storage ratio : 0.1
800802
Chunks initialized : 3/3
801803
>>> z[:]
802804
array([b'H', b'e', b'l', b'l', b'o', b' ', b'f', b'r', b'o', b'm', b' ',
803805
b't', b'h', b'e', b' ', b'c', b'l', b'o', b'u', b'd', b'!'],
804806
dtype='|S1')
805-
>>> z[:].tostring()
807+
>>> z[:].tobytes()
806808
b'Hello from the cloud!'
807809

808810
Zarr now also has a builtin storage backend for Azure Blob Storage.
@@ -841,11 +843,11 @@ store. E.g.::
841843
>>> z = root['foo/bar/baz']
842844
>>> from timeit import timeit
843845
>>> # first data access is relatively slow, retrieved from store
844-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
846+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
845847
b'Hello from the cloud!'
846848
0.1081731989979744
847849
>>> # second data access is faster, uses cache
848-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
850+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
849851
b'Hello from the cloud!'
850852
0.0009490990014455747
851853

zarr/storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,11 +1972,11 @@ class LRUStoreCache(MutableMapping):
19721972
>>> z = root['foo/bar/baz'] # doctest: +REMOTE_DATA
19731973
>>> from timeit import timeit
19741974
>>> # first data access is relatively slow, retrieved from store
1975-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
1975+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
19761976
b'Hello from the cloud!'
19771977
0.1081731989979744
19781978
>>> # second data access is faster, uses cache
1979-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
1979+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
19801980
b'Hello from the cloud!'
19811981
0.0009490990014455747
19821982

0 commit comments

Comments
 (0)