summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorMarten van Kerkwijk <mhvk@astro.utoronto.ca>2018-04-26 17:39:58 -0400
committerMarten van Kerkwijk <mhvk@astro.utoronto.ca>2018-04-27 12:04:03 -0400
commitf18ebf68cfdf7aa816e42b1d358ad416b31a0ec1 (patch)
tree2bdd7ba0c93159650ab574489d9fea93d377721b /numpy/ma/extras.py
parentdadfb545e1cc8d873b999d82d331c0c58f11901f (diff)
downloadnumpy-f18ebf68cfdf7aa816e42b1d358ad416b31a0ec1.tar.gz
MAINT: move all masked array matrix tests to matrixlib.
Further progress in isolating matrix in preparation of its deprecation. There is one place left with an explicit reference to matrix (in MaskedArray.count), which is to be solved later.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 8272dced9..da35217d1 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -1465,9 +1465,14 @@ class MAxisConcatenator(AxisConcatenator):
"""
concatenate = staticmethod(concatenate)
- @staticmethod
- def makemat(arr):
- return array(arr.data.view(np.matrix), mask=arr.mask)
+ @classmethod
+ def makemat(cls, arr):
+ # There used to be a view as np.matrix here, but we may eventually
+ # deprecate that class. In preparation, we use the unmasked version
+ # to construct the matrix (with copy=False for backwards compatibility
+ # with the .view)
+ data = super(MAxisConcatenator, cls).makemat(arr.data, copy=False)
+ return array(data, mask=arr.mask)
def __getitem__(self, key):
# matrix builder syntax, like 'a, b; c, d'