Skip to content

Commit b19fbcf

Browse files
committed
clean up
1 parent 336d154 commit b19fbcf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

zarr/util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121

2222
# TODO: move the function to numcodecs
23-
def ensure_ndarray(buf, allow_copy=False, like=np.empty(())):
24-
"""Convenience function to coerce `buf` to numpy array like, if it is not already
25-
numpy array like.
23+
def ensure_ndarray(buf):
24+
"""Convenience function to coerce `buf` to a numpy array-like, if it is not
25+
already a numpy array-like.
2626
2727
Parameters
2828
----------
@@ -31,12 +31,13 @@ def ensure_ndarray(buf, allow_copy=False, like=np.empty(())):
3131
3232
Returns
3333
-------
34-
arr : ndarray-like
34+
arr : array-like
3535
A numpy array-like, sharing memory with `buf`.
3636
3737
Notes
3838
-----
39-
This function will not create a copy under any circumstances if `allow_copy=False`.
39+
This function will not create a copy under any circumstances, it is guaranteed to
40+
return a view on memory exported by `buf`.
4041
"""
4142

4243
if isinstance(buf, np.ndarray):

0 commit comments

Comments
 (0)