diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-07-31 12:55:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 12:55:22 -0500 |
commit | e30cc8e1148523b270fb5884d3743e5968ed3cb1 (patch) | |
tree | da17b259b68f2968269d6f03bc80988ce70eb2e9 /numpy/lib/tests/test_function_base.py | |
parent | 904571e7f5ebcd46899a2371e42625bc13b3ebc6 (diff) | |
parent | 07d96f4a5c8ab3123581d1c2a0d04f86e3f10816 (diff) | |
download | numpy-e30cc8e1148523b270fb5884d3743e5968ed3cb1.tar.gz |
Merge pull request #11637 from eric-wieser/simplify-angle
ENH: np.angle: Remove unnecessary multiplication, and allow subclasses to pass through
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index ba5b90e8c..d5faed6ae 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1043,6 +1043,16 @@ class TestAngle(object): assert_array_almost_equal(y, yo, 11) assert_array_almost_equal(z, zo, 11) + def test_subclass(self): + x = np.ma.array([1 + 3j, 1, np.sqrt(2)/2 * (1 + 1j)]) + x[1] = np.ma.masked + expected = np.ma.array([np.arctan(3.0 / 1.0), 0, np.arctan(1.0)]) + expected[1] = np.ma.masked + actual = angle(x) + assert_equal(type(actual), type(expected)) + assert_equal(actual.mask, expected.mask) + assert_equal(actual, expected) + class TestTrimZeros(object): |