Skip to content

Commit

Permalink
add Array.copy
Browse files Browse the repository at this point in the history
Fixes dask#911
  • Loading branch information
mrocklin committed Apr 22, 2016
1 parent 6e7fea6 commit ec81248
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dask/array/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,12 @@ def view(self, dtype, order='C'):
out._chunks = chunks
return out

def copy(self):
"""
Copy array. This is a no-op for dask.arrays, which are immutable
"""
return self

def to_imperative(self):
""" Convert Array into dask Values
Expand Down
5 changes: 5 additions & 0 deletions dask/array/tests/test_array_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2003,3 +2003,8 @@ def test_atop_names():
def test_A_property():
x = da.ones(5, chunks=(2,))
assert x.A is x


def test_copy():
x = da.ones(5, chunks=(2,))
assert x.copy() is x

0 comments on commit ec81248

Please sign in to comment.