diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-05-13 17:18:02 -0500 |
|---|---|---|
| committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-07-16 14:40:20 -0500 |
| commit | 4e8e9284719ffc3f2add7ef4e23b33569c223689 (patch) | |
| tree | f0692bc8ede245a1fe4516469a4c8d98cbcfe5c5 /numpy/matrixlib/tests | |
| parent | 651862dd75db99dc4abcaf91e82ca21cf1309d08 (diff) | |
| download | numpy-4e8e9284719ffc3f2add7ef4e23b33569c223689.tar.gz | |
DEP: Deprecate ufunc.outer with matrix inputs
Previously we converted matrices to arrays for the user, since
`np.outer` does not make sense for matrix. This deprecates that
usage (which in almost all cases will result in an error).
The main reason for this deprecation is to remove all direct
references of matrix from the NumPy codebase, so that it is
easier to move it out of NumPy eventually.
Diffstat (limited to 'numpy/matrixlib/tests')
| -rw-r--r-- | numpy/matrixlib/tests/test_masked_matrix.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/matrixlib/tests/test_masked_matrix.py b/numpy/matrixlib/tests/test_masked_matrix.py index 45424ecf0..95d3f44b6 100644 --- a/numpy/matrixlib/tests/test_masked_matrix.py +++ b/numpy/matrixlib/tests/test_masked_matrix.py @@ -1,4 +1,5 @@ import numpy as np +from numpy.testing import assert_warns from numpy.ma.testutils import (assert_, assert_equal, assert_raises, assert_array_equal) from numpy.ma.core import (masked_array, masked_values, masked, allequal, @@ -198,7 +199,8 @@ class TestSubclassing: # Result should work assert_equal(add(mx, x), mx+x) assert_(isinstance(add(mx, mx)._data, np.matrix)) - assert_(isinstance(add.outer(mx, mx), MMatrix)) + with assert_warns(DeprecationWarning): + assert_(isinstance(add.outer(mx, mx), MMatrix)) assert_(isinstance(hypot(mx, mx), MMatrix)) assert_(isinstance(hypot(mx, x), MMatrix)) |
