Skip to content

Commit dc3f839

Browse files
jakirkhamCarreau
andauthored
Doctest seem to be stricter now, updating tostring() to tobytes() (#907)
Co-authored-by: Matthias Bussonnier <[email protected]>
1 parent f0677c2 commit dc3f839

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: docs/tutorial.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ Here is an example using S3Map to read an array created previously::
814814
array([b'H', b'e', b'l', b'l', b'o', b' ', b'f', b'r', b'o', b'm', b' ',
815815
b't', b'h', b'e', b' ', b'c', b'l', b'o', b'u', b'd', b'!'],
816816
dtype='|S1')
817-
>>> z[:].tostring()
817+
>>> z[:].tobytes()
818818
b'Hello from the cloud!'
819819

820820
Zarr now also has a builtin storage backend for Azure Blob Storage.
@@ -855,11 +855,11 @@ store. E.g.::
855855
>>> z = root['foo/bar/baz']
856856
>>> from timeit import timeit
857857
>>> # first data access is relatively slow, retrieved from store
858-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
858+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
859859
b'Hello from the cloud!'
860860
0.1081731989979744
861861
>>> # second data access is faster, uses cache
862-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
862+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
863863
b'Hello from the cloud!'
864864
0.0009490990014455747
865865

Diff for: zarr/storage.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2100,11 +2100,11 @@ class LRUStoreCache(Store):
21002100
>>> z = root['foo/bar/baz'] # doctest: +REMOTE_DATA
21012101
>>> from timeit import timeit
21022102
>>> # first data access is relatively slow, retrieved from store
2103-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
2103+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
21042104
b'Hello from the cloud!'
21052105
0.1081731989979744
21062106
>>> # second data access is faster, uses cache
2107-
... timeit('print(z[:].tostring())', number=1, globals=globals()) # doctest: +SKIP
2107+
... timeit('print(z[:].tobytes())', number=1, globals=globals()) # doctest: +SKIP
21082108
b'Hello from the cloud!'
21092109
0.0009490990014455747
21102110

0 commit comments

Comments
 (0)