summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/ma/core.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 6b1f09f19..690655b36 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3105,6 +3105,14 @@ class MaskedArray(ndarray):
Return the item described by i, as a masked array.
"""
+ # 2016.01.15 -- v1.11.0
+ warnings.warn(
+ "Currently, slicing will try to return a view of the data," +
+ " but will return a copy of the mask. In the future, it will try" +
+ " to return both as views.",
+ FutureWarning
+ )
+
dout = self.data[indx]
# We could directly use ndarray.__getitem__ on self.
# But then we would have to modify __array_finalize__ to prevent the
@@ -3175,6 +3183,15 @@ class MaskedArray(ndarray):
locations.
"""
+ # 2016.01.15 -- v1.11.0
+ warnings.warn(
+ "Currently, slicing will try to return a view of the data," +
+ " but will return a copy of the mask. In the future, it will try" +
+ " to return both as views. This means that using `__setitem__`" +
+ " will propagate values back through all masks that are present.",
+ FutureWarning
+ )
+
if self is masked:
raise MaskError('Cannot alter the masked element.')
_data = self._data