summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2010-03-18 21:43:07 +0000
committerPauli Virtanen <pav@iki.fi>2010-03-18 21:43:07 +0000
commit81140fe52e67f15614a735420c3fe0f592e17ab4 (patch)
tree9acca63757a70afffe46b4b5795a1381d9984828 /numpy/lib/tests/test_function_base.py
parent070619b16e4620e7d47a5955c27328e6dd3ec9a1 (diff)
downloadnumpy-81140fe52e67f15614a735420c3fe0f592e17ab4.tar.gz
BUG: lib: fix #1435, np.gradient should use zeros_like
Thanks to Ryan May for the patch.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 078c03790..a53e51028 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -266,6 +266,11 @@ class TestGradient(TestCase):
assert_raises(SyntaxError, gradient, x, array([1.,1.]),
array([1.,1.]), array([1.,1.]))
+ def test_masked(self):
+ # Make sure that gradient supports subclasses like masked arrays
+ x = np.ma.array([[1,1],[3,4]])
+ assert_equal(type(gradient(x)[0]), type(x))
+
class TestAngle(TestCase):
def test_basic(self):
x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j]