-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
arraygood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.
Description
If 'a' is a dask array wrapped around a numpy masked array (with "from _array(..., asarray=False)",
then the result of "copy.deepcopy(a).compute()" is now (wrongly) not a masked array,
Though the original "a.compute()", and even "copy.copy(a)" are correct.
Example code to show :
import dask.array as da
import numpy.ma as ma
import copy
t = ma.masked_array([1, 2], mask=[0, 1])
a = da.from_array(t, chunks=t.shape, asarray=False)
print(copy.deepcopy(a).compute())
For example, in dask 0.18.1
>>> import dask
>>> import dask.array as da
>>> import numpy.ma as ma
>>> import copy
>>> t = ma.masked_array([1, 2], mask=[0, 1])
>>> a = da.from_array(t, chunks=t.shape, asarray=False)
>>> print(dask.__version__)
0.18.1
>>> print(copy.copy(a).compute())
[1 --]
>>> print(copy.deepcopy(a).compute())
[1 --]
>>>
But in 0.18.2 ...
>>> import dask
>>> import dask.array as da
>>> import numpy.ma as ma
>>> import copy
>>>
>>> t = ma.masked_array([1, 2], mask=[0, 1])
>>> a = da.from_array(t, chunks=t.shape, asarray=False)
>>>
>>> print(dask.__version__)
0.18.2
>>> print(copy.copy(a).compute())
[1 --]
>>> print(copy.deepcopy(a).compute())
[1 2]
>>>
Metadata
Metadata
Assignees
Labels
arraygood first issueClearly described and easy to accomplish. Good for beginners to the project.Clearly described and easy to accomplish. Good for beginners to the project.